ui/doom-modeline: fix current index in iedit segment
This commit is contained in:
parent
fcb88ef940
commit
ebf85fe0a8
1 changed files with 13 additions and 12 deletions
|
@ -454,19 +454,20 @@ lines are selected, or the NxM dimensions of a block selection."
|
||||||
|
|
||||||
(defsubst +doom-modeline--iedit ()
|
(defsubst +doom-modeline--iedit ()
|
||||||
"Show the number of iedit regions matches + what match you're on."
|
"Show the number of iedit regions matches + what match you're on."
|
||||||
(when (and (featurep 'iedit) iedit-mode)
|
(when (and iedit-mode iedit-occurrences-overlays)
|
||||||
(propertize
|
(propertize
|
||||||
(let ((this-oc (let (message-log-max) (iedit-find-current-occurrence-overlay)))
|
(let ((this-oc (or (let ((inhibit-message t))
|
||||||
(length (or (ignore-errors (length iedit-occurrences-overlays)) 0)))
|
(iedit-find-current-occurrence-overlay))
|
||||||
(format " %s/%s "
|
(progn (iedit-prev-occurrence)
|
||||||
(save-excursion
|
(iedit-find-current-occurrence-overlay))))
|
||||||
(unless this-oc
|
(length (length iedit-occurrences-overlays)))
|
||||||
(iedit-prev-occurrence)
|
(format " %s/%d "
|
||||||
(setq this-oc (iedit-find-current-occurrence-overlay)))
|
(if this-oc
|
||||||
(if this-oc
|
(- length
|
||||||
;; NOTE: Not terribly reliable
|
(length (cdr
|
||||||
(- length (-elem-index this-oc iedit-occurrences-overlays))
|
(memq this-oc (sort (append iedit-occurrences-overlays (list))
|
||||||
"-"))
|
(lambda (x y) (< (overlay-start x) (overlay-start y))))))))
|
||||||
|
"-")
|
||||||
length))
|
length))
|
||||||
'face (if (active) 'doom-modeline-panel))))
|
'face (if (active) 'doom-modeline-panel))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue