This repository has been archived by the owner on Dec 3, 2024. It is now read-only.
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.
This adds the ability to switch between "update modes" on a per-buffer basis. Update profiles determine which hooks (autocommands, key mappings) will trigger calls to
JSLint()
,JSLintClear()
, etc. I just added one other to the default "thorough" update mode. There's more info in new comments and in the commit message.My main motivation for doing this was to avoid issues with quickfix not working. I determined that removing the
BufEnter
autocommand prevented this issue from occurring, but I couldn't figure out how to remove that without totally changing the way the plugin works. I ended up setting up a second update profile that only updates on BufWrite events.Issue specifics
JSLintUpdate
directly — I would have problems using the quickfix list.:cc
, or by pressing<Enter>
on the entry in the qf window, or by any other means, I would end up at the wrong line number. It seemed to be using the wrong quickfix entry: I would end up at a line that was referenced by one of the other quickfix entries.:JSLintToggle
), the stabilized quickfix list would continue to exhibit this behaviour.getqflist()
was as expected, and that it matched up withb:jslint_qf
or whatever it's called.:JSLintToggle
). It would happen again if I re-enabled jslint.vim.au BufEnter ...
line in the source code and then restarting vim would result in this issue not occurring. My guess is that using the quickfix list triggers a BufEnter event and that this results in recursive weirdness somewhere in vim's internals. It does seem like it's probably a vim issue.I'm running vim 7.2 with patches 1-330, the current ubuntu 10.10
vim-gnome
package. I didn't actually bother to check the patches list to see if there's a resolved issue along these lines, mostly because I'm not about to get my vim from a PPA or build from source just to resolve this.Anyway, if there is some option or something that fixes this, it would be cool to find out about that. It seems like some people might want to have update profiles anyway, in case they are editing massive JS scripts and linting with rhino or something. I personally find that checking on write is enough for me — I save paranoidiacally after each edit of my code anyway.
style
I'm using dictionary functions and probably some other vaguely recent vim features, hope that's okay. I didn't start using vim until version 7.something so I'm not very clear on what features were added when, nor on what's an acceptable compatibility target.
There might be some other stylistic issues. I tried not to clash too hard with what you've got going on in there, but my usual coding style is pretty different from the addon's existing code. It seems a bit inconsistent anyway, so it seemed like a bit more variety wouldn't hurt too much. For example, I prefixed the name of a buffer-scope variable with
jslint_
even though this is not being done for most/all of the variables in the addon. I think probably it should be, since there could be conflict with other addons.