aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2005-07-13 10:02:58 +0000
committerKim F. Storm2005-07-13 10:02:58 +0000
commit0163a0d5035b0787010bee5a1fdc3c4167078a23 (patch)
tree8973bd5ef1cc56e47493bf280f4a2c2ca6ecac66 /src
parente0e9a80e8b2bb71201afe00b44585a58a08573d5 (diff)
downloademacs-0163a0d5035b0787010bee5a1fdc3c4167078a23.tar.gz
emacs-0163a0d5035b0787010bee5a1fdc3c4167078a23.zip
(Fvertical_motion): If start position is on an image,
don't move back if we move too far (that's almost certain to happen).
Diffstat (limited to 'src')
-rw-r--r--src/indent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index ff188183327..3864057472c 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2074,6 +2074,7 @@ whether or not it is currently displayed in some window. */)
2074 { 2074 {
2075 int it_start; 2075 int it_start;
2076 int oselective; 2076 int oselective;
2077 int start_on_image_p;
2077 2078
2078 SET_TEXT_POS (pt, PT, PT_BYTE); 2079 SET_TEXT_POS (pt, PT, PT_BYTE);
2079 start_display (&it, w, pt); 2080 start_display (&it, w, pt);
@@ -2085,6 +2086,7 @@ whether or not it is currently displayed in some window. */)
2085 while the end position is really at some X > 0, the same X that 2086 while the end position is really at some X > 0, the same X that
2086 PT had. */ 2087 PT had. */
2087 it_start = IT_CHARPOS (it); 2088 it_start = IT_CHARPOS (it);
2089 start_on_image_p = (it.method == GET_FROM_IMAGE);
2088 reseat_at_previous_visible_line_start (&it); 2090 reseat_at_previous_visible_line_start (&it);
2089 it.current_x = it.hpos = 0; 2091 it.current_x = it.hpos = 0;
2090 /* Temporarily disable selective display so we don't move too far */ 2092 /* Temporarily disable selective display so we don't move too far */
@@ -2094,8 +2096,10 @@ whether or not it is currently displayed in some window. */)
2094 it.selective = oselective; 2096 it.selective = oselective;
2095 2097
2096 /* Move back if we got too far. This may happen if 2098 /* Move back if we got too far. This may happen if
2097 truncate-lines is on and PT is beyond right margin. */ 2099 truncate-lines is on and PT is beyond right margin.
2098 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0) 2100 It may also happen if it_start is on an image --
2101 in that case, don't go back. */
2102 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p)
2099 move_it_by_lines (&it, -1, 0); 2103 move_it_by_lines (&it, -1, 0);
2100 2104
2101 it.vpos = 0; 2105 it.vpos = 0;