From: NeilBrown Date: Fri, 18 Aug 2023 04:30:25 +0000 (+1000) Subject: mergeview: adding merge to region needs full-lines in region X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=2947afff64953c6c26c280f3ed9dee859680ebfc;p=edlib.git mergeview: adding merge to region needs full-lines in region If the region isn't whole lines, make it so. Signed-off-by: NeilBrown --- 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