howl-editor / howl

The Howl Editor
http://howl.io
Other
712 stars 68 forks source link

bug: off by one error in selection engine #463

Closed etosan closed 6 years ago

etosan commented 6 years ago

It seems like there is off by one error in howl's selection engine.

When doing selection using shift + arrow keys (and their combination with modifiers like ctrl) character directly under the cursor is included into selection.

When selecting line this way and deleting it, errors like following one happen. Before deletion state was: howl-selection-pre-deletion After deletion we get this: howl-selection-post-deletion

However this seems to be "wrong".

After some research I am reporting that this behavior is almost universal, instead:

This behavior is consistent with leafpad,textadept,idea editors, and windows editors I have access to, like notepad and notepad++ and in-terminal editors like nano or dex.

nilnor commented 6 years ago

Thank you for the thorough review of the behaviour in other editors. It's not so much an off by one I'd say but more of as result of the origin of the block cursor - the vi mode. In VI the character under the cursor is included in the selection. You're using block cursor without the VI mode presumably?

Looks like the include-cursor behaviour should be scoped down to the VI mode only.

etosan commented 6 years ago

Yes, I am using block cursor in normal editing mode. I am one of those weird arrow keys guys, I never learned to type properly.

Maybe I am misinterpreting this but from your reply it seems to me it can be fixed on my side, what am I supposed to configure?

nilnor commented 6 years ago

I just pushed a change limiting the "selection includes cursor" behaviour to the VI mode, so if you pull the latest things should hopefully work like you expect it to.