Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc make: support multiline error pattern #5246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ygrek
Copy link

@ygrek ygrek commented Oct 6, 2024

apparently this is what is needed to support multiline error message pattern, e.g. for ocaml :

File "admin.ml", line 109, characters 26-30:
109 |  		Hashtbl.replace status host st
       		                       ^^^^
Error: Unbound value host

NB jump_current_line highlights only the last line, technically should change to jump_current_selection, not sure if it is ok (compatibilty?)

@ygrek
Copy link
Author

ygrek commented Oct 6, 2024

ftr

  set-option global make_error_pattern %{File "([^"]+?)", line (\d+), characters (\d+)-\d+:.*?^Error: ([^\n]+)$}

@@ -60,7 +60,7 @@ define-command -hidden make-jump %{
set-register a "%reg{1}/%reg{2}" "%reg{3}" "%reg{4}" "%reg{5}"
} catch %{
set-register / %opt{make_error_pattern}
execute-keys <a-h><a-l> s<ret>l
execute-keys n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds reasonable. I didn't test this but I think this should be something like <a-h><semicolon>n to make sure <ret> keeps working if the cursor is in the middle of an error message.

@ygrek ygrek force-pushed the make_error_pattern_multiline branch from bab414f to 2f23cf7 Compare October 6, 2024 04:27
@ygrek
Copy link
Author

ygrek commented Oct 6, 2024

@krobelus i misunderstood what it was doing, now tested with both original and my error pattern, everything seems to work properly, also left comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants