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

Cut -> Paste file causes go panic #77

Closed
greylurk opened this issue Apr 26, 2024 · 3 comments
Closed

Cut -> Paste file causes go panic #77

greylurk opened this issue Apr 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@greylurk
Copy link

greylurk commented Apr 26, 2024

Describe the bug
When pasting a newly created file, I get a go panic.

To Reproduce
Steps to reproduce the behavior:

  1. Start spf from a terminal window
$ spf
  1. Open a second panel (<ctrl-p>)
  2. Create a new file named "test-file.txt" in the new panel (c test-file.txt <enter>)
  3. Switch to the previous panel (<tab>)
  4. Create a new folder named destination (f destination<enter>)
  5. Scroll to new folder, and open it (j... <enter>)
  6. Move to second panel, select "test-file.txt" (<tab> j....)
  7. Cut File from second panel (<ctrl-x>)
  8. Observe that the file location is present in the "clipboard" panel
  9. Move to first panel (<tab>)
  10. Paste Item (<ctrl-v>)
  11. See error

Expected behavior
I would expect to see test-file.txt in the left-hand panel, and not in the right hand panel.

Screenshots

panic: runtime error: index out of range [0] with length 0

goroutine 504 [running]:
github.com/MHNightCat/superfile/components.pasteItem({{{0x140000aa008, 0x2, 0x2}, 0x41, 0x0, 0x5}, {{0x140003ff340, 0x9, 0xe}, 0x0}, ...})
	github.com/MHNightCat/superfile/components/global_controller.go:353 +0xbf4
github.com/MHNightCat/superfile/components.mainKey.func4()
	github.com/MHNightCat/superfile/components/key_function.go:67 +0x44
created by github.com/MHNightCat/superfile/components.mainKey in goroutine 1
	github.com/MHNightCat/superfile/components/key_function.go:66 +0x19b0

System information (please complete the following information):

  • OS: MacOS
  • Version 14.4.1
  • Superfile Version 1.1.1
  • Installed from primary homebrew repo
@yorukot
Copy link
Owner

yorukot commented Apr 27, 2024

got it, I'll test it!

@yorukot
Copy link
Owner

yorukot commented Apr 27, 2024

@greylurk This bug has been fixed at 02c2ef6
And this bug only exists on MacOs, I don't have a Mac so I didn't test it but I think this change should fix the bug.

Thanks for your report!

@yorukot
Copy link
Owner

yorukot commented May 8, 2024

i will close it.
If you have any issues, please feel free to turn it back on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants