pad

minimal etherpad alternative  https://pad.ce9e.org
git clone https://git.ce9e.org/pad.git

commit
228463c6688b234eb8636a35c7a82ce88b587f20
parent
f57722e06aacf10e450e3bc368d706a6a707b447
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-05-12 06:45
mv selection forward on insert on exact position

Diffstat

M static/context.js 4 ++--

1 files changed, 2 insertions, 2 deletions


diff --git a/static/context.js b/static/context.js

@@ -1,10 +1,10 @@
    1     1 var _apply = function(text, [pos, before, after], selection) {
    2     2 	if (selection) {
    3     3 		var d = diff(before, after, 0);
    4    -1 		if (pos + d[0] < selection[0]) {
   -1     4 		if (pos + d[0] <= selection[0]) {
    5     5 			selection[0] += after.length - before.length;
    6     6 		}
    7    -1 		if (pos + d[0] < selection[1]) {
   -1     7 		if (pos + d[0] <= selection[1]) {
    8     8 			selection[1] += after.length - before.length;
    9     9 		}
   10    10 	}