Skip to content

Jumping to the start of the line ignores whitespace#6

Open
andreidorin13 wants to merge 3 commits intojustcla:masterfrom
andreidorin13:master
Open

Jumping to the start of the line ignores whitespace#6
andreidorin13 wants to merge 3 commits intojustcla:masterfrom
andreidorin13:master

Conversation

@andreidorin13
Copy link

Hello,

I made this change for my own convenience and figured it may be useful to others as well. Move to start of line will now toggle between jumping to the first character and jumping to the start of the text post indentation.

@justcla
Copy link
Owner

justcla commented Sep 12, 2025

That's pretty neat.
But has the default changed?
The default in this implementation is to move the caret to the start of the text, unless that's the current position.
Does the existing implementation also put the caret at the start of the text? Or at the start of the line?

@andreidorin13
Copy link
Author

That's a fair point. I've reversed the order of operations so the first call will move to the start of the line, as it currently does and the second will move to the start of the text.

@justcla
Copy link
Owner

justcla commented Sep 16, 2025

Excellent. Thanks!

@justcla
Copy link
Owner

justcla commented Sep 16, 2025

I wonder if this might affect users who like to repeatedly hit "home" to get to the beginning of the line. Should we introduce a setting that enables or disables the toggle feature?
Personally, I'm not sure how settings are done. Probably need to call a command to toggle the setting on or off. (Toggle the toggle!)

  • Enable toggle home feature (toggle setting)
  • Go Home (toggles when enable toggle is set)

If it could be toggled on, I would have the feature go the beginning of text first - like it does in many editors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants