diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2007-01-06 15:25:16 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2007-01-06 15:25:16 +0000 |
commit | 191ae1cf7cd2571277635b3b8e488e773ca5c9b9 (patch) | |
tree | e0b26e3040767dae38fb39a03b757da05088c58f /src/indent.c | |
parent | 382707ecfb50f8c7794a7ba3d8cd9db9b6cd29d0 (diff) | |
parent | f85c5e3b72855951b071eacb7b6e2d002c5fc4be (diff) | |
download | emacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-585
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-586
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-587
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-588
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-589
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-590
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-591
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-592
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c index e84059972f3..af556bc38e3 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2076,7 +2076,7 @@ whether or not it is currently displayed in some window. */) { int it_start; int oselective; - int it_overshoot_expected_p; + int it_overshoot_expected; SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); @@ -2102,12 +2102,16 @@ whether or not it is currently displayed in some window. */) while (s < e && *s != '\n') ++s; - it_overshoot_expected_p = (s == e); + /* If there is no newline in the string, we need to check + whether there is a newline immediately after the string + in move_it_to below. This may happen if there is an + overlay with an after-string just before the newline. */ + it_overshoot_expected = (s == e) ? -1 : 0; } else - it_overshoot_expected_p = (it.method == GET_FROM_IMAGE - || it.method == GET_FROM_STRETCH - || it.method == GET_FROM_COMPOSITION); + it_overshoot_expected = (it.method == GET_FROM_IMAGE + || it.method == GET_FROM_STRETCH + || it.method == GET_FROM_COMPOSITION); reseat_at_previous_visible_line_start (&it); it.current_x = it.hpos = 0; @@ -2121,7 +2125,10 @@ whether or not it is currently displayed in some window. */) truncate-lines is on and PT is beyond right margin. Don't go back if the overshoot is expected (see above). */ if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 - && !it_overshoot_expected_p) + && (!it_overshoot_expected + || (it_overshoot_expected < 0 + && it.method == GET_FROM_BUFFER + && it.c == '\n'))) move_it_by_lines (&it, -1, 0); it.vpos = 0; |