fix(make): colorize targets from imported make-files (#81)

* fix(make): colorize targets from imported make-files

Old behavior use to parse the content of the invoked `Makefile` unit
to define targets.

Such parsing didn't take into account targets from unit imported by the
current (ex: targets defined in files imported such as `import
./targets/help.mk`).

New behavior pass the content of the Makefile unit post lexing (aka
`make -f Makefile -pn` instead of the plain unit.

* Update →chroma/-make.ch

---------

Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
This commit is contained in:
Quentin Burgess 2025-06-25 09:44:25 +02:00 committed by GitHub
parent 6f57bbe57c
commit dcee72bb99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,7 @@ local -a __lines_list reply2
__wrd="${(Q)__wrd}"
if [[ -f "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}" ]] && \
.fast-make-targets < "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}"
make -f "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}" -pn | .fast-make-targets
then
if [[ "${reply2[(r)$__wrd]}" ]]; then
(( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")