mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-30 16:39:33 +01:00
fix(web): send a typed combining mark as a plain append (#830)
Both editBetween() functions return a pure append as-is before the grapheme split, so a mark typed onto the last letter is not a DEL plus the retyped cluster (zsh would double the base letter). Drop a redundant setFlushed() in the Tab-completion fallback; detectBufferText() already stores it.
This commit is contained in:
1 parent
e4ac7728ba
commit
414dd51eb2
5 files changed
+44
-1
No files matched your search
@@ -34,6 +34,10 @@
|
||||
}
|
||||
|
||||
function editBetween(previous, next) {
|
||||
// A pure append (including a combining mark or tone typed onto the last letter)
|
||||
// is sent as-is, as on master: re-typing the extended cluster would make a
|
||||
// code-point line editor (zsh) double the base letter.
|
||||
if (next.startsWith(previous)) return { deleted: 0, inserted: next.slice(previous.length) };
|
||||
const a = graphemes(previous);
|
||||
const b = graphemes(next);
|
||||
let prefix = 0;
|
||||
|
||||
@@ -84,6 +84,10 @@
|
||||
* red heart, a skin-tone emoji, a flag or a ZWJ family is one DEL, as it is one backspace.
|
||||
*/
|
||||
function editBetween(previous, next) {
|
||||
// A pure append (including a combining mark or tone typed onto the last letter)
|
||||
// is sent as-is: re-typing the extended cluster would make a code-point line
|
||||
// editor (zsh) double the base letter.
|
||||
if (next.startsWith(previous)) return { deleted: 0, inserted: next.slice(previous.length) };
|
||||
const a = graphemes(previous);
|
||||
const b = graphemes(next);
|
||||
let prefix = 0;
|
||||
|
||||
@@ -1101,7 +1101,6 @@ Object.assign(CodemanApp.prototype, {
|
||||
this._tabCompletionSessionId = null;
|
||||
this._tabCompletionRetries = 0;
|
||||
this._tabCompletionBaseText = null;
|
||||
ov.setFlushed(detected.length, detected);
|
||||
ov.rerender();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user