diff options
author | Juri Linkov <juri@linkov.net> | 2022-08-27 22:52:03 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2022-08-27 22:52:03 +0300 |
commit | 3f076a8e44b652691ffd4a2a07b04ab956ed4668 (patch) | |
tree | bc95a6ee6098888cf752fe9b16f7caf5d1e57764 /src/indent.c | |
parent | 0ab49d46ddbe27970c62a56597de000bc1c3232c (diff) | |
download | emacs-3f076a8e44b652691ffd4a2a07b04ab956ed4668.tar.gz emacs-3f076a8e44b652691ffd4a2a07b04ab956ed4668.tar.bz2 emacs-3f076a8e44b652691ffd4a2a07b04ab956ed4668.zip |
Use truncated-partial-width-window-p in more places (bug#56815)
* lisp/simple.el (line-move, line-move-finish):
Use truncated-partial-width-window-p.
* lisp/window.el (count-screen-lines, scroll-command--goto-goal-column):
Use truncated-partial-width-window-p.
(truncated-partial-width-window-p): Replace window-width with
window-total-width.
* src/indent.c (scan_for_column): Bring the logic of using
truncated-partial-width-window-p closer to what the display engine does.
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c index cb368024d97..aa905f387bb 100644 --- a/src/indent.c +++ b/src/indent.c @@ -577,12 +577,15 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, if (!NILP (BVAR (current_buffer, truncate_lines))) lines_truncated = true; - else if (w && FIXNUMP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); - else if (w && !NILP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w))); + else if (!NILP (Vtruncate_partial_width_windows) && w + && w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w)))) + { + if (FIXNUMP (Vtruncate_partial_width_windows)) + lines_truncated = + w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); + else + lines_truncated = true; + } /* Special optimization for buffers with long and truncated lines: assumes that each character is a single column. */ if (lines_truncated) |