]> git.lizzy.rs Git - micro.git/commitdiff
Fix cursor position change after CopyLine command (#2353)
authorLincoln Júnior <99145408+lincolnjpg@users.noreply.github.com>
Sun, 24 Jul 2022 21:09:14 +0000 (18:09 -0300)
committerGitHub <noreply@github.com>
Sun, 24 Jul 2022 21:09:14 +0000 (14:09 -0700)
internal/action/actions.go

index 7900a917f6d23364dc0fec3dd93f14e3a60c2c4a..345f47c6f950119c3660e6f81b417998003d79c7 100644 (file)
@@ -1047,12 +1047,14 @@ func (h *BufPane) CopyLine() bool {
        if h.Cursor.HasSelection() {
                return false
        }
+       origLoc := h.Cursor.Loc
        h.Cursor.SelectLine()
        h.Cursor.CopySelection(clipboard.ClipboardReg)
        h.freshClip = true
        InfoBar.Message("Copied line")
 
        h.Cursor.Deselect(true)
+       h.Cursor.Loc = origLoc
        h.Relocate()
        return true
 }