-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
formatexpr=Fixedqg
silently overrides user set formatprg
#209
Comments
This is exactly the problem I came across these few days. Instead of using Vimscript to rewrite one, I would prefer using So it would lead to the following settings in my let s:prettier_config = {
" ...
\ }
let &l:formatexpr = 'prettier' . utils#map_as_cli_options(s:prettier_config) But all stuff in I would suggest removing the c.c. neovim/neovim#13113 |
Now moved to the
Instead of adding a PR #212 |
Wow that was quick, thanks! |
👋 It seems that the change brought by PR #212 is breaking See user reports: |
Yes, this should be exactly the point here, and it's hard to believe that I even never notice that before. Sorry for the disruption, @BenoitZugmeyer, and I have fixed that in PR #216. |
I am unsure how this repo relates to Neovim official, but I just wasted hours with this horrible bug! Does the fact it is now fixed here mean it will be fixed in Neovim, or does someone need to say something to the Neovim people? Cheers! |
I originally reported this problem in Neovim since that's where the runtime file is, but I think it's just taken from
yats
or at least parts of it are.typescript.vim
sets upformatexpr
which has priority overformatprg
for thegq
mapping, as is explained in the Neovim:h
The same happens in
yats.vim
, obviously, since that's where the runtime file in Neovim comes from.I'm reporting this is kind of a bug since this behavior is quite challenging to debug especially for people who are new to Neovim. The thing is that there's nothing warning you about this behavior and at least in my experience
formatexpr
is a pretty rare sight. If you search for "how to format a file in Neovim" you'll most likely come across various plugins, but also recommendations to leverageformatprg
andgq
.Now I was wondering... what's the purpose of the
Fixedgq
function and can this maybe be handled separately? For example, users who want the behavior of that function could just wrapgq
with it, or bind it to a key as a<Plug>
mapping, or it could at least be behind a global and/or buffer local option.The text was updated successfully, but these errors were encountered: