yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

FVim --setup registers wrong pattern in file association #253

Closed monologconnor closed 1 year ago

monologconnor commented 1 year ago

Hi, I just installed fvim today and attempted to register file association under Windows 11 via Fvim.exe --setup command.

After running the command I found the broken fvim command line shown in Open With while opening the .txt file, which is shown as D:\Sync\Program\Fvim\FVim.exe" ""%1", which is actually not usable since nothing showed up after select on that.

图片

I think that's the issue from the register table and I found that all command registry item for fvim is written incomplete with a missing quote mark ", for example, under the registry path HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FVim.txt\shell\edit\command

图片

I tried to manually edit this item by finishing the quote pair: "D:\Sync\Program\Fvim\FVim.exe" ""%1" and the Fvim now could be invoked correctly.

I checked through the latest source code of Fvim and I found the problem might be caused by this line: https://github.com/yatli/fvim/blob/2d9ea840b3ae7e1d9db17b73c7ad42c28bccd22e/shell.fs#LL84C1-L84C53

command.SetValue("", $"{exe}\" \"%%1\"") should be changed to command.SetValue("", $"\"{exe}\" \"%%1\"").

I'm new in making PR and never tried building this project, I'm afraid of making something wrong in source code, can someone fix this issue in source code?

Thanks!

monologconnor commented 1 year ago

just found this issue is related to https://github.com/yatli/fvim/pull/231

yatli commented 1 year ago

Hey @monologconnor,

Thanks for spotting and reporting this! I almost always need multiple shots for this kind of off-by-one mistakes :p

I think it's good now: image

monologconnor commented 1 year ago

Hey @monologconnor,

Thanks for spotting and reporting this! I almost always need multiple shots for this kind of off-by-one mistakes :p

I think it's good now: image

Great! Thanks!