diff --git a/EditorContext/EditorContext.cs b/EditorContext/EditorContext.cs index 7d50e7d..dc5705d 100644 --- a/EditorContext/EditorContext.cs +++ b/EditorContext/EditorContext.cs @@ -9,6 +9,7 @@ public abstract class EditorContext { public string _originalText; public int _lastParseTopRow; + public int _lastParseHeight; public int _lastParseRightColumn; public int _tabWidth; public bool CanFormat = false; diff --git a/EditorContext/JSONEditorContext.cs b/EditorContext/JSONEditorContext.cs index a89bbef..151ebd1 100644 --- a/EditorContext/JSONEditorContext.cs +++ b/EditorContext/JSONEditorContext.cs @@ -126,7 +126,7 @@ public List ParseJsonToken(string text, List> Runes) public override void ParseText(int height, int topRow, int left, int right, string text, List> Runes) { // quick exit when text is the same and the top row / right col has not changed - if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn) + if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn && _lastParseHeight == height) { return; } @@ -144,6 +144,7 @@ public override void ParseText(int height, int topRow, int left, int right, stri int bottom = topRow + height; _originalText = text; _lastParseTopRow = topRow; + _lastParseHeight = height; _lastParseRightColumn = right; long count = 0; var row = 0; diff --git a/EditorContext/MarkdownEditorContext.cs b/EditorContext/MarkdownEditorContext.cs index 2ac2267..9b1ef84 100644 --- a/EditorContext/MarkdownEditorContext.cs +++ b/EditorContext/MarkdownEditorContext.cs @@ -184,7 +184,7 @@ public List ParseMarkdownToken(string text, List> Runes) public override void ParseText(int height, int topRow, int left, int right, string text, List> Runes) { // Quick exit when text is the same and the top row / right col has not changed - if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn) + if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn && _lastParseHeight == height) { return; } @@ -202,6 +202,7 @@ public override void ParseText(int height, int topRow, int left, int right, stri int bottom = topRow + height; _originalText = text; _lastParseTopRow = topRow; + _lastParseHeight = height; _lastParseRightColumn = right; var row = 0; diff --git a/EditorContext/PowerShellEditorContext.cs b/EditorContext/PowerShellEditorContext.cs index cd9e3e9..9cab8a3 100644 --- a/EditorContext/PowerShellEditorContext.cs +++ b/EditorContext/PowerShellEditorContext.cs @@ -197,7 +197,7 @@ public List ParsePowershellToken(Token[] tokens, string text, List< public override void ParseText(int height, int topRow, int left, int right, string text, List> Runes) { // quick exit when text is the same and the top row / right col has not changed - if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn) + if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn && _lastParseHeight == height) { return; } @@ -217,6 +217,7 @@ public override void ParseText(int height, int topRow, int left, int right, stri int bottom = topRow + height; _originalText = text; _lastParseTopRow = topRow; + _lastParseHeight = height; _lastParseRightColumn = right; var row = 0; for (int idxRow = topRow; idxRow < Runes.Count; idxRow++) diff --git a/EditorContext/XmlEditorContext.cs b/EditorContext/XmlEditorContext.cs index 6df2832..16f05bc 100644 --- a/EditorContext/XmlEditorContext.cs +++ b/EditorContext/XmlEditorContext.cs @@ -391,7 +391,7 @@ private void AddParseResult(List resultList, int lineNumber, int st public override void ParseText(int height, int topRow, int left, int right, string text, List> Runes) { - if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn) + if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn && _lastParseHeight == height) { return; } @@ -408,6 +408,7 @@ public override void ParseText(int height, int topRow, int left, int right, stri int bottom = topRow + height; _originalText = text; _lastParseTopRow = topRow; + _lastParseHeight = height; _lastParseRightColumn = right; var row = 0; diff --git a/EditorContext/YamlEditorContext.cs b/EditorContext/YamlEditorContext.cs index 0996d93..50ffb4a 100644 --- a/EditorContext/YamlEditorContext.cs +++ b/EditorContext/YamlEditorContext.cs @@ -115,7 +115,7 @@ public List ParseYamlToken(string text, List> Runes) } public override void ParseText(int height, int topRow, int left, int right, string text, List> Runes) { - if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn) + if (_originalText == text && topRow == _lastParseTopRow && right == _lastParseRightColumn && _lastParseHeight == height) { return; } @@ -130,6 +130,7 @@ public override void ParseText(int height, int topRow, int left, int right, stri int bottom = topRow + height; _originalText = text; _lastParseTopRow = topRow; + _lastParseHeight = height; _lastParseRightColumn = right; long count = 0; var row = 0;