-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ale_fix_on_save creates junk files when fixing buffers not in focus (neovim) #2711
Comments
@w0rp , I just realized that I was on a pre-release of nvim 4 (from their nightlies). I tried it with nvim 3.8, and it doesn't happen there - so, it looks like it's an issue with nvim 4 It might make sense to close this issue for now, and revisit if it still comes up once a stable nvim 4 is released |
Fwiw, this also happens to me in Vim 8.1 (using rubocop for Ruby).
|
nvim 4 was released, this is still an issue with nvim 4.2 |
I've fixed this now. The issue was just writing to a junk filename instead of the buffer because |
Man, vimscript is weird :) |
Information
VIM version
Operating System:
OS X 10.14.5
Other Config
Here is my
.vimrc
:https://github.com/good-idea/dotfiles/blob/master/vim/vimrc.vim
I've toggled all of the other installed plugins, it doesn't seem to be a problem with anything else that is installed. It's also happening with both the
eslint
andprettier
fixers, on both.js
and.ts
files.What went wrong
I have Ale configured to auto-fix on file save. When I save a file that is not the currently focused buffer, a "junk file" is created with a filename like "12:p". This file contains the "fixed" contents.
The fixes are applied in Buffer A, but, after quitting vim (
:qa
) and re-opening, the original file does not show the fixes. (This is all happening in Neovim, see the notes about behavior from standard vim below)Reproducing the bug
Given a file
foo.ts
::wa
to save all filesvim
again, then opentest.tsx
When using normal vim
It's only Neovim that creates the junk files. When doing the above steps in standard vim (8.0.1283), the fix does correctly apply to the file, but the changes are not reflected in the buffer until I change focus back to it.
This seems related to #1960 and #591
:ALEInfo
From Buffer A (the file getting fixed, after running
:wa
from buffer B):From Buffer B (not the file that is getting fixed):
The text was updated successfully, but these errors were encountered: