Never close last error Topic is solved
Never close last error
When an error happens debugger opens a window when i click reload or continue it doesn't close this window and i end up with a lot of useless debugging windows open.
Re: Never close last error
It is by design that Reload (regardless of how it is invoked) does not terminate the current instance. The new instance of the script terminates the old instance only if it loads successfully ...
However, this is not the Reload function.
Closing the dialog automatically is "useful" as a minor convenience, and perhaps to avoid confusing an old error with a new one. On the other hand, the details shown in an error dialog generally are useful, and having them taken away unexpectedly is definitely not useful.
If you have a run-time error dialog and no syntax errors have been added to the source code, reloading the script will indirectly cause the dialog to close. That being the case, there probably aren't many users who will click the button expecting the dialog to stay on the screen. I'd guess that there are more users who would prefer it to close. It isn't documented either way.
Although this isn't a bug, strictly speaking, I have decided to change the Reload button to unconditionally close the dialog in the next bug-fix release. If the dialog is displaying a run-time error and the script fails to reload, the old instance will stay running but the dialog will have closed.
... and the old instance has a main window by which to detect it.If the script cannot be reloaded -- perhaps because it has a syntax error -- the original instance of the script will continue running.
Source: Reload - Syntax & Usage | AutoHotkey v2
Previous instances of the script are identified by the same mechanism as for #SingleInstance, with the same limitations.
Source: Reload - Syntax & Usage | AutoHotkey v2
A script which has failed to load due to a syntax error does not have a main window, because it is not yet in a state where the window is useful and safe to use.Previous instances of the script are identified by searching for a main window
Source: #SingleInstance - Syntax & Usage | AutoHotkey v2
However, this is not the Reload function.
Closing the dialog automatically is "useful" as a minor convenience, and perhaps to avoid confusing an old error with a new one. On the other hand, the details shown in an error dialog generally are useful, and having them taken away unexpectedly is definitely not useful.
If you have a run-time error dialog and no syntax errors have been added to the source code, reloading the script will indirectly cause the dialog to close. That being the case, there probably aren't many users who will click the button expecting the dialog to stay on the screen. I'd guess that there are more users who would prefer it to close. It isn't documented either way.
Although this isn't a bug, strictly speaking, I have decided to change the Reload button to unconditionally close the dialog in the next bug-fix release. If the dialog is displaying a run-time error and the script fails to reload, the old instance will stay running but the dialog will have closed.
Re: Never close last error
The problem starts when the debugger keeps the same bug window and opens the same bug window multiple times (if you reload). I think we need 1 bug window at all times and when the script runs successfully close all debugging windows automatically (or have an option for that). You can look at my screenshot I have 4 windows with the same bug. Also I find annoying this 1 but it will disable all the warnings, I believe we need the option to disable specific window warnings for example Thanks for your time and for the amazing work you put on this all this years.
I place return in purpose so I can do some testing and i have this pop up all the time . It forces me to comment everything out so I don't have this window all the time. I know the option Code: Select all
#Warn All, Off
Code: Select all
#Warn return, Off
Re: Never close last error
What you describe is outside the scope of what a single instance of the program should do.
I think what you're referring to as "the debugger" doesn't exist. Each error dialog is standalone and manages itself only in response to your input. Each instance of the program shows a single (load-time) error or warning at a time, and is independent of all other instances, except with regard to Reload and #SingleInstance.
Editors such as VS Code (with thqby's extension) and SciTE4AutoHotkey can override the error-reporting behaviour. Personally I find the error dialog to be more useful than what VS Code prints, but at least error messages printed to the console don't need to be dismissed.
Anyway, I already said I would change the dialog behaviour, and I already made the change.
I think what you're referring to as "the debugger" doesn't exist. Each error dialog is standalone and manages itself only in response to your input. Each instance of the program shows a single (load-time) error or warning at a time, and is independent of all other instances, except with regard to Reload and #SingleInstance.
Editors such as VS Code (with thqby's extension) and SciTE4AutoHotkey can override the error-reporting behaviour. Personally I find the error dialog to be more useful than what VS Code prints, but at least error messages printed to the console don't need to be dismissed.
Anyway, I already said I would change the dialog behaviour, and I already made the change.
In AutoHotkey, most options are implemented by writing code. You already have multiple options: WinClose and GroupClose.when the script runs successfully close all debugging windows automatically (or have an option for that)
Re: Never close last error Topic is solved
v2.0.4 implements the change I mentioned.
Who is online
Users browsing this forum: No registered users and 6 guests