Skip to content
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

arrow keys broken in vim mode #69

Closed
ryenus opened this issue Sep 2, 2020 · 4 comments
Closed

arrow keys broken in vim mode #69

ryenus opened this issue Sep 2, 2020 · 4 comments

Comments

@ryenus
Copy link
Contributor

ryenus commented Sep 2, 2020

The arrow keys probably should always work regardless the vim mode is on or off.

@Ckath
Copy link
Contributor

Ckath commented Sep 2, 2020

they're not so much 'broken' as they are swapped to with the old h j k l keybinds:

htop/ScreenManager.c

Lines 195 to 205 in f79591e

case 'h': ch = KEY_LEFT; break;
case 'j': ch = KEY_DOWN; break;
case 'k': ch = KEY_UP; break;
case 'l': ch = KEY_RIGHT; break;
case KEY_LEFT: ch = 'h'; break;
case KEY_DOWN: ch = 'j'; break;
case KEY_UP: ch = 'k'; break;
case KEY_RIGHT: ch = 'l'; break;
case 'K': ch = 'k'; break;
case 'J': ch = 'K'; break;
case 'L': ch = 'l'; break;

it isnt perfect but I also wouldnt be sure what better solution there is for this. the forks that added vim binds all handled this in a different way.

that said, we could sacrifice the old functionality of H and K. since those just toggle settings you can change anyway, they're not critical. this would mean you can have the regular arrow keys still work in vim mode, and the old functionality of hjkl would be on HJKL when vim mode is enabled.

@ryenus
Copy link
Contributor Author

ryenus commented Sep 8, 2020

this would mean you can have the regular arrow keys still work in vim mode...

@Ckath yeah, would love to have that, the other thing is that currently with vim mode on, the hjkl keys only works in the main screen, but in sub-screens like the list of file handles (L), and environment variables (e), hjkl do not work, and one still need to use the arrows keys. Possible to have the vim keys also work there?

@Ckath
Copy link
Contributor

Ckath commented Sep 8, 2020

Possible to have the vim keys also work there?

yeah as from what I can see nothing colides with hjkl movements in the panel code, so it's trivial to make hkjl work there as well. it'll be regardless of vimmode because I cant get to the settings from within the panel code. but I dont think thats a big issue here.

I'll throw together a quick fix that does the arrow keys and adds hjkl for panels like environment vars and openfiles

natoscott added a commit that referenced this issue Sep 14, 2020
There have been too many bugs reported in vim_mode, and
the proposed fixes are increasingly fragile - hence we
have decided to back it out for now.  For reference:

   #69
   #37
   #106

The whitespace changes also arrived in commit 12805f6
not sure what that was about, but backed out as well.
@natoscott
Copy link
Member

See @Ckath notes in: #37

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 a pull request may close this issue.

3 participants