medley icon indicating copy to clipboard operation
medley copied to clipboard

TTY editor gets called again if SEDIT window is open

Open masinter opened this issue 4 years ago • 6 comments

maybe no one else uses the ttyeditor but for some things it's the only way. this is an odd little quirk which I want to fix. Basically, whenever you edit a function or variable in the ttyeditor, it calls the ttyeditor again. if ou do a backtrace you'll see the markaschanged on the stack. I think this is totell the SEDIT windows to refresh with new content.

masinter avatar Sep 16 '21 05:09 masinter

Wouldn't it be a bad thing if you did have an SEdit window open on the same thing you changed with the ttyeditor and SEdit wasn't told about the change? If you closed the SEdit window it might reinstall the old definition.

nbriggs avatar Sep 16 '21 05:09 nbriggs

image The problem happens when EDITMODE(TELETYPE) is set while you have SEDIT windows open. It calls EDITDEF in order to notify the SEDIT windows, but the EDITMODE means that doesn't work. Maybe just resetting EDITMODE for the duration if it isn't SEDIT:SEDIT?

masinter avatar Sep 16 '21 19:09 masinter

So this is the situation where you are editing two different things, one in TTYEDIT the other in multiple SEDIT windows (otherwise it wouldn't fall into the (GET-CONTEXT ...) case?) and when it's doing this MARKASCHANGEDFN in one SEdit, the attempt to EDITDEF the other(s) causes TTYEDIT to get invoked rather than SEDIT? If this code is really specific to SEDIT instances, should it be binding the editmode around the EDITDEF call?

nbriggs avatar Sep 16 '21 21:09 nbriggs

Maybe related:
. EDIT WHERE ANY CALLS xxx I think uses tty commands to drive down the SEDIT window for the function. But when you make an edit, the function doesn't get marked as changed. CLEANUP doesn't save the edits

rmkaplan avatar Oct 23 '21 04:10 rmkaplan

a separate issue. always? In both FNS and FUNCTIONS? (an example?)

masinter avatar Oct 23 '21 06:10 masinter

PR #912 patched the patch put in earlier.

masinter avatar Aug 25 '22 17:08 masinter