eugen0329 / vim-esearch

Perform search in files easily
352 stars 12 forks source link

Search in NERDTree breaks status line #166

Closed bbrtj closed 3 years ago

bbrtj commented 3 years ago

After searching in NERDTree the statusline for every other window is broken: it no longer displays anything. Seems like global statusline is set to the following value:

statusline=%{exists('b:NERDTree')?b:NERDTree.root.path.str():''}

issuing a set statusline= command fixes it, but breaks NERDTree. Re-opening it then fixes it completely.

What is happening is that NERDTree local value is used as global one after the statusline is restored. I tried to make changes to the code so that esearch only uses setlocal, but I could not make it restore the NERDTree statusline back to what it was. Here are my modifications:

setlocaldiff.txt

eugen0329 commented 3 years ago

Thanks for the report.

If only global statusline option is set, local statuslines inherit the global value. I tried to fix it in fix-statusline-inheritance branch. Please, pull it and let me know if it resolves the problem.

bbrtj commented 3 years ago

Thanks for a quick response! Pulled the branch. Something weird happens:

NVIM v0.4.3

eugen0329 commented 3 years ago

Please, pull the last commit one more time. It looks like a vim bug, as the global option was restored, but not propagated to local &l:statusline option. Should be fixed now.

bbrtj commented 3 years ago

With the latest commit, I no longer can reproduce this bug. Seems fixed to me

eugen0329 commented 3 years ago

Cool! All the changes are in master.