aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2022-07-28 11:39:28 +0300
committerEli Zaretskii2022-07-28 11:39:28 +0300
commit2bab0f2db6fff3a99d3bc498d6139ee42aab96ea (patch)
tree752eb4168c3de256edacf9f836097e1aaa06b4f8 /src
parent4313c695cd6370667ccf086cef0d9201fdf796ca (diff)
downloademacs-2bab0f2db6fff3a99d3bc498d6139ee42aab96ea.tar.gz
emacs-2bab0f2db6fff3a99d3bc498d6139ee42aab96ea.zip
Minor update of truncate-line optimization
* src/xdisp.c (forward_to_next_line_start): Look into display and overlay strings only when lines are truncated on display.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 66b37a855bc..6237d5a0222 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7266,7 +7266,8 @@ forward_to_next_line_start (struct it *it, bool *skipped_p,
7266 7266
7267 if (!no_strings_with_newlines) 7267 if (!no_strings_with_newlines)
7268 { 7268 {
7269 if (!current_buffer->long_line_optimizations_p) 7269 if (!(current_buffer->long_line_optimizations_p
7270 && it->line_wrap == TRUNCATE))
7270 { 7271 {
7271 /* Quick-and-dirty check: if there isn't any `display' 7272 /* Quick-and-dirty check: if there isn't any `display'
7272 property in sight, and no overlays, we're done. */ 7273 property in sight, and no overlays, we're done. */
@@ -7280,10 +7281,10 @@ forward_to_next_line_start (struct it *it, bool *skipped_p,
7280 } 7281 }
7281 else 7282 else
7282 { 7283 {
7283 /* For buffers with very long lines we try harder, 7284 /* For buffers with very long and truncated lines we try
7284 because it's worth our while to spend some time 7285 harder, because it's worth our while to spend some
7285 looking into the overlays and 'display' properties 7286 time looking into the overlays and 'display' properties
7286 to try to avoid iterating through all of them. */ 7287 if we can then avoid iterating through all of them. */
7287 no_strings_with_newlines = 7288 no_strings_with_newlines =
7288 !strings_with_newlines (start, limit, it->w); 7289 !strings_with_newlines (start, limit, it->w);
7289 } 7290 }