aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 3286cd338ff..fe6b515493e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2940,7 +2940,8 @@ the normal hook `change-major-mode-hook'. */)
2940 [BEG, END). 2940 [BEG, END).
2941 2941
2942 If EMPTY is true, include empty overlays in that range and also at 2942 If EMPTY is true, include empty overlays in that range and also at
2943 END, provided END denotes the position at the end of the buffer. 2943 END, provided END denotes the position at the end of the accessible
2944 part of the buffer.
2944 2945
2945 Return the number found, and store them in a vector in *VEC_PTR. 2946 Return the number found, and store them in a vector in *VEC_PTR.
2946 Store in *LEN_PTR the size allocated for the vector. 2947 Store in *LEN_PTR the size allocated for the vector.
@@ -2968,7 +2969,7 @@ overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend,
2968 struct itree_node *node; 2969 struct itree_node *node;
2969 2970
2970 ITREE_FOREACH (node, current_buffer->overlays, beg, 2971 ITREE_FOREACH (node, current_buffer->overlays, beg,
2971 /* Find empty OV at Z ? */ 2972 /* Find empty OV at ZV ? */
2972 (end >= ZV && empty) ? ZV + 1 : ZV, ASCENDING) 2973 (end >= ZV && empty) ? ZV + 1 : ZV, ASCENDING)
2973 { 2974 {
2974 if (node->begin > end) 2975 if (node->begin > end)
@@ -2985,6 +2986,8 @@ overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend,
2985 ITREE_FOREACH_ABORT (); 2986 ITREE_FOREACH_ABORT ();
2986 break; 2987 break;
2987 } 2988 }
2989 if (empty && node->begin != node->end)
2990 continue;
2988 } 2991 }
2989 2992
2990 if (! empty && node->begin == node->end) 2993 if (! empty && node->begin == node->end)
@@ -3111,11 +3114,11 @@ disable_line_numbers_overlay_at_eob (void)
3111 3114
3112 size = ARRAYELTS (vbuf); 3115 size = ARRAYELTS (vbuf);
3113 v = vbuf; 3116 v = vbuf;
3114 n = overlays_in (ZV, ZV, 0, &v, &size, NULL, NULL); 3117 n = overlays_in (ZV, ZV, 0, &v, &size, false, NULL);
3115 if (n > size) 3118 if (n > size)
3116 { 3119 {
3117 SAFE_NALLOCA (v, 1, n); 3120 SAFE_NALLOCA (v, 1, n);
3118 overlays_in (ZV, ZV, 0, &v, &n, NULL, NULL); 3121 overlays_in (ZV, ZV, 0, &v, &n, false, NULL);
3119 } 3122 }
3120 3123
3121 for (i = 0; i < n; ++i) 3124 for (i = 0; i < n; ++i)