- commit
- 02f23f4a18ede2130d2b0df3d8af6ec838df2a56
- parent
- f62572845d68e85faafcae2c68406389b41fcdc0
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-11-17 13:55
protocol: more robust reset behavior see https://git.ce9e.org/pad/commit/17d179de2ad39601f5797c1e9b408c357c737e20.html
Diffstat
M | python/pad/diff.py | 4 | ++++ |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/pad/diff.py b/python/pad/diff.py
@@ -21,6 +21,10 @@ def _apply(text, change, selection=None): 21 21 def apply(text, change, selection=None): 22 22 start, end, before, after = change 23 23 -1 24 # special handling for resets -1 25 if start == 0 and end == 0 and before == '' and text != '': -1 26 start, end, before, after = diff(text, after, 3) -1 27 24 28 # try exact match 25 29 if text[start:].startswith(before): 26 30 return _apply(text, [start, before, after], selection)