diff options
| author | Eli Zaretskii | 2022-07-23 19:27:30 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-07-23 19:27:30 +0300 |
| commit | 280b8c96ccaeb95548adda78466ef2b1c3cf4546 (patch) | |
| tree | aa989826bc6e74143a4b7ad725d26150cf31030f /src | |
| parent | 57a978fd74454392a041ac65a5abba8d012b88cc (diff) | |
| download | emacs-280b8c96ccaeb95548adda78466ef2b1c3cf4546.tar.gz emacs-280b8c96ccaeb95548adda78466ef2b1c3cf4546.zip | |
Improve display of columns on mode-line
* src/xdisp.c (decode_mode_spec): A better representation for
"unknown column number".
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c73958854cd..add14a084fc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -27620,10 +27620,20 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 27620 | even crash emacs.) */ | 27620 | even crash emacs.) */ |
| 27621 | if (mode_line_target == MODE_LINE_TITLE) | 27621 | if (mode_line_target == MODE_LINE_TITLE) |
| 27622 | return ""; | 27622 | return ""; |
| 27623 | else if (b->long_line_optimizations_p) | ||
| 27624 | { | ||
| 27625 | char *p = decode_mode_spec_buf; | ||
| 27626 | int pad = width - 2; | ||
| 27627 | while (pad-- > 0) | ||
| 27628 | *p++ = ' '; | ||
| 27629 | *p++ = '?'; | ||
| 27630 | *p++ = '?'; | ||
| 27631 | *p = '\0'; | ||
| 27632 | return decode_mode_spec_buf; | ||
| 27633 | } | ||
| 27623 | else | 27634 | else |
| 27624 | { | 27635 | { |
| 27625 | ptrdiff_t col = | 27636 | ptrdiff_t col = current_column (); |
| 27626 | b->long_line_optimizations_p ? 0 : current_column (); | ||
| 27627 | int disp_col = (c == 'C') ? col + 1 : col; | 27637 | int disp_col = (c == 'C') ? col + 1 : col; |
| 27628 | w->column_number_displayed = col; | 27638 | w->column_number_displayed = col; |
| 27629 | pint2str (decode_mode_spec_buf, width, disp_col); | 27639 | pint2str (decode_mode_spec_buf, width, disp_col); |