Simplify neovim servernames for inverse search#2233
Conversation
|
What can I say. It works. It's fast on my SSD (which is a concern of mine when using files).
It worked on every step! Nothing to add P.S.
I had a good laugh when I read it :) |
|
Yes, that works nicely, even when I start Skim through Finder! A few thoughts:
|
Great, thanks!
Haha, I was hoping for some reaction, but I didn't expect it so fast :D |
Great, good to hear!
Ah, good point; I'll run the list through a unique filter, then.
Yes and no; the cache is pruned on every invocation in the sense that any server that we can't connect to will be removed from the list: vimtex/autoload/vimtex/view.vim Lines 144 to 148 in 4bd7e32
Good point!
Yes, I'm aware, and it's a good point. Although I don't know where I would currently benefit from this possibility. It's not impossible that I at some point in time go for a "neovim only" future. In this case, it makes sense to rewrite certain parts in Lua for efficiency. But as long as I do Vim + neovim support, I want to keep things on Vimscript if possible to avoid duplicate code. |
Yes, that's a good idea!
Ah, ok, that's good then (I was thinking how to avoid "pulling the rug" out under other running instances... (An alternative would be to do it on startup, but I'm not sure that'd be much better.)
Ah, I looked at
Nothing currently comes to my mind, either; I just wanted to mention it for the sake of completeness (as it was brought up).
Ah, I was only talking about the parts that are already "neovim only" (as alternative code paths), not suggesting to add more alternative or optional things for the sake of writing them in Lua. I'm sure it's possible to write a great |
I'm not so worried about "pulling the rug". It would make sense to check the servers on VimTeX startup, but unless there should be evidence that the current version fails somehow I'll leave it as I think things work well now.
Ok; I was thinking of it as a single section, except I tagged the command to where it was first described. I'll look at it again and see if I can improve further.
Agreed; and for another time. |
By "pulling the rug", I mean starting one nvim session, then starting another one for a different project, then closing the first one -- which shouldn't wipe out the server name for the second session. (Which is not the case in your implementation but in the naive ones I came up with...) So, yes, no reason to change what you have now. |
|
Thanks! I believe this is ready for merge, and unless anyone suggests otherwise I'll merge tomorrow. (I also believe it is about time for another release!) |
|
After reading the conversation, a concern might be what if the user never runs InverseSearch? P.S. Since this part is neovim only it might be your opportunity to write some lua code! :) |
That's where my concerns were going as well. Maybe it would indeed be better to prune the cache on startup (or quit)? (This might also be more parsimonious than checking all servers on every inverse search?) |
I can see your point. I investigated if moving the cache file pruning would impact startup time, and it seems to be negligable (<~ 1ms). So I've updated accordingly.
Parsimonious? ... new word for me, but after checking the dictionary; I agree. It moves the penalty to VimTeX initialization. But I think this penalty is realy not noticable in any case. |
As mentioned in the (looong) discussion in #2219, I wanted to test a simple method for managing the neovim servernames. This PR implements it. My first impression is that this works well, but I would be happy to get some feedback.
@clason @PanagiotisS