mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-09 09:10:59 +00: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:
parent
04143c7a89
commit
33a1bb120f
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue