kakoune icon indicating copy to clipboard operation
kakoune copied to clipboard

Enabling mouse support, setting high `scrolloff` values and clicking off a line moves the cursor to a different line, causing lines to be selected.

Open nothingnesses opened this issue 5 years ago • 3 comments

Steps

  • Add set-option global scrolloff 999,999 and set-option -add global ui_options ncurses_enable_mouse=yes to "kakrc".
  • Open a text file that has at least two screens worth of lines so we can test the mouse scroll behaviour.
  • Move the cursor to about the middle of the file.
  • Click on any line aside from the middle line.
  • Click off the same line as was clicked on.

Outcome

The cursor has jumped to a different line, selecting a bunch of lines in the interim of clicking on and off (when clicking on the middle line, clicking off works as expected and it stays on the same line).

Expected

The cursor stays on the same line.

nothingnesses avatar Jan 18 '21 07:01 nothingnesses

Been looking for a solution to this as well. In the meantime I keep scrolloff to a smaller value (~3) so that I can still click most of the screen.

samwega avatar Jan 26 '21 22:01 samwega

Has anybody figured out a way to map the mouse left to select and then disabling the selection? Any incarnation I try doesn't seem to work, it doesn't seem possible to map to mouse keys at all?

Ideally something like this would work (I have escape mapped to remove all selections):

map global normal <esc> ';,'                               -docstring 'remove selections except main'
map global normal <mouse:left> '<mouse:left><esc>' -docstring 'Only leave a single character selected with mouse click'

skarekrow avatar Oct 17 '24 22:10 skarekrow

I found this bug with a small scrolloff value. I had:

set global scrolloff 3,0

Then clicking either on the top or bottom line of the window would scroll the buffer slightly, moves the cursor and selects some text.

As Kakoune no longer moves the cursor when scrolling (see issue #2844, commit 1e38045), I am not sure what the scrolloff variable is supposed to be for any more.

GavinSmith0123 avatar Dec 29 '24 21:12 GavinSmith0123