convert column position to cursor column number

9 views
Skip to first unread message

Ernie Rael

unread,
Mar 12, 2022, 4:25:54 PM3/12/22
to vim...@googlegroups.com
Hi all,

The following fails when I click on a line that has tabs preceding the
click position

def Click()
    var d = getmousepos()
    win_gotoid(d['winid'])
    cursor(d['line'], d['column'])
enddef

I can not find a function to convert as needed; and/or I'm missing an
option on some function.

Any help appreciated,
-ernie


Bram Moolenaar

unread,
Mar 13, 2022, 8:08:38 AM3/13/22
to vim...@googlegroups.com, Ernie Rael
That actually looks like a bug. The column is limited to the number of
bytes in the line, should be the number of screen columns that the text
has.

--
hundred-and-one symptoms of being an internet addict:
243. You unsuccessfully try to download a pizza from www.dominos.com.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages