User forums > Nightly builds

The 23 October 2012 build (8476) is out.

<< < (4/6) > >>

stefanos_:
Can someone see this old issue http://forums.codeblocks.org/index.php/topic,16560.msg112659.html#msg112659 :/ ? It's still there and I cannot work like this. The hint is really annoying like that!

Version: svn-8477 (self-compiled as always)
OS: GNU / Linux Debian wheezy (32-bit)
Compiler: GCC-4.6

carra:

--- Quote from: MortenMacFly on October 27, 2012, 05:20:58 pm ---We will take care... (maybe its already resolved in SVN...)
--- End quote ---
Glad to hear that Morten :)

MortenMacFly:

--- Quote from: carra on October 27, 2012, 10:41:39 pm ---Glad to hear that Morten :)

--- End quote ---
Well I just tried and I cannot reproduce. There has been a patch applied recently - if you are willing, try with t self-compiled version from trunk (to wait for the next nightly). Nag me again if it isn't resolved.

Maybe in between state again exactly what to do to reproduce, including:
- version of C::B
- platform
- editor settings
- abbreviations
- steps you do to achieve the unwanted result.

BTW: Are you sure your abbreviations are setup correctly? I.e. are the line feeds OK there, too?

Alpha:

--- Quote from: carra on October 27, 2012, 10:55:05 am ---This nightly still has the bug of inserting extra lines in abbreviations.

--- End quote ---
It looks like I made one to many assumptions in optimizing the patch for revision 8434.

--- Quote from: MortenMacFly on October 27, 2012, 10:49:19 pm ---Well I just tried and I cannot reproduce.

--- End quote ---
This behavior will only occur during use of a custom abbreviation, and only if it was created with CR LF line endings.

The "correct" solution is probably to simply save in the format expected for input:

--- Code: ---Index: src/plugins/abbreviations/abbreviations.cpp
===================================================================
--- src/plugins/abbreviations/abbreviations.cpp (revision 8478)
+++ src/plugins/abbreviations/abbreviations.cpp (working copy)
@@ -279,7 +279,6 @@
             continue;
         // convert non-printable chars to printable
         code.Replace(_T("\\n"), _T("\n"));
-        code.Replace(_T("\\r"), _T("\r"));
         code.Replace(_T("\\t"), _T("\t"));
         m_AutoCompleteMap[name] = code;
     }
@@ -349,8 +348,9 @@
     {
         wxString code = it->second;
         // convert non-printable chars to printable
+        code.Replace(_T("\r\n"), _T("\\n"));
         code.Replace(_T("\n"), _T("\\n"));
-        code.Replace(_T("\r"), _T("\\r"));
+        code.Replace(_T("\r"), _T("\\n"));
         code.Replace(_T("\t"), _T("\\t"));
 
         ++count;

--- End code ---

However, settings would still create problems if not converted:

--- Code: ---Index: src/plugins/abbreviations/abbreviations.cpp
===================================================================
--- src/plugins/abbreviations/abbreviations.cpp (revision 8478)
+++ src/plugins/abbreviations/abbreviations.cpp (working copy)
@@ -279,8 +279,11 @@
             continue;
         // convert non-printable chars to printable
         code.Replace(_T("\\n"), _T("\n"));
-        code.Replace(_T("\\r"), _T("\r"));
+        code.Replace(_T("\\r"), _T("\r")); // should not exist ...
         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"));
         m_AutoCompleteMap[name] = code;
     }
 
@@ -349,8 +352,9 @@
     {
         wxString code = it->second;
         // convert non-printable chars to printable
+        code.Replace(_T("\r\n"), _T("\\n"));
         code.Replace(_T("\n"), _T("\\n"));
-        code.Replace(_T("\r"), _T("\\r"));
+        code.Replace(_T("\r"), _T("\\n"));
         code.Replace(_T("\t"), _T("\\t"));
 
         ++count;

--- End code ---

carra:

--- Quote from: Alpha on October 28, 2012, 02:56:40 am ---This behavior will only occur during use of a custom abbreviation, and only if it was created with CR LF line endings.
--- End quote ---
Yes, this makes sense: I'm under Windows and my abbreviations are custom  :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version