Преглед изворни кода

Closes #1542: Adds alternate shortcuts to rebase

main
Eric Amodio пре 3 година
родитељ
комит
a65f571a10
2 измењених фајлова са 29 додато и 0 уклоњено
  1. +1
    -0
      CHANGELOG.md
  2. +28
    -0
      src/webviews/apps/rebase/rebase.ts

+ 1
- 0
CHANGELOG.md Прегледај датотеку

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds a new section for associated pull requests (when connected to GitHub) and auto-linked issues to the _Details_ hover
- Adds the ability to filter comparisons to show only either the left-side or right-side file differences
- Adds the _Open Folder History_ command to root folders — closes [#1505](https://github.com/eamodio/vscode-gitlens/issues/1505)
- Adds alternate `j`/`k` and `shift+j`/`shift+k` keyboard shortcuts to the Interactive Rebase Editor — closes [#1538](https://github.com/eamodio/vscode-gitlens/issues/1538)
- Adds the ability to show contributor statistics, files changed as well as lines added and deleted (can take a while to compute depending on the repository) — closes [#1489](https://github.com/eamodio/vscode-gitlens/issues/1489)
- Adds a _Show Statistics_ / _Hide Statistics_ toggle to the `...` menu of the _Contributors_ view
- Adds a `gitlens.views.contributors.showStatistics` setting to specify whether to show contributor statistics in the _Contributors_ view

+ 28
- 0
src/webviews/apps/rebase/rebase.ts Прегледај датотеку

@ -174,6 +174,34 @@ class RebaseEditor extends App {
document.querySelectorAll<HTMLLIElement>(`li[data-ref="${ref}"]`)[0]?.focus();
}
}
} else if (e.key === 'j' || e.key === 'k') {
if (!e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey) {
if (me.state == null) return;
let ref = (this as HTMLLIElement).dataset.ref;
if (ref == null) return;
e.preventDefault();
let index = me.getEntryIndex(ref) + (e.key === 'k' ? 1 : -1);
if (index < 0) {
index = me.state.entries.length - 1;
} else if (index === me.state.entries.length) {
index = 0;
}
ref = me.state.entries[index].ref;
document.querySelectorAll<HTMLLIElement>(`li[data-ref="${ref}"]`)[0]?.focus();
}
} else if (e.key === 'J' || e.key === 'K') {
if (!e.metaKey && !e.ctrlKey && !e.altKey && e.shiftKey) {
const ref = (this as HTMLLIElement).dataset.ref;
if (ref) {
e.stopPropagation();
me.moveEntry(ref, e.key === 'K' ? 1 : -1, true);
}
}
} else if (!e.metaKey && !e.altKey && !e.ctrlKey) {
const action = rebaseActionsMap.get(e.key);
if (action !== undefined) {

Loading…
Откажи
Сачувај