> I tried to add the functions (patch attached - as I'm new to Vim
> internals, please tell me if that's the correct way to do it),
> but there is one major problem. screen_cur_col and screen_cur_row
> report the current cursor position - which is of course the
> command line where the current command is entered (also in
> tests), e.g. 0, 38.
> 
> That means we have to save the current cursor position before
> jumping to the command line when the users enters a command, but
> I don't know what's the correct place for this task. Please help
> me with that.
It works from inside expression mappings, like
    nnoremap <expr> GG ":echom ".screenrow()." ".screencol()."\n"
. I believe it is fine and correct behavior: always reporting real cursor 
position. Not very convenient, but correct, and completely enough for tests. 
Just mention this workaround in the doc.

But it was much better not to have “screen(col/row)()” with no arguments which 
report about cursor position, but something like “virtcol()”: with ability to 
report screen position of arbitrary byte position. If I knew, how to do it it 
would be just optional second argument to “virtcol()” that, if present and 
non-empty, makes it take concealed characters into account. I am seeing at 
least one problem with this: with this argument “virtcol()” will be forced to 
push syntax rules application once called for invisible position, or it will 
report invalid results. There must be more.

-- 
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

Raspunde prin e-mail lui