User forums > Nightly builds

The 23 October 2012 build (8476) is out.

<< < (5/6) > >>

MortenMacFly:

--- Quote from: Alpha on October 28, 2012, 02:56:40 am ---The "correct" solution is probably to simply save in the format expected for input:

--- End quote ---
This sounds reasonable and also explains why I was unable to reproduce. I've applied that one. Thanks! :-)

MortenMacFly:

--- Quote from: carra on October 28, 2012, 01:20:16 pm ---Yes, this makes sense: I'm under Windows and my abbreviations are custom  :D

--- End quote ---
The next nightly (not the one of today) is worth a try for you... or you self-compile is from trunk now.

Alpha:

--- Quote from: MortenMacFly on October 28, 2012, 02:45:14 pm ---I've applied that one.

--- End quote ---
It looks like application might have been partial?  Literal "\\r" strings from previous saves must be removed.

--- Code: ---Index: src/plugins/abbreviations/abbreviations.cpp
===================================================================
--- src/plugins/abbreviations/abbreviations.cpp (revision 8485)
+++ src/plugins/abbreviations/abbreviations.cpp (working copy)
@@ -278,11 +278,11 @@
         if (name.IsEmpty())
             continue;
         // convert non-printable chars to printable
-        code.Replace(_T("\\n"),  _T("\n"));
-        code.Replace(_T("\\t"),  _T("\t"));
-        // ... but remove if it does (EOL style is matched just before code generation)
-        code.Replace(_T("\r\n"), _T("\n"));
-        code.Replace(_T("\r"),   _T("\n"));
+        code.Replace(_T("\\n"),   _T("\n"));
+        code.Replace(_T("\\t"),   _T("\t"));
+        // should not exist, but remove if it does (EOL style is matched just before code generation)
+        code.Replace(_T("\\r\n"), _T("\n"));
+        code.Replace(_T("\\r"),   _T("\n"));
         m_AutoCompleteMap[name] = code;
     }
 
@@ -351,9 +351,9 @@
     {
         wxString code = it->second;
         // convert non-printable chars to printable
-        code.Replace(_T("\r\n"), _T("\\n"));
+        code.Replace(_T("\r\n"), _T("\\n")); // EOL style will be matched just before code generation
         code.Replace(_T("\n"),   _T("\\n"));
-        code.Replace(_T("\r"),   _T("\\n")); // should not exist ...
+        code.Replace(_T("\r"),   _T("\\n"));
         code.Replace(_T("\t"),   _T("\\t"));
 
         ++count;

--- End code ---

oBFusCATed:
If you ask me the best solution is to always save it in \n or \n\r mode and apply the proper mode when displaying, applying the abbreviation.

Alpha:

--- Quote from: oBFusCATed on October 29, 2012, 07:24:57 pm ---If you ask me the best solution is to always save it in \n or \n\r mode and apply the proper mode when displaying, applying the abbreviation.

--- End quote ---
Um... if I understand you correctly, I think that is exactly what I did?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version