Author Topic: The 23 October 2012 build (8476) is out.  (Read 107326 times)

stefanos_

  • Guest
Re: The 23 October 2012 build (8476) is out.
« Reply #15 on: October 27, 2012, 09:59:26 pm »
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
« Last Edit: October 27, 2012, 10:05:23 pm by stefanos_ »

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 114
Re: The 23 October 2012 build (8476) is out.
« Reply #16 on: October 27, 2012, 10:41:39 pm »
We will take care... (maybe its already resolved in SVN...)
Glad to hear that Morten :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: The 23 October 2012 build (8476) is out.
« Reply #17 on: October 27, 2012, 10:49:19 pm »
Glad to hear that Morten :)
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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: The 23 October 2012 build (8476) is out.
« Reply #18 on: October 28, 2012, 02:56:40 am »
This nightly still has the bug of inserting extra lines in abbreviations.
It looks like I made one to many assumptions in optimizing the patch for revision 8434.
Well I just tried and I cannot reproduce.
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: [Select]
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;

However, settings would still create problems if not converted:
Code: [Select]
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;

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 114
Re: The 23 October 2012 build (8476) is out.
« Reply #19 on: October 28, 2012, 01:20:16 pm »
This behavior will only occur during use of a custom abbreviation, and only if it was created with CR LF line endings.
Yes, this makes sense: I'm under Windows and my abbreviations are custom  :D

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: The 23 October 2012 build (8476) is out.
« Reply #20 on: October 28, 2012, 02:45:14 pm »
The "correct" solution is probably to simply save in the format expected for input:
This sounds reasonable and also explains why I was unable to reproduce. I've applied that one. Thanks! :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: The 23 October 2012 build (8476) is out.
« Reply #21 on: October 28, 2012, 02:46:17 pm »
Yes, this makes sense: I'm under Windows and my abbreviations are custom  :D
The next nightly (not the one of today) is worth a try for you... or you self-compile is from trunk now.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: The 23 October 2012 build (8476) is out.
« Reply #22 on: October 28, 2012, 04:48:07 pm »
I've applied that one.
It looks like application might have been partial?  Literal "\\r" strings from previous saves must be removed.
Code: [Select]
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;

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: The 23 October 2012 build (8476) is out.
« Reply #23 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: The 23 October 2012 build (8476) is out.
« Reply #24 on: October 29, 2012, 09:16:12 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.
Um... if I understand you correctly, I think that is exactly what I did?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: The 23 October 2012 build (8476) is out.
« Reply #25 on: October 29, 2012, 09:35:26 pm »
This is good :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]