Skip to content
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

lua filetype config for lua-format formats wrong buffer after opening new file. (Contains Fix) #253

Open
silaswaxter opened this issue Jul 10, 2023 · 0 comments
Assignees

Comments

@silaswaxter
Copy link

Which configuration?
Type (custom or builtin): builtin
Filetype: lua
Formatter: luaformat

Expected behavior

  1. Open a lua file with neovim
  2. Open another a different file (:e <name-of-another-lua-file>
  3. Format it :Format

The text of <name-of-another-lua-file> should be replaced with its formatted text.

Actual behaviour
The text of <name-of-another-lua-file> is replaced with the formatted text of the first opened file.

Additional context
I'm not sure why this is happening. I suspected it had to do with the plugin appending the path of the buffer to the CLI call string, however setting the no_append=true while maintaining the buffer's absolute path as the first argument did not fix the issue.

Setting the default config to use no arguments fixed the issue.
Note: although usage of lua-format says that lua files to format must occur before options, the files can occur before or after; tested with version 1.3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants