kod icon indicating copy to clipboard operation
kod copied to clipboard

Editor crashes when a file is saved and cursor is not in viewport

Open emigr2k1 opened this issue 5 years ago • 5 comments

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.

emigr2k1 avatar Sep 26 '18 20:09 emigr2k1

I'll get started on this..

Kacppian avatar Dec 14 '18 09:12 Kacppian

Hi, Can I work on this, wondering if someone working on it?

souvik3333 avatar Mar 18 '19 20:03 souvik3333

Hi, i dont think anyone is actively working on this @souvik333 👍

linde12 avatar Mar 18 '19 21:03 linde12

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!

souvik3333 avatar Mar 18 '19 21:03 souvik3333

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

jrswab avatar Mar 11 '20 02:03 jrswab