Skip to content

Add "preserveScroll" option to select.vertically #385

Description

@forivall

When using ctrl+u/ctrl+d in helix, unlike kakoune, the scroll position is preserved, such that, if your cursor is at the top of your window, after using ctrl+u, your cursor will still be at the top of your viewport after scrolling up. (in kakoune, your cursor will be at the bottom of the viewport) (helix does have the same behaviour as kakoune after using pgup/pgdn)

My current workaround is to use the following bindings:

  { "key": "ctrl+u",   "command": "dance.run", "args": {"commands": [["dance.select.vertically", { "direction":  -1, "by": "halfPage", "shift": "jump" }], ["dance.view.line", { "at": "center" }]]}, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },
  { "key": "ctrl+d",   "command": "dance.run", "args": {"commands": [["dance.select.vertically", { "direction":  1, "by": "halfPage", "shift": "jump" }], ["dance.view.line", { "at": "center" }]]}, "when": "editorTextFocus && dance.mode == 'normal' || editorTextFocus && dance.mode == 'select'" },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelixImplementing Helix behaviour.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions