diff options
author | Levi Bard <levi@unity3d.com> | 2011-02-28 19:57:04 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2011-02-28 20:13:35 +0300 |
commit | 6c3619315f87d26c880bdb6760c192e00759a705 (patch) | |
tree | 88d5163b27473f53372cf1c26adf36d0420c8c4c | |
parent | 39566abc149a08dc8d7796b4573b692313d7ed99 (diff) |
[Fix] Fix unhandled exceptions from C smart indenter. Bug 675171.
* Gui/CTextEditorExtension.cs: Trim substring length to line length.
License: MIT/X11
-rw-r--r-- | main/src/addins/CBinding/Gui/CTextEditorExtension.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs index 52533d8fac..a417bc1eaf 100644 --- a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs +++ b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs @@ -151,8 +151,9 @@ namespace CBinding public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier) { var line = Editor.Document.GetLine (Editor.Caret.Line); - int lineCursorIndex = Editor.Caret.Column; string lineText = Editor.GetLineText (Editor.Caret.Line); + int lineCursorIndex = Math.Min (lineText.Length, Editor.Caret.Column); + // Smart Indentation if (TextEditorProperties.IndentStyle == IndentStyle.Smart) { |