Kaynağa Gözat

Fixes ascending squash indicators in rebase editor

main
Keith Daulton 2 yıl önce
ebeveyn
işleme
ffcaf31b15
1 değiştirilmiş dosya ile 20 ekleme ve 25 silme
  1. +20
    -25
      src/webviews/apps/rebase/rebase.ts

+ 20
- 25
src/webviews/apps/rebase/rebase.ts Dosyayı Görüntüle

@ -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;

Yükleniyor…
İptal
Kaydet