aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJimmy Aguilar Mena2019-04-02 16:17:41 +0200
committerJimmy Aguilar Mena2019-05-05 16:27:37 +0200
commitc34f00b58cfb23dbd19b349cb2f24056ff8149ad (patch)
treeb0eab1c5b5545b3032e542c865b036e46825b559 /src
parentab4619e7c37b3b9caa2aa24405585dc05292d961 (diff)
downloademacs-c34f00b58cfb23dbd19b349cb2f24056ff8149ad.tar.gz
emacs-c34f00b58cfb23dbd19b349cb2f24056ff8149ad.zip
Fixed fill-column-indicator for continuation lines
*src/xdisp.c: Grouped the test conditions for display-fill-column-indicator mode in a macro to simplify future modifications.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8133a838..721e8ae125c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -378,6 +378,13 @@ static Lisp_Object list_of_error;
378 && (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' ' \ 378 && (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' ' \
379 || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t')))) \ 379 || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t')))) \
380 380
381/* Test all the conditions needed to print the fill column indicator. */
382#define FILL_COLUMN_INDICATOR_NEEDED(it) \
383 !NILP (Vdisplay_fill_column_indicator) \
384 && (it->continuation_lines_width == 0) \
385 && (!NILP (Vdisplay_fill_column_indicator_column)) \
386 && FIXNATP (Vdisplay_fill_column_indicator_character)
387
381/* True means print newline to stdout before next mini-buffer message. */ 388/* True means print newline to stdout before next mini-buffer message. */
382 389
383bool noninteractive_need_newline; 390bool noninteractive_need_newline;
@@ -20162,10 +20169,8 @@ append_space_for_newline (struct it *it, bool default_face_p)
20162 /* Corner case for when display-fill-column-indicator-mode 20169 /* Corner case for when display-fill-column-indicator-mode
20163 is active and the extra character should be added in the 20170 is active and the extra character should be added in the
20164 same place than the line */ 20171 same place than the line */
20165 if (!NILP (Vdisplay_fill_column_indicator) 20172 if ((it->w->pseudo_window_p == 0)
20166 && (it->w->pseudo_window_p == 0) 20173 && FILL_COLUMN_INDICATOR_NEEDED(it))
20167 && (!NILP (Vdisplay_fill_column_indicator_column))
20168 && FIXNATP (Vdisplay_fill_column_indicator_character))
20169 { 20174 {
20170 int fill_column_indicator_column = -1; 20175 int fill_column_indicator_column = -1;
20171 20176
@@ -20423,10 +20428,8 @@ extend_face_to_end_of_line (struct it *it)
20423 /* Display fill column indicator if not in modeline or 20428 /* Display fill column indicator if not in modeline or
20424 toolbar and display fill column indicator mode is 20429 toolbar and display fill column indicator mode is
20425 active */ 20430 active */
20426 if (!NILP (Vdisplay_fill_column_indicator) 20431 if ((it->w->pseudo_window_p == 0)
20427 && (it->w->pseudo_window_p == 0) 20432 && FILL_COLUMN_INDICATOR_NEEDED(it))
20428 && (!NILP (Vdisplay_fill_column_indicator_column))
20429 && FIXNATP (Vdisplay_fill_column_indicator_character))
20430 { 20433 {
20431 int fill_column_indicator_column = -1; 20434 int fill_column_indicator_column = -1;
20432 20435
@@ -20622,13 +20625,13 @@ extend_face_to_end_of_line (struct it *it)
20622 else 20625 else
20623 it->face_id = face->id; 20626 it->face_id = face->id;
20624 20627
20625 /* Display fill-column-line if mode is active */ 20628 /* Display fill-column-line if needed. */
20626 if (!NILP (Vdisplay_fill_column_indicator) 20629 if (FILL_COLUMN_INDICATOR_NEEDED(it))
20627 && (!NILP (Vdisplay_fill_column_indicator_column))
20628 && FIXNATP (Vdisplay_fill_column_indicator_character))
20629 { 20630 {
20630 int fill_column_indicator_column = -1; 20631 int fill_column_indicator_column = -1;
20631 20632
20633 /* Vdisplay_fill_column_indicator_column accepts the special value t
20634 to use the default fill-column variable. */
20632 if (EQ (Vdisplay_fill_column_indicator_column, Qt) 20635 if (EQ (Vdisplay_fill_column_indicator_column, Qt)
20633 && FIXNATP (BVAR (current_buffer, fill_column))) 20636 && FIXNATP (BVAR (current_buffer, fill_column)))
20634 fill_column_indicator_column = 20637 fill_column_indicator_column =