mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-18 06:50:25 +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
|
||||
}
|
||||
|
||||
leadingWS := GetLeadingWhitespace(v.Buf.Line(v.Cursor.Y))
|
||||
|
||||
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")
|
||||
v.paste(e.Text())
|
||||
|
||||
PostActionCall("Paste", v)
|
||||
case *tcell.EventMouse:
|
||||
|
|
|
|||
Loading…
Reference in a new issue