diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-14 16:28:33 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-14 16:28:33 -0400 |
commit | b86505387480fed81629cbc81cef6b70098bd607 (patch) | |
tree | d7a8587f015342399859f75a81da3873c3807272 /test/src | |
parent | 65a7b5a802a15daa6274403fef822ec3c9b95469 (diff) | |
download | emacs-b86505387480fed81629cbc81cef6b70098bd607.tar.gz emacs-b86505387480fed81629cbc81cef6b70098bd607.tar.bz2 emacs-b86505387480fed81629cbc81cef6b70098bd607.zip |
src/textprop.c (get_char_property_and_overlay): Fix bug#58479
Correct `get-char-property` which failed to ignore empty overlays.
* src/textprop.c (get_char_property_and_overlay): Make sure the
overlay covers the character.
* test/src/buffer-tests.el (buffer-tests--overlay-bug58479): New test.
* src/buffer.h (buffer_has_overlays): Avoid `interval_tree_size`.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/buffer-tests.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 9bccbdf2e89..3833f88c5c8 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -1340,6 +1340,14 @@ with parameters from the *Messages* buffer modification." (overlay-put ov 'value i))) (should (eq 9 (get-char-property 1 'value))))) +(ert-deftest buffer-tests--overlay-bug58479 () + (with-temp-buffer + (insert "ab") + (let* ((pos (+ (point-min) 1)) + (ol (make-overlay pos pos))) + (overlay-put ol 'my-prop 'set) + (should (null (get-char-property pos 'my-prop)))))) + ;; +==========================================================================+ ;; | Other |