mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-02 10:50:25 +09:00
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.
This commit is contained in:
@@ -1246,6 +1246,7 @@ func (h *BufPane) CutLine() bool {
|
||||
if h.freshClip && time.Since(h.lastCutTime) < 10*time.Second {
|
||||
if clip, err := clipboard.Read(clipboard.ClipboardReg); err != nil {
|
||||
InfoBar.Error(err)
|
||||
return false
|
||||
} else {
|
||||
clipboard.WriteMulti(clip+string(h.Cursor.GetSelection()), clipboard.ClipboardReg, h.Cursor.Num, h.Buf.NumCursors())
|
||||
totalLines = strings.Count(clip, "\n") + nlines
|
||||
|
||||
Reference in New Issue
Block a user