]> git.lizzy.rs Git - micro.git/commit
Implement moving cursor up/down within a wrapped line
authorDmitry Maluka <dmitrymaluka@gmail.com>
Sat, 6 Mar 2021 22:43:36 +0000 (23:43 +0100)
committerDmitry Maluka <dmitrymaluka@gmail.com>
Thu, 8 Apr 2021 21:54:02 +0000 (23:54 +0200)
commit6d13710d934dc1bfd804246c255bdce3e42fdc95
treee09414c5b934c6d838087344b364436d5eefe537
parent7a3d1e6e300b6c5fec650f7a332fb7afdc3b15c5
Implement moving cursor up/down within a wrapped line

Modified behavior of CursorUp, CursorDown, CursorPageUp etc:
if softwrap is enabled, cursor moves by visual lines, not logical lines.

TODO: implement it also for Home and End keys: move cursor to the
visual start or end of a line. I haven't implemented it for now, because
I'm not sure what should be the behavior of StartOfTextToggle then
(considering that Home key is bound to StartOfTextToggle by default).

Fixes #1598
internal/action/actions.go
internal/buffer/buffer.go
internal/buffer/cursor.go
internal/display/bufwindow.go