From 9b07a9e45a954b3b5d49dddad1772806852eda4c Mon Sep 17 00:00:00 2001 From: Peter Ped Helcmanovsky Date: Sun, 5 Feb 2023 19:49:20 +0100 Subject: [PATCH] ide: Editor overwrite mode fixes (#143) --- uppsrc/CodeEditor/CLogic.cpp | 2 +- uppsrc/CodeEditor/CodeEditor.cpp | 2 +- uppsrc/CodeEditor/PythonSyntax.cpp | 2 +- uppsrc/CodeEditor/Syntax.cpp | 2 +- uppsrc/CodeEditor/TagSyntax.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uppsrc/CodeEditor/CLogic.cpp b/uppsrc/CodeEditor/CLogic.cpp index da40f77a0..5ad97f7d9 100644 --- a/uppsrc/CodeEditor/CLogic.cpp +++ b/uppsrc/CodeEditor/CLogic.cpp @@ -129,7 +129,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat) int cl = e.GetCursorLine(); WString l = e.GetWLine(cl); if(chr != '{' && chr != '}' || count > 1) { - e.InsertChar(chr, 1, true); + e.InsertChar(chr, count, true); return; } const wchar *s; diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index fdd5152c3..0a67ab9c4 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -343,7 +343,7 @@ void CodeEditor::IndentInsert(int chr, int count) { if(s) s->IndentInsert(*this, chr, count); else - InsertChar(chr, count); + InsertChar(chr, count, true); } void CodeEditor::Make(Event op) diff --git a/uppsrc/CodeEditor/PythonSyntax.cpp b/uppsrc/CodeEditor/PythonSyntax.cpp index 053866820..f66df177b 100644 --- a/uppsrc/CodeEditor/PythonSyntax.cpp +++ b/uppsrc/CodeEditor/PythonSyntax.cpp @@ -80,7 +80,7 @@ void PythonSyntax::IndentInsert(CodeEditor& editor, int chr, int count) } } if(count > 0) - editor.InsertChar(chr, count); + editor.InsertChar(chr, count, true); } bool PythonSyntax::LineHasColon(const WString& line) diff --git a/uppsrc/CodeEditor/Syntax.cpp b/uppsrc/CodeEditor/Syntax.cpp index 2b2adde4a..2d6748415 100644 --- a/uppsrc/CodeEditor/Syntax.cpp +++ b/uppsrc/CodeEditor/Syntax.cpp @@ -16,7 +16,7 @@ void EditorSyntax::Serialize(Stream& s) void EditorSyntax::IndentInsert(CodeEditor& editor, int chr, int count) { - editor.InsertChar(chr, count); + editor.InsertChar(chr, count, true); } bool EditorSyntax::CheckBrackets(CodeEditor& e, int64& bpos0, int64& bpos) diff --git a/uppsrc/CodeEditor/TagSyntax.cpp b/uppsrc/CodeEditor/TagSyntax.cpp index 18fc57a4a..e26991913 100644 --- a/uppsrc/CodeEditor/TagSyntax.cpp +++ b/uppsrc/CodeEditor/TagSyntax.cpp @@ -276,7 +276,7 @@ void TagSyntax::IndentInsert(CodeEditor& editor, int chr, int count) if(status == SCRIPT) script.IndentInsert(editor, chr, count); else - editor.InsertChar(chr, count); + editor.InsertChar(chr, count, true); } bool TagSyntax::CheckBrackets(CodeEditor& e, int64& bpos0, int64& bpos)