fix: continuations liste/checkbox/ol preservent le texte apres curseur (+after)
This commit is contained in:
@@ -1834,8 +1834,8 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
|
|||||||
} else {
|
} else {
|
||||||
// Continue checkbox
|
// Continue checkbox
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] ';
|
ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] ' + after;
|
||||||
ta.setSelectionRange(ta.value.length, ta.value.length);
|
ta.setSelectionRange(before.length + taskMatch[2].length + 6, before.length + taskMatch[2].length + 6);
|
||||||
}
|
}
|
||||||
markDirty(); autoHeight(); updateLineNumbers();
|
markDirty(); autoHeight(); updateLineNumbers();
|
||||||
return;
|
return;
|
||||||
@@ -1844,7 +1844,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
|
|||||||
// Auto-increment ordered list
|
// Auto-increment ordered list
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var num = parseInt(olMatch[2]) + 1;
|
var num = parseInt(olMatch[2]) + 1;
|
||||||
ta.value = before + '\n' + olMatch[1] + num + '. ';
|
ta.value = before + '\n' + olMatch[1] + num + '. ' + after;
|
||||||
ta.setSelectionRange(ta.value.length, ta.value.length);
|
ta.setSelectionRange(ta.value.length, ta.value.length);
|
||||||
markDirty(); autoHeight(); updateLineNumbers();
|
markDirty(); autoHeight(); updateLineNumbers();
|
||||||
return;
|
return;
|
||||||
@@ -1859,7 +1859,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
|
|||||||
} else {
|
} else {
|
||||||
// Continue bullet
|
// Continue bullet
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
ta.value = before + '\n' + ulMatch[1] + ulMatch[2] + ' ';
|
ta.value = before + '\n' + ulMatch[1] + ulMatch[2] + ' ' + after;
|
||||||
ta.setSelectionRange(ta.value.length, ta.value.length);
|
ta.setSelectionRange(ta.value.length, ta.value.length);
|
||||||
}
|
}
|
||||||
markDirty(); autoHeight(); updateLineNumbers();
|
markDirty(); autoHeight(); updateLineNumbers();
|
||||||
|
|||||||
Reference in New Issue
Block a user