Sublime Forum

'result_file_regex' results in 'std::exception in regex', however works on change view

#1

I am currently working on/forking a plugin for Sublime Text Editor 3, I have ported the plugin to 3 as it was originally for Sublime 2.

I am using the following code to set the output regex for file matching:

settings().set("result_file_regex", "^([^ ].*) \([0-9]+ match(?:es)?\)$")
settings().set("result_line_regex", "^ +([0-9]+): ")

When the new output window is created, and populated with file names, double clicking on the line or path results in an error in the console:
error std::exception in regex: ^([^ ].*) ([0-9]+ match(?:es)?)$

However, if I change the view tab to another document and then switch back to the result view, I am able to click on the paths and it works perfectly, why is this happening?

PS. I am using the following to print to the view:
run_command('insert', {'characters': output})

Gif of the error and behaviour:

1 Like

Save find results and reopen them with syntax highlight
#2

seems like it is a bug that has been there a long time…

2 Likes

#3

Ouch, does this mean there is no way to get around it? How do people deal with displaying results in a new view with a click through to the file?

1 Like

#5

if you read the issue I linked to, the first post shows how other people work around it.

I’m also going to link to the issue you created on the core issues repo, for others benefit:

1 Like

#6

Ah thank you, sorry I read the first post as an issue, and didn’t realise it had a workaround. I guess that’s a temporary fix.

1 Like