Patch #3344 2012-10-05 22:15

alpha0010

Abbreviations: follow active EOL style
Download
3344-Abbreviations.patch (747 bytes)
Category
Plugin::Bugfix
Status
Accepted
Close date
2012-10-06 05:07
Assigned to
mortenmacfly
Index: src/plugins/abbreviations/abbreviations.cpp
===================================================================
--- src/plugins/abbreviations/abbreviations.cpp    (revision 8429)
+++ src/plugins/abbreviations/abbreviations.cpp    (working copy)
@@ -244,6 +244,11 @@
 
             // replace any other macros in the generated code
             Manager::Get()->GetMacrosManager()->ReplaceMacros(code);
+            // match current EOL mode
+            if (control->GetEOLMode() == wxSCI_EOL_CRLF)
+                code.Replace(wxT("\n"), wxT("\r\n"));
+            else if (control->GetEOLMode() == wxSCI_EOL_CR)
+                code.Replace(wxT("\n"), wxT("\r"));
             // add the text
             control->InsertText(curPos, code);