rhysd / vim-grammarous

A powerful grammar checker for Vim using LanguageTool.
1.1k stars 41 forks source link

Grammarous marks errors in the wrong buffer. #66

Open skywind3000 opened 6 years ago

skywind3000 commented 6 years ago

Grammarous will execute languagetool.jar in background. When result arrives, context may change, current document/window may be closed.

LaugnageTool always take a long time in analyzing texts, some times I start languagetool by :GrammarousCheck and before analyzing finish I switch to another split window, a few seconds later, the result arrives and Grammarous highlights error/warnings in the wrong buffer (not the original one).

Grammarous need a buffer check before handling the result. When languagetool finish, grammarous should check if the current buffer is still the original one. If so, do the next thing, otherwise, discard all the result and prompt 'buffer changed'.

Or, is it possible to hightlight errors in other buffer which is not in the current window ?

Do you think it is a reasonable point to add buffer check ?