mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 10:02:32 +03:00
soto: mutate cursor for tab complete inserts
This changes sole.js to handle cursor behaviour for tabbing. It does so by overriding the cursor position in transpose if it's greater than it expects. This could produce errant results if other sole apps use insert behind text, but that seems like an edge case. Flagged for future with a comment.
This commit is contained in:
parent
5e42e796e7
commit
3c541ca567
File diff suppressed because one or more lines are too long
@ -57,9 +57,14 @@ export class Share {
|
||||
switch (Object.keys(dex)[0]) {
|
||||
case 'del': if (at < dex.del) { dex.del++; } break;
|
||||
case 'ins': if ((at < dex.ins.at) ||
|
||||
((at === dex.ins.at) && !(cha <= dex.ins.cha))) {
|
||||
((at === dex.ins.at) && !(cha <= dex.ins.cha))) {
|
||||
dex.ins.at++;
|
||||
} break;
|
||||
}
|
||||
else if (at >= dex.ins.at) {
|
||||
dex.ins.at = at; //NOTE possibly unpredictable behaviour
|
||||
dex.ins.at++; // for sole inserts that aren't tabs
|
||||
}
|
||||
break;
|
||||
}
|
||||
return dex;
|
||||
default: throw `%sole-edit -lost.${str(sin)}`;
|
||||
|
Loading…
Reference in New Issue
Block a user