Thursday, September 17, 2015

Re: Why does synID() always return zero when inserting at the end of a line?

On Thursday, September 17, 2015 at 12:01:52 PM UTC-5, Tony Mechelynck wrote:
> Maybe because in Insert mode at the end of the line, the cursor is one
> past the last character on the line?
>

Sure, but the region extends past this line on the next line. It's inside a /* ... */ syntax region. So Vim should be able to know what the syntax region is.

> How exactly do you call synID()? In a script or at i_CTRL-O on the
> command line? Or in a mapping?
> Tests I did here were inconclusive.
>

Two ways I experienced while debugging this:
1. In a CursorMovedI autocmd.
2. Using i_CTRL-R with the expression register.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment