sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

keyboard_select: end label seems exclusive — is this intentional?

Open sypianski opened this issue 1 month ago • 1 comments

Thanks for building Sioyek — when I discovered a PDF reader with vi bindings, it blew my mind. I'm so happy.

Observed behavior:

When using keyboard_select and entering two labels (e.g., aa bb), the selection includes text from aa up to but not including bb. To select „the quick brown fox", I need to type the label of the word after „fox".

Expected behavior (for vim users):

In vim's visual mode, the end of a selection is inclusive — v + motion selects up to and including the final character/word. It would feel more natural if keyboard_select worked the same way.

Additional wish:

It would be great to extend/adjust the selection with standard vim motions (like w, b, e, h, l) after the initial selection is made. Currently, if I change my mind about what to include, I have to start over from scratch.

Question:

Is this exclusive behavior intentional? If so, would you consider adding a config option for inclusive selection (e.g., keyboard_select_inclusive 1)?

sypianski avatar Dec 09 '25 15:12 sypianski

Added a keyboard_select_inclusive config option in https://github.com/ahrm/sioyek/commit/6a9a6445fa00134316dbeddfeeb27aebc244b74e. Also added select_next_char and unselect_last_char commands in https://github.com/ahrm/sioyek/commit/642670b09dc03458725a86e27452039e5a8e2dcc which should help adjust the selection.

ahrm avatar Dec 11 '25 16:12 ahrm