1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-08-16 16:20:38 +03:00

rc grep/make: Revert "Support windows style path in grep output"

grep-jump and make-jump[*] support Windows-style paths like C:\path.
However grep-next-match and make-next-error don't, which suggests
that no one uses this feature.  IIRC Cygwin mounts Windows drives in
proper Unix paths like /mnt/drive_c.

Let's remove it for simplicity and consistency.

This reverts commit 6c47b204e (Support windows style path in grep
output, 2014-11-11).

[*]: Though make-jump recently regressed in 8e5ca3f21 (rc/make.kak
introduce a new option to be back compatible, 2023-10-27) by failing
to capture the "C:" prefix.
This commit is contained in:
Johannes Altmanninger 2024-02-25 11:12:54 +01:00 committed by Maxime Coste
parent b8f76c6e1a
commit 20d353936e
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ complete-command grep file
hook -group grep-highlight global WinSetOption filetype=grep %{
add-highlighter window/grep group
add-highlighter window/grep/ regex "^((?:\w:)?[^:\n]+):(\d+):(\d+)?" 1:cyan 2:green 3:green
add-highlighter window/grep/ regex "^([^:\n]+):(\d+):(\d+)?" 1:cyan 2:green 3:green
add-highlighter window/grep/ line %{%opt{grep_current_line}} default+b
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/grep }
}
@ -54,7 +54,7 @@ declare-option -docstring "name of the client in which all source code jumps wil
define-command -hidden grep-jump %{
evaluate-commands %{ # use evaluate-commands to ensure jumps are collapsed
try %{
execute-keys 'xs^((?:\w:)?[^:]+):(\d+):(\d+)?<ret>'
execute-keys 'xs^([^:]+):(\d+):(\d+)?<ret>'
set-option buffer grep_current_line %val{cursor_line}
evaluate-commands -try-client %opt{jumpclient} -verbatim -- edit -existing %reg{1} %reg{2} %reg{3}
try %{ focus %opt{jumpclient} }

View File

@ -1,7 +1,7 @@
declare-option -docstring "shell command run to build the project" \
str makecmd make
declare-option -docstring "pattern that describes lines containing information about errors in the output of the `makecmd` command. Capture groups must be: 1: filename 2: line number 3: optional column 4: optional error description" \
regex make_error_pattern "^(?:\w:)?([^:\n]+):(\d+):(?:(\d+):)? (?:fatal )?error:([^\n]+)?"
regex make_error_pattern "^([^:\n]+):(\d+):(?:(\d+):)? (?:fatal )?error:([^\n]+)?"
declare-option -docstring "name of the client in which utilities display information" \
@ -26,7 +26,7 @@ define-command -params .. \
}}
add-highlighter shared/make group
add-highlighter shared/make/ regex "^((?:\w:)?[^:\n]+):(\d+):(?:(\d+):)?\h+(?:((?:fatal )?error)|(warning)|(note)|(required from(?: here)?))?.*?$" 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow
add-highlighter shared/make/ regex "^([^:\n]+):(\d+):(?:(\d+):)?\h+(?:((?:fatal )?error)|(warning)|(note)|(required from(?: here)?))?.*?$" 1:cyan 2:green 3:green 4:red 5:yellow 6:blue 7:yellow
add-highlighter shared/make/ regex "^\h*(~*(?:(\^)~*)?)$" 1:green 2:cyan+b
add-highlighter shared/make/ line '%opt{make_current_error_line}' default+b