arxanas / scm-record

`scm-record` is a UI component to interactively select changes to include in a commit. It's meant to be embedded in source control tooling.
23 stars 9 forks source link

Add key bindings to jump to the next item of the same kind #45

Closed emesterhazy closed 2 months ago

emesterhazy commented 4 months ago

This PR does a few things:

  1. The keybindings for scroll up and scroll down are changed. After this PR the only bindings for this movement are ctrl-up and ctrl-down
  2. The keybindings for page up and page down (viewport) are changed. After this PR the only bindings for this movement are ctrl-page-up and ctrl-page-down.
  3. It adds new keybindings (page-up and page-down) to jump to the next item with the same type as the current item. For example, if the user is on a section header, page-down will jump to the next section header. If the user is on an editable line, page down will jump to the next editable line.

This works well, but probably needs a little bit of polish before submission. Hopefully this can unblock https://github.com/arxanas/scm-record/pull/39 which allows the user to collapse sections using the "focus outward" keybindings (i.e. the left arrow key).

emesterhazy commented 3 months ago

Thanks for the feedback! Agreed that this should probably be refactored a bit, I just wanted to get something up as a proposal.

I'll be afk for the next week but when I get back I'll push a new revision.

emesterhazy commented 3 months ago

Ok this is ready for another look. Thanks!

arxanas commented 2 months ago

I queued https://github.com/arxanas/scm-record/pull/46 for merge; you might have to rebase/update tests.

emesterhazy commented 2 months ago

Thanks for reviewing!