Skip to content

Comments

ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection#64

Closed
aerth wants to merge 3 commits intomicro-editor:masterfrom
aerth:cut-lines
Closed

ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection#64
aerth wants to merge 3 commits intomicro-editor:masterfrom
aerth:cut-lines

Conversation

@aerth
Copy link
Contributor

@aerth aerth commented Apr 23, 2016

ctrl+k cut multiple lines into clipboard

@aerth aerth changed the title ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection Fix #63 ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection Apr 23, 2016
@aerth aerth changed the title Fix #63 ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection ctrl+k cuts line into clipboard, ctrl+c clears clipboard if no selection Apr 23, 2016
@aerth aerth mentioned this pull request Apr 23, 2016
@aerth aerth closed this Apr 23, 2016
@aerth
Copy link
Contributor Author

aerth commented Apr 23, 2016

This causes a panic when deleting nonexistent lines.

@zyedidia
Copy link
Member

I think that was actually a bug with SelectLine, see 0fac02c.

@aerth aerth reopened this Apr 23, 2016
@aerth
Copy link
Contributor Author

aerth commented Apr 23, 2016

0fac02c didn't fix it. I build, open it up, and press ctrl+k and it dumps this:

Micro encountered an error: Operation not permitted on empty rope
*errors.errorString Operation not permitted on empty rope
/usr/local/go/src/runtime/panic.go:443 (0x45e5a9)
    gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/home/test/goforc/src/github.com/vinzmay/go-rope/rope.go:27 (0x48f99e)
    (*Rope).panicIfNil: panic(fmt.Sprintf("Operation not permitted on empty rope"))
/home/test/goforc/src/github.com/vinzmay/go-rope/rope.go:165 (0x4908ec)
    (*Rope).Split: rope.panicIfNil()
/home/test/goforc/src/github.com/vinzmay/go-rope/rope.go:190 (0x490ed2)
    (*Rope).Delete: _, r4 := r2.Split(length)
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/buffer.go:124 (0x40180b)
    (*Buffer).Remove: b.r = b.r.Delete(start, end-start)
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/eventhandler.go:33 (0x4072c1)
    ExecuteTextEvent: t.text = t.buf.Remove(t.start, t.end)
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/eventhandler.go:98 (0x40781f)
    (*EventHandler).Execute: ExecuteTextEvent(t)
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/eventhandler.go:83 (0x40763a)
    (*EventHandler).Remove: eh.Execute(e)
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/cursor.go:95 (0x405749)
    (*Cursor).DeleteSelection: c.v.eh.Remove(c.curSelection[0], c.curSelection[1])
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/view.go:553 (0x4299c9)
    (*View).HandleEvent: v.cursor.DeleteSelection()
/home/test/goforc/src/github.com/aerth/micro/cmd/micro/micro.go:256 (0x40ea25)
    main: view.HandleEvent(event)
/usr/local/go/src/runtime/proc.go:188 (0x4600c0)
    main: main_main()
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x48e821)
    goexit: BYTE    $0x90   // NOP

@aerth
Copy link
Contributor Author

aerth commented Apr 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants