From c1bbd7b041892ba0383e49043db74fbde9d4949b Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Sun, 9 Jun 2024 12:25:25 +0200 Subject: [PATCH] CutLine: cosmetic refactoring --- internal/action/actions.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/action/actions.go b/internal/action/actions.go index 76e66f4d..805bf739 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -1220,17 +1220,17 @@ func (h *BufPane) CutLine() bool { // Cut the selection to the system clipboard func (h *BufPane) Cut() bool { - if h.Cursor.HasSelection() { - h.Cursor.CopySelection(clipboard.ClipboardReg) - h.Cursor.DeleteSelection() - h.Cursor.ResetSelection() - h.freshClip = true - InfoBar.Message("Cut selection") - - h.Relocate() - return true + if !h.Cursor.HasSelection() { + return false } - return false + h.Cursor.CopySelection(clipboard.ClipboardReg) + h.Cursor.DeleteSelection() + h.Cursor.ResetSelection() + h.freshClip = true + InfoBar.Message("Cut selection") + + h.Relocate() + return true } // DuplicateLine duplicates the current line or selection