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

Fix error when editing path for shebang #572

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Conversation

yous
Copy link
Contributor

@yous yous commented Sep 30, 2020

I was making a new script, and during writing the path for shebang, saw this error:

Error detected while processing CursorHold Autocommands for "<buffer=1>"..function polyglot#shebang#Detect[1]..<SNR>78_Filetype:
line   15:
E684: list index out of range: -1

It's because split(l:path, "/") returns an empty list, so this PR fixes it.

This can be reproduced by making a new file and insert the content of the following:

#!/

Then go to NORMAL mode or insert a space to see the error message.

@sheerun
Copy link
Owner

sheerun commented Sep 30, 2020

huh, thank you

@sheerun sheerun merged commit 3ad297d into sheerun:master Sep 30, 2020
@yous yous deleted the fix-shebang branch September 30, 2020 09:21
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

Successfully merging this pull request may close these issues.

2 participants