factor icon indicating copy to clipboard operation
factor copied to clipboard

"Select an editor" popup is broken in some contexts

Open slavapestov opened this issue 14 years ago • 6 comments

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.

slavapestov avatar Aug 25 '11 06:08 slavapestov

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.

kenanb avatar Feb 09 '12 21:02 kenanb

Not a bug, thanks @kenanb!

mrjbq7 avatar Apr 27 '13 00:04 mrjbq7

So if it's not a bug, we can close this?

erg avatar Jul 08 '14 09:07 erg

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.

mrjbq7 avatar Jul 08 '14 13:07 mrjbq7

"press" [ "Select an editor" editor-restarts throw-restarts ] <border-button> gadget.

Buttons that start restarts don't work correctly.

erg avatar Jul 16 '14 20:07 erg

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.

erg avatar Jul 16 '14 20:07 erg