summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-07-22 21:23:48 +0300
committerEli Zaretskii <eliz@gnu.org>2021-07-22 21:23:48 +0300
commit662f91a795c0b5480b1733a99ef478c94d6f1426 (patch)
tree900a4822dbc000c69ba43a34fb72b223a9ef4a1f /src
parentfcae435f598471a2911641412125c5ac4f73559f (diff)
downloademacs-662f91a795c0b5480b1733a99ef478c94d6f1426.tar.gz
emacs-662f91a795c0b5480b1733a99ef478c94d6f1426.tar.bz2
emacs-662f91a795c0b5480b1733a99ef478c94d6f1426.zip
Fix display of line/wrap-prefix when there's a display property at BOL
* src/xdisp.c (get_line_prefix_it_property): New function. (handle_line_prefix): Call 'get_line_prefix_it_property' instead of 'get_it_property', to examine also the property of the buffer text underlying the display or overlay string. (Bug#49695)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 50ab2f8e051..70d15aee68c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -22763,6 +22763,22 @@ get_it_property (struct it *it, Lisp_Object prop)
return Fget_char_property (position, prop, object);
}
+/* Return the line-prefix/wrap-prefix property, checking both the
+ current IT->OBJECT and the underlying buffer text. */
+
+static Lisp_Object
+get_line_prefix_it_property (struct it *it, Lisp_Object prop)
+{
+ Lisp_Object prefix = get_it_property (it, prop);
+
+ /* If we are looking at a display or overlay string, check also the
+ underlying buffer text. */
+ if (NILP (prefix) && it->sp > 0 && STRINGP (it->object))
+ return Fget_char_property (make_fixnum (IT_CHARPOS (*it)), prop,
+ it->w->contents);
+ return prefix;
+}
+
/* See if there's a line- or wrap-prefix, and if so, push it on IT. */
static void
@@ -22772,13 +22788,13 @@ handle_line_prefix (struct it *it)
if (it->continuation_lines_width > 0)
{
- prefix = get_it_property (it, Qwrap_prefix);
+ prefix = get_line_prefix_it_property (it, Qwrap_prefix);
if (NILP (prefix))
prefix = Vwrap_prefix;
}
else
{
- prefix = get_it_property (it, Qline_prefix);
+ prefix = get_line_prefix_it_property (it, Qline_prefix);
if (NILP (prefix))
prefix = Vline_prefix;
}