jshint.vim
jshint.vim copied to clipboard
Random jk characters at the end of line
Vim 7.3 on Ubuntu 12.10
When escaping from insert mode and quickly press next command usually j or k, they are left at the end of the line. The character usually replaces the last character of the line like quote with the character pressed. Sometimes it just quickly flashes and sometimes it stays.
Example:
var App = { Models: {}, Collections: {}, Views: {j <---- ESC insert mode end quickly press j }
I got the same sort of things, commands appears were the cursor is. By disabling jshint.vim I don't get the issue.
The problem for me was the this event jshint.vim#L28 which seems to interfere with other plugins. For me, the "solution" was to only to run JSHint on save and read.
There has got to be a way to fix this issue without changing autodetect off. Can you exit insert mode before running jshint so that it does not wait for jshint before exiting insert mode
Also experiencing this. I tend to pathologically save (':w') after making changes, and I'm getting 'w' inserted all over the place.
:+1:
Getting the stray w
from pathologically :w
-ing
I used to press CTRL-L to refresh the screen.
BTW, I cannot find this repository thru searching in github with the keyword, 'jshint.vim'. Why does it happen?
For me it was the cursorhold/move event hooks that was causing the problems. commenting out: jshint.vim#L39-L44 fixed it for me.
@jimmec's suggestion seems to work. It also seems to fix another issue I have where jshint gets run on buffers that I open, regardless of setting let g:JSHintUpdateWriteOnly=1
. Is this repo maintained anymore? I would hate to have to comment out that line every time download the plugin on a new machine.
This issue is occurring for me as well, even after @jimmec's suggestion. It's happening less, but still happening
My solution involved only invoking JSHint on save, which is the behavior I want anyway.
To do that I added this line to my .vimrc
:
" Only invoke vim-jshint on save
let g:JSHintUpdateWriteOnly = 1
And I removed these lines from jshint.vim/ftplugin/javascript/jshint.vim
noremap <buffer><silent> dd dd:JSHintUpdate<CR>
noremap <buffer><silent> dw dw:JSHintUpdate<CR>
noremap <buffer><silent> u u:JSHintUpdate<CR>
noremap <buffer><silent> <C-R> <C-R>:JSHintUpdate<CR>