diff options
author | Guido Cella <guidocella91@gmail.com> | 2020-03-27 14:46:39 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-10-27 17:10:50 +0000 |
commit | e49404cba94a3855cf71fce2093862bb208ef031 (patch) | |
tree | d011415552e6882dea1a71a85f21256694d47483 /DOCS | |
parent | ad1ecd4350efe5580d1b1b56ebb8012df0dd93e6 (diff) | |
download | mpv-e49404cba94a3855cf71fce2093862bb208ef031.tar.bz2 mpv-e49404cba94a3855cf71fce2093862bb208ef031.tar.xz |
console: let type set the cursor position
This allows keybindings such as:
a script-message-to console type "seek :0 absolute" 6
% script-message-to console type "seek absolute-percent" 6
The cursor position 0 isn't allowed because it has the weird effect of
filling the console with the text twice, leaving the cursor in the
middle.
Negative positions would put the cursor n characters before the end, and
positions greater than the text's length at the end. They seem to work
at first, but the console breaks when you move the cursor, so they
aren't allowed.
It seems that float values don't cause issues, but I'm using the
argument's floor anyway to be safe. Using >= 1 instead of > 0 ignores
values like 0.5.
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/man/console.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/DOCS/man/console.rst b/DOCS/man/console.rst index d102b916b8..e9a829cbc4 100644 --- a/DOCS/man/console.rst +++ b/DOCS/man/console.rst @@ -62,8 +62,14 @@ Ctrl+W Commands -------- -``script-message-to console type <text>`` - Show the console and pre-fill it with the provided text. +``script-message-to console type <text> [<cursor_pos>]`` + Show the console and pre-fill it with the provided text, optionally + specifying the initial cursor position as a positive integer starting from + 1. + + .. admonition:: Example for input.conf + + ``% script-message-to console type "seek absolute-percent" 6`` Known issues ------------ |