summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/term.c b/src/term.c
index d3c858c6bf2..3fa244be824 100644
--- a/src/term.c
+++ b/src/term.c
@@ -86,12 +86,12 @@ static AVOID vfatal (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0);
#ifndef HAVE_ANDROID
#define OUTPUT(tty, a) \
- emacs_tputs ((tty), a, \
+ emacs_tputs (tty, a, \
FRAME_TOTAL_LINES (XFRAME (selected_frame)) - curY (tty), \
cmputc)
-#define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc)
-#define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc)
+#define OUTPUT1(tty, a) emacs_tputs (tty, a, 1, cmputc)
+#define OUTPUTL(tty, a, lines) emacs_tputs (tty, a, lines, cmputc)
#define OUTPUT_IF(tty, a) \
do { \
@@ -99,7 +99,8 @@ static AVOID vfatal (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0);
OUTPUT (tty, a); \
} while (0)
-#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
+#define OUTPUT1_IF(tty, a) \
+ do { if (a) emacs_tputs (tty, a, 1, cmputc); } while (0)
#endif
@@ -1117,7 +1118,7 @@ per_line_cost (const char *str)
int *char_ins_del_vector;
-#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_COLS ((f))])
+#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_COLS (f)])
static void
calculate_ins_del_char_costs (struct frame *f)
@@ -1630,8 +1631,19 @@ produce_glyphs (struct it *it)
it->pixel_width = it->nglyphs = 0;
else if (it->char_to_display == '\t')
{
+ /* wrap-prefix strings are prepended to continuation lines, so
+ the width of tab characters inside should be computed from
+ the start of this screen line rather than as a product of the
+ total width of the physical line being wrapped. */
int absolute_x = (it->current_x
- + it->continuation_lines_width);
+ + (it->string_from_prefix_prop_p
+ /* Subtract the width of the
+ prefix from it->current_x if
+ it exists. */
+ ? 0 : (it->continuation_lines_width
+ ? (it->continuation_lines_width
+ - it->wrap_prefix_width)
+ : 0)));
int x0 = absolute_x;
/* Adjust for line numbers. */
if (!NILP (Vdisplay_line_numbers) && it->line_number_produced_p)
@@ -1703,7 +1715,13 @@ produce_glyphs (struct it *it)
/* Advance current_x by the pixel width as a convenience for
the caller. */
if (it->area == TEXT_AREA)
- it->current_x += it->pixel_width;
+ {
+ it->current_x += it->pixel_width;
+
+ if (it->continuation_lines_width
+ && it->string_from_prefix_prop_p)
+ it->wrap_prefix_width = it->current_x;
+ }
it->ascent = it->max_ascent = it->phys_ascent = it->max_phys_ascent = 0;
it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1;
#endif