maciakl / vim-neatstatus

Neat Status Line Plugin for Vim
http://www.vim.org/scripts/script.php?script_id=4587
73 stars 18 forks source link

Visual mode color change #4

Closed davidzchen closed 11 years ago

davidzchen commented 11 years ago

I have added code to fix mode color changes for visual mode. Unfortunately, there are no convenient events like InsertEnter/InsertExit for visual mode, and the only way to fire an event to change the mode color for visual mode is by tweaking the key mappings to change the mode color upon visual mode enter/exit.

maciakl commented 11 years ago

Ok, I tested this and it doesn't seem to completely work. Entering visual mode actually works as expected, but when you hit Esc to get out of it, the color remains purple and doesn't reset until next time you hit an insert/visual mode command. So you end up moving around in normal mode while the bar is still purple. :(

I reverted the changes to keep things sane. I think another mapping is needed on the Esc key but that might cause isssues elsewhere.

davidzchen commented 11 years ago

That's interesting. I'm not seeing this behavior on my machine; there is a delay after exiting visual mode, just as there is when exiting insert mode, but I don't see NORMAL with a purple background. Are you running terminal vim or gvim? And which version? I'll take a look into this tonight. Thanks!

maciakl commented 11 years ago

I had that issue in Gvim 7.3.46.

davidzchen commented 11 years ago

I was able to reproduce it consistently in Gvim 7.3 as well. So far, this issue only appears in Gvim but not terminal vim. I will work on a fix and will send a pull request when ready. Thanks for your help!

maciakl commented 10 years ago

This issue seems to be finally fixed. The visual line colors now work both in vim and gvim as well as macvim.

davidzchen commented 10 years ago

Does that mean that it was a bug in GVim?

maciakl commented 10 years ago

No, not really. It was the changes in 1e9a9b490d57e5a0a37eb6c85c7e9c0ba7d3c17f that fixed it (sans the typos that commit introduced to the color definitions of course).

davidzchen commented 10 years ago

Ahh didn't see your commit at first. Looks awesome. Thanks!