]> git.lizzy.rs Git - micro.git/commitdiff
Make ^X act like ^K when nothing is selected (#1092)
authorMark Weston <markweston@cock.li>
Mon, 23 Apr 2018 19:34:45 +0000 (22:34 +0300)
committerZachary Yedidia <zyedidia@gmail.com>
Mon, 23 Apr 2018 19:34:45 +0000 (15:34 -0400)
* Make ^X act like ^K when nothing is selected

^K is hard to reach with your left hand or requires to use both hands
Also with this you could remove ^K whatsoever and make room for a different command
This is how I configured nano by the way
Line duplication also becomes nearly instantaneous with a flash-quick ^X+^V+^V combo (nano doesn't have a dedicated shortcut)
Small block (5-10 lines) cuts/copies/duplicates can also be made this way

* Remove unnecessary lines

* Call CutLine the right way

cmd/micro/actions.go

index 4d52e79bfc5e1386a0e0513c23c3d372f62e0608..a291c88d53e75c9f284f863b77c4bdc0f39505d6 100644 (file)
@@ -1219,9 +1219,9 @@ func (v *View) Cut(usePlugin bool) bool {
                        return PostActionCall("Cut", v)
                }
                return true
+       } else {
+               return v.CutLine(usePlugin)
        }
-
-       return false
 }
 
 // DuplicateLine duplicates the current line or selection