瀏覽代碼

Fixes ascending squash indicators in rebase editor

main
Keith Daulton 2 年之前
父節點
當前提交
ffcaf31b15
共有 1 個檔案被更改,包括 20 行新增25 行删除
  1. +20
    -25
      src/webviews/apps/rebase/rebase.ts

+ 20
- 25
src/webviews/apps/rebase/rebase.ts 查看文件

@ -387,31 +387,26 @@ class RebaseEditor extends App {
let tabIndex = 0;
const $entries = document.createDocumentFragment();
function appendEntries(this: RebaseEditor) {
const entries = state.ascending ? state.entries.slice().reverse() : state.entries;
let $el: HTMLLIElement;
for (const entry of entries) {
squashToHere = false;
if (entry.action === 'squash' || entry.action === 'fixup') {
squashing = true;
} else if (squashing) {
if (entry.action !== 'drop') {
squashToHere = true;
squashing = false;
}
for (const entry of state.entries) {
squashToHere = false;
if (entry.action === 'squash' || entry.action === 'fixup') {
squashing = true;
} else if (squashing) {
if (entry.action !== 'drop') {
squashToHere = true;
squashing = false;
}
}
[$el, tabIndex] = this.createEntry(entry, state, ++tabIndex, squashToHere);
[$el, tabIndex] = this.createEntry(entry, state, ++tabIndex, squashToHere);
$entries.appendChild($el);
if (state.ascending) {
$entries.prepend($el);
} else {
$entries.append($el);
}
}
if (!state.ascending) {
$container.classList.remove('entries--ascending');
appendEntries.call(this);
}
if (state.onto != null) {
const commit = state.onto.commit;
if (commit != null) {
@ -426,16 +421,16 @@ class RebaseEditor extends App {
++tabIndex,
false,
);
$entries.appendChild($el);
if (state.ascending) {
$entries.prepend($el);
} else {
$entries.appendChild($el);
}
$container.classList.add('entries--base');
}
}
if (state.ascending) {
$container.classList.add('entries--ascending');
appendEntries.call(this);
}
$container.classList.toggle('entries--ascending', state.ascending);
const $checkbox = document.getElementById('ordering');
if ($checkbox != null) {
($checkbox as HTMLInputElement).checked = state.ascending;

Loading…
取消
儲存