gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Add word motions to text input

Open Rodrigodd opened this issue 3 years ago • 0 comments

It changes the following:

  • Add common word motions to the text input component, more precisely Ctrl-Left, Ctrl-Right, Ctrl-Backspace/Ctrl-W and Ctrl-Delete. A word is being defined as a continuous sequence of alphanumeric characters.

I followed the checklist:

  • [x] I added unittests
  • [x] I ran make check without errors
  • [x] I tested the overall application
  • [ ] I added an appropriate item to the changelog

Rodrigodd avatar Jul 13 '22 23:07 Rodrigodd

this does not work on macos

extrawurst avatar Aug 17 '22 16:08 extrawurst

I have tested this on Windows and Linux (WSL). Unfortunately I don't have access to a macOS to test this. Can you tell me how exactly this is not working? The only platform dependent code I think might not be working is the ctrl modifier check, but this seems to be equivalent to the others in the codebase.

Rodrigodd avatar Aug 17 '22 18:08 Rodrigodd

can you please record how this should look like?

extrawurst avatar Sep 02 '22 07:09 extrawurst

@extrawurst I recorded it inside visual studio code for the keystrokes overlay. I notice that Ctrl-Delete don't work in vscode integrated terminal, but it does work in Windows Terminal.

https://user-images.githubusercontent.com/51273772/188209077-e6a13fdf-4f86-493b-a7eb-7cef66daa2d6.mp4

Rodrigodd avatar Sep 02 '22 17:09 Rodrigodd

it breaks on unicode text with multibyte content, try some emojis. it will run into some endless loop.

edit: try this commit message ❤️🤯 adasd asdasd and try jumping words from left to right. please write a unittest for it

extrawurst avatar Sep 02 '22 17:09 extrawurst

@extrawurst the infinite loop is fixed.

Rodrigodd avatar Sep 02 '22 18:09 Rodrigodd

also the changelog entry is still missing

extrawurst avatar Sep 03 '22 11:09 extrawurst

could you record a nice gif we can put in the changelog of the new functionality?

I don't have a easy recording workflow setup.

Rodrigodd avatar Sep 04 '22 18:09 Rodrigodd

Thanks for implementing this!

extrawurst avatar Sep 08 '22 06:09 extrawurst