On Mar 10, 2:09 pm, Charles Campbell <[email protected]>
wrote:

> As you can see, I added one event -- if you've written the buffer,
> presumably its safe to syntax highlight.

The presumption is correct. I hadn't thought of doing that but it very
accurately ties in with the workflow and results in a very desirable
outcome: "highlighting is on as soon as user decides his edits are
complete and does a save"


> au InsertEnter * if exists("syntax_on")| syn off | endif
> au InsertLeave * syn on
> au CursorMoved * if &modified && exists("syntax_on") | syn off | endif
> au BufWritePost * if !exists("syntax_on") | syn on | endif

Works great Charles! Thank you.  ....except has another bizarre
seemingly non-local side effect.

Symptoms:

Open a file.
Take insertion point to a line I want to edit.
Press "i" and enter insert mode.
Highlighting turns off [great, as desired]
Press escape to come out of insert mode.
Press any cursor key and the cursor suddenly drops down to almost the
very bottom of the file.

I have no idea why it chooses that particular non-local location to
drop to but it seems pretty consistent. I tried taking the cursor to
another arbitrary location in the file before I saved. But still the
same symptom. It drops to the original location the moment I do the
sequence "Esc + cursor key"

Any other ideas? Are we somehow storing the cursor location and not
resetting it or some such?

--
Rahul



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to