-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Percent-encode paths #20
Comments
Hey I transferred this to the (n)vim plugin's repo I made sure it works for me with the same package I think the best thing to try at first is to run with a minimal config, using for example this: https://github.com/neovim/neovim/blob/master/contrib/minimal.lua To rule out whether it's a config issue or bug |
With this config it works now. So this is not an issue with vivify, will try to fix the issue now for my config :) |
Great, thanks 😄 I am kinda interested in what went wrong so feel free to share if you find out. Or if I can help with something. |
I think the issue might be that I am using file names with spaces in them with vivify. While I can open them with :Vivify and they appear in the browsers, vivify doesnt update/refresh them when typing for some reason |
Yes, I can reproduce this! Nice find. @jannis-baum did we have some fix for this that can be used in this plugin's side as well? |
Relevant: jannis-baum/Vivify#26 (However filename with for example |
Ah, yes, this plugin is not doing the percent-encoding. Have to adjust https://github.com/jannis-baum/vivify.vim/blob/main/autoload/vivify.vim#L30 and percent-encode the file path. I haven't looked into how to do that with Vimscript. |
I did a quick search, looks like Vimscript doesn't offer a native way of doing this. So from what I can tell the main options would be:
1 and 3 have wouldn't introduce any new dependency but are slow, 2 is the cleanest but does introduce the Python dependency (although AFAIK it's quite uncommon to have a version of Vim without Python). 1 has the disadvantage of having to implement this ourselves, while 3 has the disadvantage of having to call a subprocess. My preference would be 2. @tuurep what do you think? Footnotes
|
Ah, I see Sounds good to use the python oneliner, apparently it works on neovim too, But this makes me think about whether I should make a separate As a bonus, we'd get rid of the ambiguity with for example this vim/nvim difference: vivify.vim/autoload/vivify.vim Lines 3 to 4 in 822b527
As a more long term idea, do you think I should go for it? |
I checked and it seemed like Lua doesn't have anything, I only found manual/custom implementations for it. Anyways, I like that we can maintain and test this plugin together. If we separate Vim and nvim I think I'd be by myself here and also couldn't easily help you with the other one anymore haha. So I'd prefer to keep it as one ^^ |
Yeah, in that case, lets just keep it as one :D I don't mind installing Vim to test Vim-specific stuff however. But yeah, lets do it that way. |
The primary intention is to fix the case where filenames have spaces in them and this plugin doesn't encode the URL properly so it appears as if vivify can't refresh We do this whether (n)vim has python3 support or not, but with python3 support do a proper encoding with a library to handle more esoteric cases, for example curly brackets in filenames. We found that even without the library, characters such as ä, á, ñ, € already work, so it's probably a very rare case where you need any more meticulous encoding for filenames. And then even if that occurs, enabling python3 support will solve it :)
Hey @binEpilo sorry that this took longer than expected (at least I intended to do it sooner 😄 ) We've solved the spaces-in-filenames issue in #21, feel free to test as well or give feedback! The way it's done is that if you have python3 support in (n)vim, we do a proper encoding using a library But if you don't have python3 support that's fine too, in that case we just substitute spaces to But enabling python3 will handle cases like that too. Meaning:
|
Description
I just added this plugin to my plugins, installed vivify on my arch system (viv --version: vivify-server v0.6.0-1-aur) with yay and with :Vivify firefox opens my file correctly. Still there is one problem: for some reason when I now edit the file with neovim those changes arent automatically shown in the vivify firefox preview: I have to save the file with :w and then reload the page with Ctrl+R. I know that this is definitely user error on my side, but I really dont know what I need to configure here. (I also tried adding the line vim.g.vivify_instant_refresh = 1 to my init.lua)
The text was updated successfully, but these errors were encountered: