wookiehangover / jshint.vim

JSHint fork of jslint.vim
Other
194 stars 45 forks source link

Random jk characters at the end of line #27

Open gsavovski opened 10 years ago

gsavovski commented 10 years ago

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 }

krampstudio commented 10 years ago

I got the same sort of things, commands appears were the cursor is. By disabling jshint.vim I don't get the issue.

vstene commented 10 years ago

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.

collinalexbell commented 10 years ago

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

arowla commented 10 years ago

Also experiencing this. I tend to pathologically save (':w') after making changes, and I'm getting 'w' inserted all over the place.

devgeeks commented 9 years ago

:+1:

Getting the stray w from pathologically :w-ing

jaeseok-park commented 9 years ago

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?

jimmec commented 9 years ago

For me it was the cursorhold/move event hooks that was causing the problems. commenting out: jshint.vim#L39-L44 fixed it for me.

naddeoa commented 9 years ago

@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.

mcquackers commented 9 years ago

This issue is occurring for me as well, even after @jimmec's suggestion. It's happening less, but still happening

NSkelsey commented 8 years ago

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>