summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2022-01-02 20:00:40 +0200
committerJuri Linkov <juri@linkov.net>2022-01-02 20:00:40 +0200
commit83da3a09d0d8fe8f13f405c1ec780e70e94f7b0b (patch)
tree14c6516e99f0f15264bfa4cfc778e2574de22156
parentb477cff35d3f5513e57f71a34272bebd1c205ed3 (diff)
downloademacs-83da3a09d0d8fe8f13f405c1ec780e70e94f7b0b.tar.gz
* lisp/tab-line.el: Revert part of the fix in a6adfe21e4 (bug#52881)
(tab-line--get-tab-property, tab-line-auto-hscroll): Use get-pos-property instead of get-text-property that fails after previous-single-property-change.
-rw-r--r--lisp/tab-line.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 37cfff17237..6aa3a858101 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -616,10 +616,10 @@ the selected tab visible."
(defvar tab-line-auto-hscroll-buffer (generate-new-buffer " *tab-line-hscroll*"))
(defun tab-line--get-tab-property (prop string)
- (or (get-text-property 1 prop string) ;; for 99% cases of 1-char separator
- (get-text-property 0 prop string) ;; for empty separator
+ (or (get-pos-property 1 prop string) ;; for most cases of 1-char separator
+ (get-pos-property 0 prop string) ;; for empty separator
(let ((pos (next-single-property-change 0 prop string))) ;; long separator
- (and pos (get-text-property pos prop string)))))
+ (and pos (get-pos-property pos prop string)))))
(defun tab-line-auto-hscroll (strings hscroll)
(with-current-buffer tab-line-auto-hscroll-buffer
@@ -656,9 +656,9 @@ the selected tab visible."
(if (> (vertical-motion 1) 0)
(let* ((point (previous-single-property-change (point) 'tab))
(tab-prop (when point
- (or (get-text-property point 'tab)
+ (or (get-pos-property point 'tab)
(and (setq point (previous-single-property-change point 'tab))
- (get-text-property point 'tab)))))
+ (get-pos-property point 'tab)))))
(new-hscroll (when tab-prop
(seq-position strings tab-prop
(lambda (str tab)
@@ -683,9 +683,9 @@ the selected tab visible."
(when (> (vertical-motion 1) 0)
(let* ((point (previous-single-property-change (point) 'tab))
(tab-prop (when point
- (or (get-text-property point 'tab)
+ (or (get-pos-property point 'tab)
(and (setq point (previous-single-property-change point 'tab))
- (get-text-property point 'tab)))))
+ (get-pos-property point 'tab)))))
(new-hscroll (when tab-prop
(seq-position strings tab-prop
(lambda (str tab)