Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert mode Ctrl+left/right navigation is kinda broken #3395

Closed
adsick opened this issue Aug 11, 2022 · 4 comments
Closed

insert mode Ctrl+left/right navigation is kinda broken #3395

adsick opened this issue Aug 11, 2022 · 4 comments
Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues

Comments

@adsick
Copy link

adsick commented Aug 11, 2022

Hi, referring my long complain about Helix not being as good as I would want it to be I am writing this issue to clear more on what is wrong with word-wise navigation in insert mode.

assume we have this text (repeated 2-3 times to demonstrate wrapping behaviors):

    println!("Hello, world!");

How it works in VS Code

    |println!("Hello, world!");
    println|!("Hello, world!");
    println!("|Hello, world!");
    println!("Hello|, world!");
    println!("Hello,| world!");
    println!("Hello, world|!");
    println!("Hello, world!");|

and backwards:

    println!("Hello, world!");|
    println!("Hello, world|!");
    println!("Hello, |world!");
    println!("|Hello, world!");
    println|!("Hello, world!");
    |println!("Hello, world!");

How it looks in Helix

    |println!("Hello, world!");
    printl|n!("Hello, world!");
    println!(|"Hello, world!");
    println!("Hell|o, world!");
    println!("Hello,| world!");
    println!("Hello, worl|d!");
    println!("Hello, world!")|;

you might think that the next step will be

    println!("Hello, world!");|

but in fact it wraps to the next line and sits like this:

    println!("Hello, world!");
    printl|n!("Hello, world!");

and when navigating backwards it will visit different stops than when navigating forward:

    println!("Hello, world!");
    printl|n!("Hello, world!");
    println!("Hello, world!");
    |println!("Hello, world!");
    println!("Hello, world|!");
    println!("Hello,| world!");
    println!("Hello|, world!");
    println!("|Hello, world!");
    println|!("Hello, world!");
    |println!("Hello, world!");

whoa, that's a lot of greetings! I really hope that you can spot what I'm talking about.

from this little experiment we can conclude a few things:

  1. Helix's word-wise navigation does not matches VSC's one (and also vim's one but you can check that for yourself)
    there are other contexts like command-line prompt when you can use Ctrl+left/right to navigate, and they're also differ, but some things (like where the stop sits, on the last char or before it) are more sensible there as well
  2. I find VS Code's variant much more sensible and convenient
  3. Helix's navigation looks better backwards than forwards
  4. Some deeper investigation needed to determine what to do with it.

I've noticed that Ctrl+left/right uses move_prev_word_end and move_next_word_start actions, and as properly mentioned in a similar issue #2729 it should be decided what we should count as a word (and whether to use or not this ambiguous term at all)

@kirawi kirawi added C-discussion Category: Discussion or questions that doesn't represent real issues A-helix-term Area: Helix term improvements labels Aug 11, 2022
@archseer
Copy link
Member

Probably has the same problem/fix as #4392

@adsick
Copy link
Author

adsick commented Oct 21, 2022

Probably has the same problem/fix as #4392

Ctrl+left/right is not working at master (nothing happens when I press it).

@adsick
Copy link
Author

adsick commented Oct 21, 2022

I can explain what's wrong here in fewer words:

let's say you have text "Helix is a nice editor."
if we're navigating it in VS Code using Ctrl+right the cursor always sits right after the end of the word like so:

Helix| is a nice editor.
Helix is| a nice editor.
Helix is a| nice editor.
Helix is a nice| editor.
Helix is a nice editor|.

(notice the last one)
but in Helix (using w in normal mode) it will be

...the same, but then...
Helix is a nice| editor.
Helix is a nice edito|r.

which is kinda sus

@archseer
Copy link
Member

I'm saying it can probably be fixed in the same way as #4392, that PR only touched delete_word_backward.

@helix-editor helix-editor locked and limited conversation to collaborators Apr 8, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10266 Apr 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues
Projects
None yet
Development

No branches or pull requests

3 participants