News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

The 01 October 2013 build (9378) is out.

Started by killerbot, October 02, 2013, 08:48:57 AM

Previous topic - Next topic

Static

1. create the new wxWidgets project. Let's name it 'completion_test'.
    - open the generated completion_testMain.cpp, place the cursor next line to #include <wx/msgdlg.h>
    - type #include ""
    - move the cursor between two quote marks and start typing comple
    - when the completion variants show up select any and press enter. You'll get an extra quote mark at the end of the line.
2. create a new folder in project directory. Place any header file into it.
    - open the generated completion_testMain.cpp
    - type #include "folder/
    - select your header file from the completion variants. You'll get something like #include "folder/"folder/header.h"

OS: win7 64
wxWidgets 2.9.5
code::blocks rev. 9378

Alpha

Under linux and wx28, 1. confirmed, 2. cannot reproduce.

Alpha

Can you try applying this patch?

Index: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp (revision 9398)
+++ src/plugins/codecompletion/codecompletion.cpp (working copy)
@@ -1562,7 +1562,6 @@
         {
             --startPos;
         }
-        const int endPos = control->WordEndPosition(curPos, true);
         bool needReparse = false;

         if (control->IsPreprocessor(control->GetStyleAt(curPos)))
@@ -1606,7 +1605,7 @@
             }
             needReparse = true;

-            int   pos = startPos;
+            int   pos = startPos - 1;
             wxChar ch = control->GetCharAt(pos);
             while (ch != _T('<') && ch != _T('"') && ch != _T('#') && (pos>0))
                 ch = control->GetCharAt(--pos);
@@ -1618,11 +1617,14 @@
             else if (ch == _T('<'))
                 itemText << _T('>');
         }
+        else
+        {
+            const int endPos = control->WordEndPosition(curPos, true);
+            const wxString& alreadyText = control->GetTextRange(curPos, endPos);
+            if (!alreadyText.IsEmpty() && itemText.EndsWith(alreadyText))
+                curPos = endPos;
+        }

-        const wxString alreadyText = control->GetTextRange(curPos, endPos);
-        if (!alreadyText.IsEmpty() && itemText.EndsWith(alreadyText))
-            curPos = endPos;
-
         control->AutoCompCancel();

         int positionModificator = 0;

Static

Thank you for the reply.
I use precompiled binaries for code::blocks, so it would take me some time to check the patch.
I'll try to download and compile sources tomorrow at night, still can't promise that :(

oBFusCATed

(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!]

Alpha

Quote from: Alpha on October 13, 2013, 05:47:35 PM
Can you try applying this patch?
[...]
I have not noticed problems with this patch, and will commit soon if there are no further comments.  (I would appreciate if someone who has observed problem 2. can report whether or not this patch resolves it.)

Randajad

After updating from 9158 codeblocks drop all compiler settings.
It's too sad, will stay on 9158.

White-Tiger

#22
what do you mean exactly? I'm on 9393 and it's working fine* :P
(and I've got lots of custom but still mandatory compiler settings... -m32, -m64, -flto, -static, -fPIC etc.)

*besides those nasty crashes every C::B build with code-completion includes^^
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

CrispiestMushroom

Ahem. Greetings all, I have an announcement to make. I can get C::B to consistently crash by opening the watch properties while a watch is being evaluated. I'm not sure if it's just me, but If anyone is interested in the steps to reproduce said phenom, or would just like to observe the action, I will be making a demo video sometime today. That is all.

ToApolytoXaos

#24
Quote from: Static on October 13, 2013, 11:42:46 AM
What about #include filenames completion? This feature seems to work sometimes and sometimes it doesn't.
Assume I want to include the file at "../dialogs/CustomDialog.h"
So, I type:
#include "../d" (note the closing quote mark)
and here comes CC suggesting "../dialogs/CustomDialog.h". I press 'enter' and get
#include "../dialogs/CustomDialog.h"" (extra quote mark)
or even
#include "../d../dialogs/CustomDialog.h" (my input wasn't overwritten)
But sometimes headers completion works perfectly.
Should this be reported as a bug?
I have a similar issue with header files. For example, if I have typed <ios> by mistake and take my cursor inside header name, and continue typing from 's', it will pop up options like iosfwd and iostream. When I choose the latter by pressing the tab key, it automatically adds an extra > character.

Is this an expected behavior, or a bug?

Cheers.

CrispiestMushroom

For all it's worth, to me, that's an annoying bug(feature?). You eventually learn to avoid it.

BlueHazzard

Quote from: CrispiestMushroom on October 21, 2013, 07:31:23 AM
Ahem. Greetings all, I have an announcement to make. I can get C::B to consistently crash by opening the watch properties while a watch is being evaluated. I'm not sure if it's just me, but If anyone is interested in the steps to reproduce said phenom, or would just like to observe the action, I will be making a demo video sometime today. That is all.

please make a separate topic, and please give us the full debug log (you have to enable it in the optiions) also a procedure to reproduce it would be nice.

greetings

Alpha

Quote from: ToApolytoXaos on October 21, 2013, 08:21:03 AM
I have a similar issue with header files. For example, if I have typed <ios> by mistake and take my cursor inside header name, and continue typing from 's', it will pop up options like iosfwd and iostream. When I choose the latter by pressing the tab key, it automatically adds an extra > character.
Should already be fixed in trunk (as of rev. 9401).

ToApolytoXaos

Quote from: Alpha on October 21, 2013, 02:16:25 PM
Should already be fixed in trunk (as of rev. 9401).
As of rev. 9414, the aforementioned problems got solved.

Thank you very much Alpha et al. for your valuable work and feedback :)

oBFusCATed

Quote from: CrispiestMushroom on October 21, 2013, 07:31:23 AM
Ahem. Greetings all, I have an announcement to make. I can get C::B to consistently crash by opening the watch properties while a watch is being evaluated. I'm not sure if it's just me, but If anyone is interested in the steps to reproduce said phenom, or would just like to observe the action, I will be making a demo video sometime today. That is all.
Can you reproduce this problem with a minimal-sample project and then provide the steps needed to do it, so I can take a look at it?
(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!]