Geany does not provide a pre-compile analysis system since for many languages Geany does not have enough information to do that analysis.

I'm actually not asking for all of this.
Maybe that screenshot was the wrong way to explain what I'm looking for...

 

What I'm asking for is:

Geany clearly has knowledge about which error in the compiler tab belongs to which line in the text buffer.
There must be this knowledge, because if I click an error in the compiler tab Geany brings the cursor to the corresponding line in the text buffer. Same if I click Menu->Build->Next error.

So I'm just asking for the other way around. When I click a line in the text buffer, Geany could search if there's an corresponding error in the compiler tab. And if yes, bring the compiler tab to foreground and let it scroll to the corresponding error.

This should be possible using the existing knowledge Geany has about the errors in the compiler tab and the corresponding lines in the text buffer. No extra UI elements are needed. Just bring the compiler tab to foreground and let it scroll to the first error which corresponds with the active line in the text buffer.

 

P.S.

This is a humble wish and I know there's no obligation to fulfil it :-)
And yes, I don't even have a pull request.

I'm not much into C(++) development. But I've taken a first look into the code.

I'm still searching for a way to register an event if the cursor is being moved to a new line.
--> Can you give me a hint where I can register such a handler and get the number of the current line?

In that event handler, the compiler output should be searched for that line.
I've taken a look at the function msgwin_goto_compiler_file_line in msgwindow.c. Like there this would need access to GTK_TREE_VIEW(msgwindow.tree_compiler) and it's model. But it should loop on calling msgwin_parse_compiler_error_line until line matches the current line of the cursor.
(maybe this can be optimized later on with a caching data structure, because calling msgwin_parse_compiler_error_line often is probably CPU consuming)

And finally gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER); and goto_compiler_file_line(filename, line, focus_editor); should be called.
Similar to when Next error is being clicked. But in this case it's not the "next" error, but the error for the line the cursor is currently in.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/issues/3225/1166729004@github.com>