From 2947afff64953c6c26c280f3ed9dee859680ebfc Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 18 Aug 2023 14:30:25 +1000 Subject: [PATCH] mergeview: adding merge to region needs full-lines in region If the region isn't whole lines, make it so. Signed-off-by: NeilBrown --- DOC/TODO.md | 2 +- python/lib-mergeview.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DOC/TODO.md b/DOC/TODO.md index 71a0b7cc..83deb315 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -21,7 +21,7 @@ the file. flags them? - [ ] merge command 9-A-m could work as one command. If there is an active selection, the patch is moved to that selection. -- [ ] merge command 9 must ensure selection is full lines. +- [X] merge command 9 must ensure selection is full lines. - [ ] if cursor position causes pane size to change, this doesn't propagate. - [ ] When is left_margin used? Can I use it for hanging indent? If diff --git a/python/lib-mergeview.py b/python/lib-mergeview.py index b8a6d59a..d66fb35f 100644 --- a/python/lib-mergeview.py +++ b/python/lib-mergeview.py @@ -161,6 +161,9 @@ class MergePane(edlib.Pane): else: mk = None if mk: + # selection must be full lines + focus.call("doc:EOL", -1, pt) + focus.call("doc:EOL", -1, mk) strt,end = pt.dup(),mk.dup() if strt > end: strt,end = end,strt -- 2.39.5