Conversation
The following options are useful when vim is configured to run `:Flake8` when first opening a file via the following: ```vim autocmd BufReadPost *.py call flake8#Flake8() ``` Add option for `g:flake8_always_visible`. This option will always show the quickfix window even if no errors are visible. This makes is more clear to see that there are no errors seen in the file when setting flake8 to run when first opening a file. This is to fix an issue when attempting to run `:Flake8` on a file that does not yet exist on the file system. Currently, when `:Flake8` is run it will trigger an `update` which forcefully writes out the file before running flake8 on it. This is causing an issue when setting flake8 to run when a file is opened. This forces a new file to be created when it may not be intended. A specific use-case would be when using git to view a file from another branch. This can be done via the following (setup via a git alias): ``` git show some_branch:./test.py | vim -c "file some_branch:test.py" -c "doautocmd BufRead test.py -" ``` This allows vim to open the contents of the file from stdin, thereby reading the contents of the `git show` output. If this is done, then the local copy of the file would be overwritten which could be unintended and lead to lost changes. Ideally the `update` should not be performed automatically, but that would change the behavior for existing users of this plugin, however adding thie config option will at least allow for better handling of this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #100
The following options are useful when vim is configured to run
:Flake8when first opening a file with something like the following:
Always Visible Option
g:flake8_always_visibleThis option will always show the quickfix window even if no errors
are visible. This makes is more clear to see that there are no errors
seen in the file when setting flake8 to run when first opening a file.
This is especially true if there are other plugins that are logged to
echonwhich may load or run after flake8.Auto-Update Option
g:flake8_auto_updateThis is to fix an issue when attempting to run
:Flake8on a file thatdoes not yet exist on the file system. Currently, when
:Flake8is runit will trigger an
updatewhich forcefully writes out the file beforerunning flake8 on it.
This is causing an issue when setting flake8 to run when a file is
opened. This forces a new file to be created when it may not be intended.
A specific use-case would be when using git to view a file from another
branch. This can be done via the following (setup via a git alias):
This allows vim to open the contents of the file from stdin, thereby
reading the contents of the
git showoutput. If this is done, thenthe local copy of the file would be overwritten which could be
unintended and lead to lost changes.
Ideally the
updateshould not be performed automatically, but thatwould change the behavior for existing users of this plugin, however
adding thie config option will at least allow for better handling of
this.