Patch #3329 2012-09-03 01:15

alpha0010

Jump to PP directive: search first line
Download
3329-Jump_to_PP_dir.patch (984 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2012-09-15 15:41
Assigned to
mortenmacfly
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp    (revision 8250)
+++ src/sdk/cbeditor.cpp    (working copy)
@@ -2569,6 +2569,8 @@
     // if we haven't found it, we 'll search at pos-1 too
     if (matchingBrace == wxSCI_INVALID_POSITION)
         matchingBrace = control->BraceMatch(control->GetCurrentPos() - 1);
+    else
+        ++matchingBrace; // to keep the caret on the same side of the brace
 
     // else look for a matching preprocessor command
     if (matchingBrace == wxSCI_INVALID_POSITION)
@@ -2597,7 +2599,7 @@
         else if (ppEnd.Matches(control->GetCurLine()))
         {
             int depth = -1; // search backwards
-            for (int i = control->GetCurrentLine() - 1; i > 0; --i)
+            for (int i = control->GetCurrentLine() - 1; i >= 0; --i)
             {
                 if (ppIf.Matches(control->GetLine(i))) // ignore else's, elif's, ...
                     ++depth;