kod
kod copied to clipboard
Editor crashes when a file is saved and cursor is not in viewport
If you type a lot of lines until your cursor is not in the viewport and you save, then you start moving the cursor up, it will move multiple lines and then crash.
Edit: And if it doesn't crash it just starts acting weird. But it will eventually crash.
I'll get started on this..
Hi, Can I work on this, wondering if someone working on it?
Hi, i dont think anyone is actively working on this @souvik333 👍
Okay, @linde12. Can you please give me some idea on what the possible problems that can be causing it also any approach ideas? I am new here!
Some more context for this issue:
panic: runtime error: slice bounds out of range [-1:]
goroutine 1 [running]:
github.com/linde12/kod/editor.(*LineCache).ApplyUpdate(0xc00007ecc0, 0xc000455680)
/home/jaron/go/src/github.com/linde12/kod/editor/linecache.go:77 +0xc0c
github.com/linde12/kod/editor.(*Editor).handleRequests.func1()
/home/jaron/go/src/github.com/linde12/kod/editor/editor.go:100 +0xa2
github.com/linde12/kod/editor.(*Editor).Start(0xc00007c0f0)
/home/jaron/go/src/github.com/linde12/kod/editor/editor.go:176 +0x5e9
main.main()
/home/jaron/go/src/github.com/linde12/kod/kod.go:47 +0x283
Line where program panics: https://github.com/linde12/kod/blob/146fef39a44868c01ba4cb2b1a2ba18a90f1df06/editor/linecache.go#L77