Skip to content

Commit 33a1bb1

Browse files
committed
CutLine: return if cliboard read failed
If we ever encounter this clipboard.Read() failure, return false immediately. Otherwise, InfoBar.Error(err) will have no effect (it will be immediately overwritten by InfoBar.Message()) so we won't even know that there was an error.
1 parent 04143c7 commit 33a1bb1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/action/actions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,7 @@ func (h *BufPane) CutLine() bool {
12461246
if h.freshClip && time.Since(h.lastCutTime) < 10*time.Second {
12471247
if clip, err := clipboard.Read(clipboard.ClipboardReg); err != nil {
12481248
InfoBar.Error(err)
1249+
return false
12491250
} else {
12501251
clipboard.WriteMulti(clip+string(h.Cursor.GetSelection()), clipboard.ClipboardReg, h.Cursor.Num, h.Buf.NumCursors())
12511252
totalLines = strings.Count(clip, "\n") + nlines

0 commit comments

Comments
 (0)