wincent/ferret

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

crispgm opened this issue · 3 comments

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

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.

Ok; this should do it.

Ok; this should do it.

@wincent yep, this works perfect. Thanks.