Code::Blocks Forums

User forums => Help => Topic started by: roody2dgame on July 25, 2023, 09:05:22 pm

Title: Incremental Search text box selects itself
Post by: roody2dgame on July 25, 2023, 09:05:22 pm
Code::Blocks Release 20.03  rev 11997 Jul 12 2022, 21:44:09 - wx3.2.0 - gcc 12.1.0 (Linux, unicode) - 64 bit

I press CTRL+I or click in the incremental search test box
I press a key, lets say 'h'
the 'h' instantly gets selected for some reason?
since the 'h' is selected, my next keystroke, 'e', replaces the selected text
only 'e' is in the incremental search text box
the 'e' instantly gets selected for some reason?

so casually typing "heebeegeebeez", every key will replace the last letter, leaving only 'z' in the text box
i can get around this by manually deselecting the text every keystroke, so
"h (right arrow) e (right arrow) e (right arrow) b (right arrow) e (right arrow) e (right arrow) g (right arrow) e (right arrow) e (right arrow) b (right arrow) e (right arrow) e (right arrow) z"
but this is tedious to do

How do I stop this behavior? Is it a bug?
I've tried toggling INSERT and all the Incremental Search options (cleared box, used regex to search for something that doesn't match itself, highlight on/off), nothing helps.
Title: Re: Incremental Search text box selects itself
Post by: roody2dgame on July 25, 2023, 09:10:00 pm
System Context:
OS: Arch Linux x86_64
WM: KWin
DE: KDE
The only settings I've changed for code::blocks is change some colors and remove some of the toolbars I don't use, then save the removal of toolbars as the "Code::blocks default" perspective
The textbox for thread-search works perfectly normally
I have a pretty fast setting for holding down a key to repeat it (200ms delay, 30ms repeat)
Title: Re: Incremental Search text box selects itself
Post by: pirx67 on August 19, 2023, 12:23:51 am
Hi,

I can confirm this behavior. My system is a Debian 12 bookworm with this Code::Blocks revision:

Name                   : Code::Blocks
Version                : svn-r13338
SDK Version            : 2.24.0
Scintilla Version      : 3.7.5
Author                 : The Code::Blocks Team
E-mail                 : info@codeblocks.org
Website                : https://www.codeblocks.org
OS                     : Linux 6.1.0-11-rt-amd64 x86_64
Scaling factor         : 1.000000
Detected scaling factor: 1.000000
Display PPI            : 96x96
Display count          : 1
Display 0              : XY=[0,0]; Size=[1920,1200]; Primary

wxWidgets Library (wxGTK port)
Version 3.2.2 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.36.

Title: Re: Incremental Search text box selects itself
Post by: sedenion on April 27, 2025, 07:56:59 pm
This bug still here in 25.03 under linux (debian 12 version).
Title: Re: Incremental Search text box selects itself
Post by: sedenion on January 10, 2026, 11:35:49 am
Hi,

This issue still here in Debian 13 (LMDE 7) Is it an Incremental Search plugin problem or related to WxSmith ? It seem pretty odd that this problem still not addressed since 2022...
Title: Re: Incremental Search text box selects itself
Post by: Miguel Gimenez on January 10, 2026, 01:45:27 pm
If you can compile C::B you can try changing this code (in IncrementalSearch.cpp)

Code
#ifdef __WXMAC__
    // on macOS only set focus if we really lost it, to avoid native select all,
    // or it will reset the text selection
    if (!m_pTextCtrl->HasFocus())
        m_pTextCtrl->SetFocus();
#else
    m_pTextCtrl->SetFocus();
#endif

to just

Code
    // only set focus if we really lost it, to avoid native select all
    // or it will reset the text selection
    if (!m_pTextCtrl->HasFocus())
        m_pTextCtrl->SetFocus();
Title: Re: Incremental Search text box selects itself
Post by: Miguel Gimenez on January 10, 2026, 02:16:22 pm
Fixed on Ubuntu, should work also on Debian (commit 13764 (https://sourceforge.net/p/codeblocks/code/13764/)).
Title: Re: Incremental Search text box selects itself
Post by: sedenion on February 16, 2026, 11:50:59 pm
If you can compile C::B you can try changing this code (in IncrementalSearch.cpp)

I would like to try to compile it from source, but I am a bit lost in your sourceforge page (and not familiar with SVN). Where could I get up to date source archive ready for compile ?
Title: Re: Incremental Search text box selects itself
Post by: ollydbg on February 17, 2026, 03:21:10 am
If you can compile C::B you can try changing this code (in IncrementalSearch.cpp)

I would like to try to compile it from source, but I am a bit lost in your sourceforge page (and not familiar with SVN). Where could I get up to date source archive ready for compile ?

If you are not familiar with SVN, you can try git.
There are some git mirrors, see here:
https://github.com/arnholm/codeblocks_sfmirror

Title: Re: Incremental Search text box selects itself
Post by: sedenion on February 17, 2026, 09:54:20 am
If you are not familiar with SVN, you can try git.
There are some git mirrors, see here:
https://github.com/arnholm/codeblocks_sfmirror

Thanks for your help and reply. Anyway I managed to get the nightly builds package from xaviou debian repositories, and I can confirm incremental search now behave properly.

Now, this would be cool that Debian mainteners updates their official packages...