On 21 September 2016, Markus Knecht <markus.knech...@gmail.com> wrote:
> Hello,
> For a project I have to import some markings into vim and for that I'm
> writing a plugin.  These markings are in the form of:
>   line start, 
>   coloumn start, //the start character index
>   line end, 
>   coloumn end, //the end character index
>   message 
> over the signs I have managed to mark the lines and display the
> message when the cursor is on the line. But now I need to highlight
> the characters, like a search does it when hlsearch is enabled, and
> the only thing i found is the matchadd() methode and commands like
> :match, but all of these work with a pattern. But i just need a
> straight forward mark exactly that mechanism which works on a line
> coloumn basis. I would much apriciate it if someone could point me in
> the right direction.

    One way to do it:

        function! HL(group, lstart, cstart, lend, cend)
            if a:lstart > a:lend
            elseif a:lstart == a:lend
                call matchaddpos(a:group, [[a:lstart, a:cstart, a:cend - 
a:cstart + 1]])
                call matchadd(a:group, printf('\%%%dl\%%>%dc', a:lstart, 
a:cstart - 1))
                for line in range(a:lstart + 1, a:lend - 1)
                    call matchaddpos(a:group, [line])
                call matchadd(a:group, printf('\%%%dl\%%<%dc', a:lend, a:cend + 


You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui