patch 9.1.0538: not possible to assign priority when defining a sign
Problem: not possible to assign priority when defining a sign
(Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
the sign_define() function (LemonBoy)
Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.
fixes: #8334
closes: #15124
Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index dac3a57..84b2977 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -1,4 +1,4 @@
-*sign.txt* For Vim version 9.1. Last change: 2024 Jun 08
+*sign.txt* For Vim version 9.1. Last change: 2024 Jul 06
VIM REFERENCE MANUAL by Gordon Prieur
@@ -80,8 +80,9 @@
*sign-priority*
Each placed sign is assigned a priority value. When multiple signs are placed
on the same line, the attributes of the sign with the highest priority is used
-independently of the sign group. The default priority for a sign is 10. The
-priority is assigned at the time of placing a sign.
+independently of the sign group. The default priority for a sign is 10, this
+value can be changed for different signs by specifying a different value at
+definition time. The priority is assigned at the time of placing a sign.
When two signs with the same priority are present, and one has an icon or text
in the signcolumn while the other has line highlighting, then both are
@@ -135,6 +136,8 @@
Motif pixmap (.xpm)
Win32 .bmp, .ico, .cur
pixmap (.xpm) |+xpm_w32|
+ priority={prio}
+ Default priority for the sign, see |sign-priority|.
linehl={group}
Highlighting group used for the whole line the sign is placed
@@ -209,11 +212,11 @@
By default, the sign is placed in the global sign group.
- By default, the sign is assigned a default priority of 10. To
- assign a different priority value, use "priority={prio}" to
- specify a value. The priority is used to determine the sign
- that is displayed when multiple signs are placed on the same
- line.
+ By default, the sign is assigned a default priority of 10,
+ unless specified otherwise by the sign definition. To assign a
+ different priority value, use "priority={prio}" to specify a
+ value. The priority is used to determine the sign that is
+ displayed when multiple signs are placed on the same line.
Examples: >
:sign place 5 line=3 name=sign1 file=a.py
@@ -453,6 +456,7 @@
linehl highlight group used for the whole line the
sign is placed in; not present if not set
name name of the sign
+ priority default priority value of the sign
numhl highlight group used for the line number where
the sign is placed; not present if not set
text text that is displayed when there is no icon
@@ -646,7 +650,8 @@
priority Priority of the sign. When multiple signs are
placed on a line, the sign with the highest
priority is used. If not specified, the
- default value of 10 is used. See
+ default value of 10 is used, unless specified
+ otherwise by the sign definition. See
|sign-priority| for more information.
If {id} refers to an existing sign, then the existing sign is
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index d70c3b1..92792b9 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -41576,6 +41576,7 @@
- 'completeopt' is now a |global-local| option.
- 'nrformat' accepts the new "blank" suboption, to determine a signed or
unsigned number based on whitespace in front of a minus sign.
+- allow to specify a priority when defining a new sign |:sign-define|
*added-9.2*
Added ~