]> git.neil.brown.name Git - edlib.git/commitdiff
mergeview: adding merge to region needs full-lines in region
authorNeilBrown <neil@brown.name>
Fri, 18 Aug 2023 04:30:25 +0000 (14:30 +1000)
committerNeilBrown <neil@brown.name>
Fri, 18 Aug 2023 04:30:25 +0000 (14:30 +1000)
If the region isn't whole lines, make it so.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
python/lib-mergeview.py

index 71a0b7cc48f332a46740b6e0a261c6bf3d401ca2..83deb315787f8d38f1eecc53d5f9bfc6c9ef54fd 100644 (file)
@@ -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
index b8a6d59ab5fa29768f7a19cdf9f773877d521e27..d66fb35f585d80cb4d9a18e04587968eafa7aa8b 100644 (file)
@@ -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