@@ -520,12 +520,14 @@ the selected tab visible."
520
520
(add-face-text-property (point-min ) (point-max ) 'tab-line )
521
521
(if (> (vertical-motion 1 ) 0 )
522
522
(let* ((point (previous-single-property-change (point ) 'tab ))
523
- (tab-prop (or (get-pos-property point 'tab )
524
- (get-pos-property
525
- (previous-single-property-change point 'tab ) 'tab )))
526
- (new-hscroll (seq-position strings tab-prop
527
- (lambda (str tab )
528
- (eq (get-pos-property 1 'tab str) tab)))))
523
+ (tab-prop (when point
524
+ (or (get-pos-property point 'tab )
525
+ (and (setq point (previous-single-property-change point 'tab ))
526
+ (get-pos-property point 'tab )))))
527
+ (new-hscroll (when tab-prop
528
+ (seq-position strings tab-prop
529
+ (lambda (str tab )
530
+ (eq (get-pos-property 1 'tab str) tab))))))
529
531
(when new-hscroll
530
532
(setq hscroll (- new-hscroll))
531
533
(set-window-parameter nil 'tab-line-hscroll hscroll)))
@@ -545,12 +547,14 @@ the selected tab visible."
545
547
(add-face-text-property (point-min ) (point-max ) 'tab-line )
546
548
(when (> (vertical-motion 1 ) 0 )
547
549
(let* ((point (previous-single-property-change (point ) 'tab ))
548
- (tab-prop (or (get-pos-property point 'tab )
549
- (get-pos-property
550
- (previous-single-property-change point 'tab ) 'tab )))
551
- (new-hscroll (seq-position strings tab-prop
552
- (lambda (str tab )
553
- (eq (get-pos-property 1 'tab str) tab)))))
550
+ (tab-prop (when point
551
+ (or (get-pos-property point 'tab )
552
+ (and (setq point (previous-single-property-change point 'tab ))
553
+ (get-pos-property point 'tab )))))
554
+ (new-hscroll (when tab-prop
555
+ (seq-position strings tab-prop
556
+ (lambda (str tab )
557
+ (eq (get-pos-property 1 'tab str) tab))))))
554
558
(when new-hscroll
555
559
(setq hscroll (- new-hscroll))
556
560
(set-window-parameter nil 'tab-line-hscroll hscroll)))))))))
0 commit comments