dkprice / vim-easygrep

Fast and Easy Find and Replace Across Multiple Files
The Unlicense
325 stars 47 forks source link

Tab-related issue: Grep window won't open if already open in another tab #61

Open jpmv27 opened 7 years ago

jpmv27 commented 7 years ago

I have EasyGrep configured to display results in the location list.

vim allows multiple location lists to be open at one time. Because of the way IsListOpen checks whether the location list is open, if a location list is already open in one tab, EasyGrep won't open the grep window in a different tab when EasyGrepOpenWindowOnMatch=1 and there are matches

Why is it necessary to check whether the window is already open? Is there any issue with unconditionally calling copen/lopen when there are matches?

dkprice commented 7 years ago

Is there any issue with unconditionally calling copen/lopen when there are matches?

It appears that copen/lopen move the cursor to the quickfix/location list window when called. As such this would compete with the 'jump to match option' without further changes. In order to allow unconditionally opening the window yet allow jump to match we'd need to do something like:

  1. Check if matches exist
  2. Open the location list widow (lopen)
  3. ll1 to jump to the first match

If you want to take a crask at fixing this it I'd appreciate it and accept a pull request.