knap icon indicating copy to clipboard operation
knap copied to clipboard

fix inverse synctex problem Issue #15

Open ChasingZenith opened this issue 1 year ago • 7 comments

Fix #15. The change is the parameters for nvim: -es is drop and --cmd is changed to -c. Both changes are necessary. I don't know exactly which parameters do what. I just tune and get it. Please kindly check whether I will mess up other things.

ChasingZenith avatar Apr 24 '23 06:04 ChasingZenith

I don't understand the point of either change. The only difference is between -c and --cmd is whether or not other config files are sourced before the command, but the command in question requires everything it needs; I don't see why other configs would be needed. All -es does is make the command silent, and since it runs in the background, that shouldn't have any visible effect. Can someone post a reproducible set up in which these changes make a difference?

frabjous avatar Apr 26 '23 13:04 frabjous

I don't know how theses changes make it work either. What I can confirm is that both changes is necessary for me. After making it work, I tried to read the neovim doc, but remained confused. 2 people have given me 👍🏻️ and 🚀️ for my solution in #15 so I think it also works for them and I make this pull request. Maybe we can ask other people there whether this also work for them.

(BTW, respect for making such a great latex tool.)

ChasingZenith avatar Apr 26 '23 15:04 ChasingZenith

Also vimtex sioyek configuration use -c only. Maybe we can ask lervag for help.

ChasingZenith avatar Apr 26 '23 15:04 ChasingZenith

I'm not comfortable merging a pull request when I don't understand the problem the request is supposed to solve, cannot replicate it myself, and the changes seem to actually make things worse.

Why load an entire configuration file before enacting the script's function when there is no need to? That'll just slow it down. Why not silence output that cannot be seen anyway? Again, leaving that output unsilenced is just likely to slow things down.

I made the choices I did for a reason, and I can't figure out why those choices are bad, so I just don't feel comfortable making changes.

Sorry -- I know you mean well -- but I don't see why vimtex doing something a certain way is of any relevance at all.

frabjous avatar Jun 05 '23 14:06 frabjous

Nice to see your response. I doubt the problem may relate to whether the lua module knaphelper could be found. Now I try keep -es and --cmd and add one more --cmd to add knap in to rtp. This approach also works for me

        textopdfviewerlaunch = "sioyek %outputfile% --inverse-search 'nvim --headless -es --cmd \"set rtp+=~/.cache/vimfiles/repos/github.com/frabjous/knap/\" --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' ",

I think the problem relates to how I the package managers load plugins. I am using SpaceVim, which uses dein.vim as the plugin manager.

ChasingZenith avatar Jun 06 '23 05:06 ChasingZenith

Nice to see your response. I doubt the problem may relate to whether the lua module knaphelper could be found. Now I try keep -es and --cmd and add one more --cmd to add knap in to rtp. This approach also works for me

        textopdfviewerlaunch = "sioyek %outputfile% --inverse-search 'nvim --headless -es --cmd \"set rtp+=~/.cache/vimfiles/repos/github.com/frabjous/knap/\" --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' ",

I think the problem relates to how I the package managers load plugins. I am using SpaceVim, which use dein.vim as plugin manager.

ChasingZenith avatar Jun 06 '23 05:06 ChasingZenith

Sorry it's taken me awhile to look at this. As a matter of principle, I'd strongly prefer not to hard code names of external programs in the main code like xdotool or busctl. You can create new settings for these things and allow the user to change them. I'm on wayland (hyprland not on GNOME) and can't use xdotool. The English in the suggested README change is poor. In general, I'm not very enthusiastic about merging this in this form. I can't really test it.

However, I'm not really using this plugin at all any more. If you wanted to take over the project, I'd consider handing it over. (You can change the name!)

frabjous avatar Feb 14 '24 01:02 frabjous