Bios-Marcel / cordless

The Discord terminal client you never knew you wanted.
BSD 3-Clause "New" or "Revised" License
1.65k stars 136 forks source link

Add new feature: Vim mode #368

Open steewbsd opened 3 years ago

steewbsd commented 3 years ago

This feature adds a working vim mode, some bugs are already known and will try to fix them. For example, getting inside shortcuts menu inside vim mode will render focus unusable and require an app reset (quit with q and open again).

Bios-Marcel commented 3 years ago

The method addVimKey doesn't exist, you probably forgot to commit the file. You also added multiple unused dependencies to the go.mod.

steewbsd commented 3 years ago

Cannonical imports are preventing the package from building. I need some help managing them.

Bios-Marcel commented 3 years ago

I hit alt+dot and this happened:

marcel@marcel-pc /m/d/c/cordless (0xSteeW-vim)> go run . --account=forkwatch
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x850ed9]

goroutine 1 [running]:
github.com/Bios-Marcel/cordless/tview.(*Application).Run.func1(0xc0000c17c0)
    /mnt/data/code/cordless/tview/application.go:168 +0x82
panic(0xd088c0, 0x165e470)
    /snap/go/6728/src/runtime/panic.go:969 +0x166
github.com/Bios-Marcel/cordless/shortcuts.(*Shortcut).Equals(0xc0000b7720, 0xc000c9b800, 0xc000c99e00)
    /mnt/data/code/cordless/shortcuts/shortcuts.go:440 +0x9
github.com/Bios-Marcel/cordless/ui.(*Window).handleGlobalShortcuts(0xc000130c60, 0xc000c9b800, 0xc0000c17c0)
    /mnt/data/code/cordless/ui/window.go:2145 +0xe4
github.com/Bios-Marcel/cordless/tview.(*Application).Run(0xc0000c17c0, 0x0, 0x0)
    /mnt/data/code/cordless/tview/application.go:256 +0xa4e
main.main()
    /mnt/data/code/cordless/main.go:74 +0x4cd
exit status 2
Bios-Marcel commented 3 years ago

I can't hit a single key with the app crashing actually ^^

steewbsd commented 3 years ago

Noticed it yesterday, only happening after merging your last commit. Can you try building my last commit (before merging)?

bobbbay commented 3 years ago

+1 this would make and break for myself, and many others. I can finally moderate my vim server with vim keybindings!