aserebryakov / filestyle

filestyle is a Vim plugin that highlights unwanted whitespace and characters.
http://www.vim.org/scripts/script.php?script_id=5065
Apache License 2.0
30 stars 5 forks source link

[BUG]: Error on tabs switching in INSERT mode #30

Closed ashamis closed 9 years ago

ashamis commented 9 years ago

At this point the new tab will be displayed along with an error at the bottom. This error does not effect the user experience and should therefore not be displayed.

aserebryakov commented 9 years ago

The issue is caused by the fact that when user switches tabs in INSERT mode InsertLeave event doesn't happen. That means that variables g:filestyle_current_line and g:filestyle_current_line_match were not undefined, so when in another tab InsertLeave handler is called, there is no ID of a match stored in g:filestyle_current_line_match and this causes an error.

Unfortunately, proposed solution only hides the issue and doesn't solve it. Real solution should define variables filestyle_current_line and filestyle_current_line_match in scope of a buffer.

aserebryakov commented 9 years ago

Fix introduced by a commit f3407ee71cc1e4564caa96668cffcc7372fb639d.