1
0
forked from aniani/vim

patch 8.0.0818: cannot get the cursor position of a terminal

Problem:    Cannot get the cursor position of a terminal.
Solution:   Add term_getcursor().
This commit is contained in:
Bram Moolenaar
2017-07-30 18:28:38 +02:00
parent 22aad2f880
commit 97870002d3
5 changed files with 50 additions and 13 deletions

View File

@@ -2370,6 +2370,7 @@ tan({expr}) Float tangent of {expr}
tanh({expr}) Float hyperbolic tangent of {expr}
tempname() String name for a temporary file
term_getattr({attr}, {what} Number get the value of attribute {what}
term_getcursor({buf}) List get the cursor position of a terminal
term_getjob({buf}) Job get the job associated with a terminal
term_getline({buf}[, {row}]) String get a line of text from a terminal
term_getsize({buf}) List get the size of a terminal
@@ -7910,6 +7911,19 @@ term_getattr({attr}, {what}) *term_getattr()*
strike
reverse
term_getcursor({buf}) *term_getcursor()*
Get the cusor position of terminal {buf}. Returns a list with
three numbers: [rows, cols, visible]. "rows" and "cols" are
zero based. "visible" is one when the cursor is visible, zero
when it is hidden.
This is the cursor position of the terminal itself, not of the
Vim window.
{buf} must be the buffer number of a terminal window. If the
buffer does not exist or is not a terminal window, an empty
list is returned.
term_getjob({buf}) *term_getjob()*
Get the Job associated with terminal window {buf}.
{buf} is used as with |term_getsize()|.