Bios-Marcel/cordless

DM list is empty; "index out of range" when running "dm-open"

hatkidchan opened this issue · 3 comments

How have you installed cordless

  • Arch User Repository
  • scoop
  • brew
  • go get
  • git clone & go build .

What happened

I've tried to dm-open and cordless crashed. Also DM's list is empty

2020-10-26_20-20

Error output

Output:

$ ./cordless 
panic: runtime error: index out of range [0] with length 0 [recovered]
        panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/Bios-Marcel/cordless/tview.(*Application).Run.func1(0x977aaf0)
        /home/hkc/Downloads/cordless/tview/application.go:160 +0x63
panic(0x88c1480, 0x9d9fce0)
        /usr/lib/go-1.13/src/runtime/panic.go:679 +0x16b
github.com/Bios-Marcel/cordless/commands/commandimpls.(*DMOpenCmd).Execute(0x98afab8, 0x8b2cc60, 0x9626260, 0x98c8cf8, 0x0, 0x0)
        /home/hkc/Downloads/cordless/commands/commandimpls/dm.go:50 +0x7bd
github.com/Bios-Marcel/cordless/ui.(*Window).ExecuteCommand(0x948a7e0, 0x9d9fc96, 0x7)
        /home/hkc/Downloads/cordless/ui/window.go:2244 +0x136
github.com/Bios-Marcel/cordless/ui.(*CommandView).handleInput(0x9626260, 0x96279c0, 0x80540fc)
        /home/hkc/Downloads/cordless/ui/commandview.go:107 +0x24c
github.com/Bios-Marcel/cordless/ui.NewEditor.func1(0x96279c0, 0x9821f40)
        /home/hkc/Downloads/cordless/ui/editor.go:412 +0xb6d
github.com/Bios-Marcel/cordless/tview.(*Box).WrapInputHandler.func1(0x96279c0, 0x947a120, 0x96279c0)
        /home/hkc/Downloads/cordless/tview/box.go:219 +0x5c
github.com/Bios-Marcel/cordless/tview.(*Application).Run(0x977aaf0, 0x0, 0x0)
        /home/hkc/Downloads/cordless/tview/application.go:263 +0x4d5
main.main()
        /home/hkc/Downloads/cordless/main.go:74 +0x3b7

How do you reproduce this bug

  1. Open cordless
  2. <ALT>+. -> dm-open

System information

Key Value
OS Debian GNU/Linux 10 (buster)
Architecture i686
Terminal xterm, st, does not matter
Go version go version go1.13.6 linux/386

Hey, the DM list isn't empty, it's not focused. Use the focus shortcut alt+p, then you'll understand how it works. It's basically a tab-system.

I've fixed the issue, thanks for reporting.

Either way dm-open is a command for creating a DM-channel, not for focusing the view.

Either way dm-open is a command for creating a DM-channel, not for focusing the view.

Thanks, I'll keep that in mind