when in `persistent command` wire or line placement mode, a first escape clear the ongoing placement, a second escape clears the wiring or line-ing command

This commit is contained in:
stefan schippers 2023-12-01 23:05:07 +01:00
parent b9ef032a2a
commit a797bc593f
2 changed files with 13 additions and 3 deletions

View File

@ -99,15 +99,22 @@ void abort_operation(void)
{
xctx->no_draw = 0;
tcleval("set constrained_move 0" );
dbg(1, "abort_operation(): Escape: ui_state=%d, last_command=%d\n", xctx->ui_state, xctx->last_command);
constrained_move=0;
if(xctx->last_command && xctx->ui_state & (STARTWIRE | STARTLINE)) {
if(xctx->ui_state & STARTWIRE) new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
if(xctx->ui_state & STARTLINE) new_line(RUBBER|CLEAR);
if(tclgetboolvar("draw_crosshair")) draw_crosshair(2);
xctx->ui_state = 0;
return;
}
xctx->last_command=0;
xctx->manhattan_lines = 0;
dbg(1, "abort_operation(): Escape: ui_state=%d\n", xctx->ui_state);
if(xctx->ui_state & STARTMOVE)
{
int save;
move_objects(ABORT,0,0,0);
if(xctx->ui_state & (START_SYMPIN | PLACE_SYMBOL | PLACE_TEXT)) {
int save;
save = xctx->modified;
delete(1/* to_push_undo */);
set_modify(save); /* aborted placement: no change, so reset modify flag set by delete() */

View File

@ -100,7 +100,10 @@
# set netlist_dir $env(HOME)/.xschem/simulations
#### if this is set to '1' netlists and simulations will go into a simulation/ folder
#### inside the directory containing the top level schematic. Default: not set (0)
#### inside the directory containing the top level schematic.
#### if this is set to '2' netlists and simulations will go into a simulation/[schname]/ folder
#### inside the directory containing the top level schematic.
#### Default: not set (0).
# set local_netlist_dir 1
###########################################################################