You are here: PSPad forum > English discussion forum > Triggering of error highlighting in log-win via VBScript
Posted by: Professor Bernd | Date: 2019-11-05 17:12 | IP: IP Logged
Hello Jan.
If you compile something and catch the output, it will be displayed in the PSPad Log-Win. If the log contains error messages, the first error in the log is automatically marked and the editor jumps to the error line and highlights it.
I've written a routine in VBScript that allows the user to jump through the error messages in the log. When the last line is reached, it starts again from the beginning.(If it helps, I can send you the VBScript code.)
This works so far, except for jumping to the error line in the editor and highlighting. I tried many things with Editor Commands and others, but didn't find a way.
How can I trigger jumping to the error line and highlighting in the editor?
Posted by: pspad | Date: 2019-11-05 17:49 | IP: IP Logged
You have to parse line, get line number and use caretY() function to goto line in editor
Posted by: Professor Bernd | Date: 2019-11-05 18:34 | IP: IP Logged
I just tested it. The cursor then jumps to the error line in the editor, but it is not highlighted. (The yellow error highlighting is missing.)
How can I trigger the error highlighting?
Posted by: pspad | Date: 2019-11-05 19:08 | IP: IP Logged
Yellow highlighting? Where should be yellow highlighting?
Can you add screenshot?
Posted by: Professor Bernd | Date: 2019-11-05 19:44 | IP: IP Logged
Sorry for my bad explanation. I meant the "LogParsColor" which is usually red. Here is a Scrennshot.
With my VBScript everything works, except the error highlighting in the editor window. If I double click with the mouse on an error line in the log, then the error highlighting works: Jump to the error line in the editor and highlight it (in red).
I can jump to the error line with VBScript, but how do I activate the "LogParsColor" for this line?
Edited 1 time(s). Last edit at 2019-11-05 19:45 by Professor Bernd.
Posted by: pspad | Date: 2019-11-05 20:18 | IP: IP Logged
I understand. It's not possible from the script for now.
I will add function to set this line from the script.
Posted by: pspad | Date: 2019-11-05 20:36 | IP: IP Logged
in next build will be new editor function:
markEditorLine(integer)
with same visual result as click in the log - it will coloring line sent as parameter
Posted by: Professor Bernd | Date: 2019-11-05 20:38 | IP: IP Logged
That's totally great! This makes my VBScript code a lot faster, because it doesn't need an external script.
Thanks a lot!
Posted by: pspad | Date: 2019-11-05 20:49 | IP: IP Logged
I don't know if we understand each other.
This function will paint editor line background for line sent by parameter with LogParsColor.
Posted by: Professor Bernd | Date: 2019-11-05 21:13 | IP: IP Logged
pspad:in next build will be new editor function:
markEditorLine(integer)with same visual result as click in the log - it will coloring line sent as parameter
...
I don't know if we understand each other.
This function will paint editor line background for line sent by parameter with LogParsColor.
Thanks for asking, I was thinking about the same thing.
Is the highlighting removed automatically when you click in the editor window? Then everything is ok!
If you double-click in the log, the editor jumps to the error line and highlights it (red). If you then click into the editor, the line changes back to the normal color (light blue in standard settings).
Because there is no monitoring in VBScript, I can't determine if the editor window has been clicked. If the new function automatically changes to the normal color when you click into the editor, everything is fine.
Editor PSPad - freeware editor, © 2001 - 2023 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR