瀏覽代碼

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…
取消
儲存