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

Delete quickfix/loclist to empty will cause ferret#private#qf_delete error #83

Closed
crispgm opened this issue Apr 17, 2022 · 3 comments
Closed

Comments

@crispgm
Copy link

crispgm commented Apr 17, 2022

Reproduction steps:

  1. Create a qflist or loclist manually or by any plugins.
    e.g., call setqflist([{'text':'aaa','type':'w'}], 'a') and then copen 1
  2. Delete the item by dd
  3. It will show an error:
    image
@wincent
Copy link
Owner

wincent commented Apr 17, 2022

Thanks for the report @crispgm. I think this is fixed by cdccc5f — I say "think" because I added an if check to stop the E42 error (caused by Ferret trying to jump to the "next" item in the listing, which won't exist after deleting the last item), but I didn't see the E684 error, so not sure how to reproduce that one. I can imagine a line like this one triggering such an error:

let l:list[l:line - 1]=0

And having typed out that sentence, I realize that you could cause it to throw an error by deleting (eg. dd) in an already-empty listing. I'll add one more commit now to stop that from happening.

wincent added a commit that referenced this issue Apr 17, 2022
As noted here:

    #83 (comment)

if the listing is entirely empty and you try to delete something (eg.
with `dd`), we would cause Vim to complain thusly:

    E684: list index out of range: 0
@wincent
Copy link
Owner

wincent commented Apr 17, 2022

Ok; this should do it.

@crispgm
Copy link
Author

crispgm commented Apr 18, 2022

Ok; this should do it.

@wincent yep, this works perfect. Thanks.

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

2 participants