summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 33ef9a34177..a822dafefcf 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2275,6 +2275,10 @@ move_if_not_intangible (position)
pos = Fnext_char_property_change (pos, Qnil);
}
+ else if (position < BEGV)
+ position = BEGV;
+ else if (position > ZV)
+ position = ZV;
/* If the whole stretch between PT and POSITION isn't intangible,
try moving to POSITION (which means we actually move farther