aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-12-01 05:17:11 +0000
committerRichard M. Stallman <[email protected]>1998-12-01 05:17:11 +0000
commit9160906f27f60f33916004ea241d84cd3fb178d0 (patch)
tree7bfc86d3a79d1c9e774efd1def42655e45c473cb
parentf1a64115804be490625d21880e0e22f4b382adbd (diff)
(Freplace_match): Set OPOINT clearly for the case
where point is in the middle of the text to be replaced.
-rw-r--r--src/search.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 29a6fe4ff4..e4877b5f49 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2417,8 +2417,10 @@ since only regular expressions have distinguished subexpressions.")
}
/* Record point, the move (quietly) to the start of the match. */
- if (PT > search_regs.start[sub])
+ if (PT >= search_regs.end[sub])
opoint = PT - ZV;
+ else if (PT > search_regs.start[sub])
+ opoint = search_regs.end[sub] - ZV;
else
opoint = PT;