Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index out of range when returning to homedir #19

Closed
sarimak opened this issue Dec 10, 2017 · 4 comments
Closed

Index out of range when returning to homedir #19

sarimak opened this issue Dec 10, 2017 · 4 comments

Comments

@sarimak
Copy link

sarimak commented Dec 10, 2017

Micro 1.3.5-17 compiled today from Github + filemanager-plugin compiled today from Github. Tested on Ubuntu. golang-1.8 installed today via apt.

Repro steps:
cd ~/download
micro
Ctrl+E
tree
<navigate using PageUp and Up arrow to .. and press enter => cwd == $HOME>
<navigate using PageUp and Up arrow to .. and press enter => cwd == /home>
<navigate using PageUp and Up arrow to $USER.. and press enter>

Expected: cwd should be $HOME
Actual: micro crashes with unhandled exception:

Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/usr/lib/go-1.8/src/runtime/panic.go:489 (0x42a87f)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/go-1.8/src/runtime/panic.go:28 (0x4294fe)
panicindex: panic(indexError)
/home/sarim/go/src/github.com/zyedidia/micro/cmd/micro/cellview.go:83 (0x86a19e)
(*CellView).Draw: if start > 0 && buf.lines[start-1].rehighlight {
/home/sarim/go/src/github.com/zyedidia/micro/cmd/micro/view.go:774 (0x8cdf52)
(*View).DisplayView: v.cellview.Draw(v.Buf, top, height, left, width-v.lineNumOffset)
/home/sarim/go/src/github.com/zyedidia/micro/cmd/micro/view.go:1028 (0x8d061b)
(*View).Display: v.DisplayView()
/home/sarim/go/src/github.com/zyedidia/micro/cmd/micro/micro.go:224 (0x892001)
RedrawAll: v.Display()
/home/sarim/go/src/github.com/zyedidia/micro/cmd/micro/micro.go:463 (0x8939ac)
main: RedrawAll()
/usr/lib/go-1.8/src/runtime/proc.go:185 (0x42c66a)
main: fn()
/usr/lib/go-1.8/src/runtime/asm_amd64.s:2197 (0x4576d1)
goexit: BYTE $0x90 // NOP

@sarimak
Copy link
Author

sarimak commented Dec 10, 2017

While the issue is easy to reproduce on Linux, I am not able to reproduce the issue on Android/Termux. The issue can be reproduced by using up arrow itself (no mix with page up) and even if I carefully press the up arrow the exact number of times to reach the .. line.

@tommyshem
Copy link

Could you please give more info for testing.
Which version of ubuntu are you using and which terminal?
Pageup is not surported yet. Only up and down arrow keys.
Can you recreate the error with just up and down arrow keys?

@sum01
Copy link
Collaborator

sum01 commented Dec 11, 2017

Does the folder contain a lot of things? I ran into the same issue when trying to open /usr/lib.

A fix for that is adding the folder contents line-by-line, instead of all at once like the plugin currently does.

@sum01 sum01 mentioned this issue Dec 28, 2017
Merged
@sarimak
Copy link
Author

sarimak commented Jan 10, 2018

Fix confirmed, many thanks!
Micro version: 1.3.5-17 (e443ade)
Updated the filemanager plugin via plugin update filemanager

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

No branches or pull requests

3 participants