patch 8.1.0697: ":sign place" requires the buffer argument

Problem:    ":sign place" requires the buffer argument.
Solution:   Make the argument optional.  Also update the help and clean up the
            sign test. (Yegappan Lakshmanan, closes #3767)
This commit is contained in:
Bram Moolenaar
2019-01-06 16:24:01 +01:00
parent 8ad16da729
commit b328cca254
5 changed files with 106 additions and 74 deletions

View File

@ -1,4 +1,4 @@
*sign.txt* For Vim version 8.1. Last change: 2019 Jan 01
*sign.txt* For Vim version 8.1. Last change: 2019 Jan 06
VIM REFERENCE MANUAL by Gordon Prieur
@ -52,13 +52,23 @@ Example to set the color: >
:highlight SignColumn guibg=darkgrey
<
*sign-identifier*
Each placed sign is identified by a number called the sign identifier. This
identifier is used to jump to the sign or to remove the sign. The identifier
is assigned when placing the sign using the |sign-place| command or the
|sign_place()| function. Each sign identifier should be a unique number. If
multiple placed signs use the same identifier, then jumping to or removing a
sign becomes unpredictable. To avoid overlapping identifiers, sign groups can
be used. The |sign_place()| function can be called with a zero sign identifier
to allocate the next available identifier.
*sign-group*
Each sign can be assigned to either the global group or a named group. When
placing a sign, if a group name is not supplied, or an empty string is used,
then the sign is placed in the global group. Otherwise the sign is placed in
the named group. The sign identifier is unique within a group. The sign group
allows Vim plugins to use unique signs without interfering with other plugins
using signs.
Each placed sign can be assigned to either the global group or a named group.
When placing a sign, if a group name is not supplied, or an empty string is
used, then the sign is placed in the global group. Otherwise the sign is
placed in the named group. The sign identifier is unique within a group. The
sign group allows Vim plugins to use unique signs without interfering with
other plugins using signs.
*sign-priority*
Each placed sign is assigned a priority value. When multiple signs are placed
@ -178,8 +188,9 @@ See |sign_place()| for the equivalent Vim script function.
:sign place 9 group=g2 priority=50 line=5
\ name=sign1 file=a.py
<
:sign place {id} line={lnum} name={name} buffer={nr}
Same, but use buffer {nr}.
:sign place {id} line={lnum} name={name} [buffer={nr}]
Same, but use buffer {nr}. If the buffer argument is not
given, place the sign in the current buffer.
*E885*
:sign place {id} name={name} file={fname}
@ -191,8 +202,9 @@ See |sign_place()| for the equivalent Vim script function.
The optional "group={group}" attribute can be used before
"file=" to select a sign in a particular group.
:sign place {id} name={name} buffer={nr}
Same, but use buffer {nr}.
:sign place {id} name={name} [buffer={nr}]
Same, but use buffer {nr}. If the buffer argument is not
given, use the current buffer.
REMOVING SIGNS *:sign-unplace* *E159*
@ -315,11 +327,12 @@ JUMPING TO A SIGN *:sign-jump* *E157*
:sign jump {id} group={group} file={fname}
Same but jump to the sign in group {group}
:sign jump {id} buffer={nr} *E934*
:sign jump {id} [buffer={nr}] *E934*
Same, but use buffer {nr}. This fails if buffer {nr} does not
have a name.
have a name. If the buffer argument is not given, use the
current buffer.
:sign jump {id} group={group} buffer={nr}
:sign jump {id} group={group} [buffer={nr}]
Same but jump to the sign in group {group}