On 1/22/23 10:36, racoon wrote:
On 2023-01-22 13:44, Daniel wrote:
On 2023-01-22 10:25, Evan Langlois wrote:
Is there some way to reconfigure LyX to not have ESC cancel a dialog
or at least ask me first? I tried to remove the keybinding for esc in
the preferences, but that didn't help. The issue is that I use vi, so
when editing the preamble my hand just hits the esc key to save out of
habit. All my changes are then gone without a "Hey you changed stuff!
Are you sure?"
I don't think there is a way. And I am not sure it is a common enough
case to allow for a preference or so.
But it sounds like you would be satisfied with LyX asking whether to
discard changes made to the preamble before cancelling the dialog. I
think that is generally a good idea. After all, it is like editing your
document where we also don't just let the user close the window without
asking.
Daniel
Attached is a simple patch that avoids the dialog being closed when the
Esc key is pressed. The patch presupposes the source code patch to
ticket #12577 (https://www.lyx.org/trac/ticket/12577).
As suggested above, at least additionally, there should also be a
warning when source codes where changed whether the dialog should be
closed. But that is not implemented with this patch.
Probalby the better solution is the other one you mentioned: If there
are changes, do not close without asking first. This could be
implemented quite generally, I suspect, though the GuiDialog class (and
whatever one is the other one---remember we have two parallel dialog
classes for no terribly good reason).
Riki
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel