Saturday, December 26, 2009

Re: cursorline/cursorcolumn highlighting

On Dec 26, 10:22 am, Gary Johnson <garyj...@spocom.com> wrote:
> On 2009-12-26, Bee wrote:
> > Gary Johnson wrote:
> I thought about that possibility last night.  Your code initializes
> b:lico only once, so for only one buffer.  Here's a way to fix that
> problem without using an autocommand.  Change this
>
> > let b:lico=0
> > function LiCo()
> >   let b:lico=b:lico>2 ?0 :b:lico+1
> >   let &cursorline=b:lico % 2
> >   let &cursorcolumn=b:lico / 2
> > endfun
>
> to
>
>     function LiCo()
>       if !exists("b:lico")
>         let b:lico=0
>       endif
>       let b:lico=b:lico>2 ?0 :b:lico+1
>       let &cursorline=b:lico % 2
>       let &cursorcolumn=b:lico / 2
>     endfun
>
> Untested, but I think that syntax is right.

Thank you, that works and is a very good to know.

--
Bill
Santa Cruz, California

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

No comments: