- commit
- 409837fcf210a72cdb516d961d0f4b019bf68716
- parent
- b631036740165f8dc8c3a9eb5ead785dfb93abf5
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2026-10-31 13:53
do not move selection when typing at the exact position the main benefit is that the cursor end up at the start instead of the end on initial load
Diffstat
| M | python/pad/diff.py | 4 | ++-- |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/pad/diff.py b/python/pad/diff.py
@@ -10,9 +10,9 @@ def _apply(text, change, selection=None): 10 10 11 11 if selection: 12 12 d = diff(before, after, 0)13 -1 if pos + d[0] <= selection[0]:-1 13 if pos + d[0] < selection[0]: 14 14 selection[0] += len(after) - len(before)15 -1 if pos + d[0] <= selection[1]:-1 15 if pos + d[0] < selection[1]: 16 16 selection[1] += len(after) - len(before) 17 17 18 18 return text[0:pos] + after + text[pos + len(before):]