Page 1 of 1

make Home key go to 1st non-whitespace character on line

Posted: Tue Apr 07, 2009 12:00 am
by mikez302
I am trying to make my Home key go to the first non-whitespace character on the line that the cursor is on.

For example, if I have the following code:

Code: Select all

for i in range(5):
    print 'hi'
and my cursor is on the 2nd line, I would like the Home key to send the cursor to the "p" in "print". Is there any way to do this?

Posted: Tue Apr 07, 2009 12:58 am
by ak47wong
That's strange. By default the Home key is assigned to the command LineStart which is supposed to do just what you described. But you're correct: the Home key goes to the left margin (which is what LineLeft is supposed to do). Perhaps you've found a bug; can someone else confirm?

I'm running v5.2.0 on XP Professional. What version are you using?

Andrew

Posted: Tue Apr 07, 2009 6:13 am
by MudGuard
I'm using 5.2.0 with keystroke compatibility set to Microsoft Applications.

if the cursor is NOT on the first non-whitespace character of the line, the cursor jumps to the first non-whitespace character when I press home.

if the cursor is on the first non-whitespace character of the line, the cursor jumps to position 0.

Posted: Tue Apr 07, 2009 5:39 pm
by mikez302
After some experimentation, I discovered that if I have word wrap disabled, pressing Home once moves to the first non-whitespace character on the line, and pressing it a second time moves all the way to the left side.

With word wrap enabled, pressing Home always goes to the left side for some reason. I am trying to make the Home key go to the first non-whitespace character without having to disable word wrap, but so far I haven't figured out a way. I tried testing this with my Home key set to LineStart, and also set to LineLeft, and it doesn't seem to make any difference. Does anyone here have any advice?