Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Pecan on February 01, 2012, 08:13:22 pm

Title: Home key does not move to column one even if set to do so
Post by: Pecan on February 01, 2012, 08:13:22 pm
There's an editor setting "Home key always moves caret to first column.
However, it acts the same for me whether the item is ticked or not.

It always move the caret to the first char on the line, then moves it to column 1 on the second key hit.

Is there a way to make the caret alway move to column 1?

This behavior holds for 10.5 through the latest svn.

Title: Re: Home key does not move to column one even if set to do so
Post by: Jenna on February 03, 2012, 05:48:16 pm
I found the reason for this issue.
It is caused by code related to word-wrp-settings.
The code is not correct also.
I will fix/enhance it and commit as soon as possible (most likely this weekend).
Title: Re: Home key does not move to column one even if set to do so
Post by: Pecan on April 30, 2012, 08:43:33 pm
cbeditor.cpp line 1364 queries a setting over which the user has no control. It arbitrarily sets word wrap home/end key styles to true.

This overrides the user setting of "Home key always moves caret to first colume". I believe the line should be corrected to:

Code
if (mgr->ReadBool(_T("/word_wrap_style_home_end"), false))

or a setting placed in Editor setting dialog to control it.

(http://dl.dropbox.com/u/46870262/HomeKey.png)


svn build  rev 7950 (2012-04-29 13:51:10)   gcc 4.6.1 Windows/unicode - 32 bit
Title: Re: Home key does not move to column one even if set to do so
Post by: MortenMacFly on May 01, 2012, 11:18:44 am
cbeditor.cpp line 1364 queries a setting over which the user has no control.
[...]
or a setting placed in Editor setting dialog to control it.
Implemented that in SVN. Good catch, Pecan!
Title: Re: Home key does not move to column one even if set to do so
Post by: Jenna on May 01, 2012, 11:53:37 am
cbeditor.cpp line 1364 queries a setting over which the user has no control.
[...]
or a setting placed in Editor setting dialog to control it.
Implemented that in SVN. Good catch, Pecan!
I did not look at svn sources.
But if I remember correctly it's more complex, than just activate the "word_wrap_style_home_end"-stuff.
But I might be wrong.
Title: Re: Home key does not move to column one even if set to do so
Post by: MortenMacFly on May 01, 2012, 01:16:42 pm
But if I remember correctly it's more complex, than just activate the "word_wrap_style_home_end"-stuff.
Probably, but also, if we have a setting it should be configurable via UI. So it is not wrong to do it.