mirror of
https://github.com/Hopiu/micro.git
synced 2026-05-23 21:55:50 +00:00
Removed duplicate paste code for OS-level paste
This commit is contained in:
parent
199c295f1f
commit
55add69fa0
1 changed files with 1 additions and 12 deletions
|
|
@ -481,18 +481,7 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
leadingWS := GetLeadingWhitespace(v.Buf.Line(v.Cursor.Y))
|
v.paste(e.Text())
|
||||||
|
|
||||||
if v.Cursor.HasSelection() {
|
|
||||||
v.Cursor.DeleteSelection()
|
|
||||||
v.Cursor.ResetSelection()
|
|
||||||
}
|
|
||||||
clip := e.Text()
|
|
||||||
clip = strings.Replace(clip, "\n", "\n"+leadingWS, -1)
|
|
||||||
v.Buf.Insert(v.Cursor.Loc, clip)
|
|
||||||
v.Cursor.Loc = v.Cursor.Loc.Move(Count(clip), v.Buf)
|
|
||||||
v.freshClip = false
|
|
||||||
messenger.Message("Pasted clipboard")
|
|
||||||
|
|
||||||
PostActionCall("Paste", v)
|
PostActionCall("Paste", v)
|
||||||
case *tcell.EventMouse:
|
case *tcell.EventMouse:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue