factor
factor copied to clipboard
"Select an editor" popup is broken in some contexts
When you invoke 'edit' in the listener, the list of restarts appears and it works. But if you click 'Edit' in the error list, there's no list of restarts.
i am quite sure this is not a bug. whether the edit button on error dialog shows the editor restarts or not depends on the error, if the error is in a source file, it actually shows the restarts, if the error is something like a data stack overflow caused by the user in the listener, the edit button does nothing, because there is nothing to edit.
i tested it like this:
edit some source file so it errors on load, try USEing it, press edit button when it errors, and editor restarts actually show up.
USING: accessors editors ;
IN: ui.tools.debugger
: com-edit ( debugger -- ) error>> edit-error ;
USING: kernel source-files.errors ;
IN: editors
: edit-error ( error -- )
[ error-file ] [ error-line ] bi over
[ 1 or edit-location ] [ 2drop ] if ;
so edit-error actually checks if there is a file associated with the error, if there is, it calls edit-location, if not, just drops error-file and error-line, doing nothing.
Not a bug, thanks @kenanb!
So if it's not a bug, we can close this?
Okay, figured it out - something is still a bug.
First, you can't have USEd any editors. So make sure your factor-rc or factor-boot-rc don't USE: editors.whatever.
Next, make a small error in some vocab on disk.
Next, reload, then F3 to look at error list, then click edit.
The error dialog pops up with "Select an editor" and no way to select an editor.
"press" [ "Select an editor" editor-restarts throw-restarts ] <border-button> gadget.
Buttons that start restarts don't work correctly.
The error is a condition
: debugger-window ( error continuation -- )
#! No restarts for the debugger window
f f <debugger> "Error" open-status-window ;
Since a restart ends the current continuation, using restarts here would kill the event loop. I think it's ok to just ignore this til we rewrite the UI. Someday. Maybe.