@@ -196,22 +196,17 @@ char separately.
196
196
(+ (ch1:len ) (ch2:len )))))
197
197
198
198
199
- (fn set- beacon -for- labeled [target { : user - given - targets ? : aot ?} ]
200
- (let [offset (if aot ? ( get - label - offset target ) 0 ) ; user-given-targets implies (not aot )
201
- pad (if ( or user - given - targets ? aot ?) "" " " )
199
+ (fn set- beacon -for- labeled [target ]
200
+ (let [offset (or target.beacon - offset 0 )
201
+ pad (or target.pad " " )
202
202
label (or (. opts.substitute_chars target.label ) target.label )
203
- text (.. label pad )
203
+ text (or target.text ( .. label pad ) )
204
204
virttext (case target.label - state
205
205
:selected [[text hl.group.label - selected ]]
206
206
:active-primary [[text hl.group.label - primary ]]
207
207
:active-secondary [[text hl.group.label - secondary ]]
208
- :inactive (if (and aot ? (not opts.highlight_unlabeled_phase_one_targets ))
209
- ; In this case, "no highlight" should
210
- ; unambiguously signal "no further keystrokes
211
- ; needed", so it is mandatory to show all labeled
212
- ; positions in some way.
213
- [[(.. " " pad ) hl.group.label - secondary ]]
214
- :else nil ))]
208
+ ; only show text on inactive targets if explicitly set
209
+ :inactive (if target.text [[target.text hl.group.label - secondary ]] :else nil ))]
215
210
(set target.beacon (when virttext [offset virttext ]))))
216
211
217
212
@@ -344,13 +339,13 @@ is either labeled (C) or not (B).
344
339
other (set- beacon - to -match- hl target )))))))))
345
340
346
341
347
- (fn set- beacons [targets {: no - labels ? : user - given - targets ? : aot ?}]
342
+ (fn set- beacons [targets {: no - labels ? : aot ?}]
348
343
(if (and no - labels ? (. targets 1 :chars)) ; user-given targets might not have :chars
349
344
(each [_ target (ipairs targets )]
350
345
(set- beacon - to -match- hl target ))
351
346
(do (each [_ target (ipairs targets )]
352
347
(if target.label
353
- (set- beacon -for- labeled target { : user - given - targets ? : aot ?} )
348
+ (set- beacon -for- labeled target )
354
349
355
350
(and aot ? opts.highlight_unlabeled_phase_one_targets )
356
351
(set- beacon - to -match- hl target )))
@@ -725,7 +720,7 @@ is either labeled (C) or not (B).
725
720
; setting the initial label states if using `spec-keys.repeat_search`.
726
721
(when targets.label -set
727
722
(set- label - states targets {: group - offset }))
728
- (set- beacons targets {:aot? vars.aot ? : no - labels ? : user - given - targets ? })
723
+ (set- beacons targets {:aot? vars.aot ? : no - labels ?})
729
724
(local (start end ) (get - highlighted - idx - range targets no - labels ?))
730
725
(with - highlight - chores (fn [] (light - up - beacons targets {: start : end }))))
731
726
; ---
@@ -790,7 +785,7 @@ is either labeled (C) or not (B).
790
785
(doto (. targets i ) (tset :label nil ) (tset :beacon nil ))))))
791
786
; ---
792
787
(fn display []
793
- (set- beacons targets {: no - labels ? :aot? vars.aot ? : user - given - targets ? })
788
+ (set- beacons targets {: no - labels ? :aot? vars.aot ?})
794
789
(local (start end ) (get - highlighted - idx - range targets no - labels ?))
795
790
(with - highlight - chores (fn [] (light - up - beacons targets {: start : end }))))
796
791
; ---
@@ -864,13 +859,27 @@ is either labeled (C) or not (B).
864
859
(prepare - targets targets ))
865
860
(do
866
861
(when (> (length targets ) max - phase - one - targets )
867
- (set vars.aot ? false ))
862
+ (do
863
+ (set vars.aot ? false )
864
+ (each [_ target (ipairs targets )]
865
+ (set target.beacon - offset 0 ))))
868
866
(populate - sublists targets )
869
867
(each [_ sublist (pairs targets.sublists )]
870
868
(prepare - targets sublist ))
871
- (doto targets
872
- (set- initial - label - states )
873
- (set- beacons {:aot? vars.aot ?}))))
869
+ (set- initial - label - states targets )
870
+ (each [_ target (ipairs targets )]
871
+ (if vars.aot ?
872
+ (do
873
+ (set target.beacon - offset (get - label - offset target ))
874
+ (when (and (not opts.highlight_unlabeled_phase_one_targets ) (= target.label - state :inactive))
875
+ ; In this case, "no highlight" should
876
+ ; unambiguously signal "no further keystrokes
877
+ ; needed", so it is mandatory to show all labeled
878
+ ; positions in some way.
879
+ (set target.text " " )
880
+ ))
881
+ (when (not user - given - targets ?) (set target.pad " " ))))
882
+ (set- beacons targets {:aot? vars.aot ?})))
874
883
(local in2 (or ?in2 (get - second - pattern - input targets ))) ; REDRAW
875
884
(when-not in2
876
885
(exit - early ))
0 commit comments