From 90bc0fa572dff5a98e1a337defd1864a09ef9e64 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 20 Jan 2023 00:35:24 +0100 Subject: [PATCH] "preserve unchanged props" will be automatically checked when editing attributes on multiple object selection and unchecked on single object selection as this is the 99.9% use case --- src/editprop.c | 7 +++++++ src/save.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/editprop.c b/src/editprop.c index 5f17102a..73f77a21 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -1501,6 +1501,13 @@ void edit_property(int x) return; } /* if((xctx->lastsel==0 ) */ + /* set 'preserve unchanged properties if multiple selection */ + if(xctx->lastsel > 1) { + tclsetvar("preserve_unchanged_attrs", "1"); + } else { + tclsetvar("preserve_unchanged_attrs", "0"); + } + switch(xctx->sel_array[0].type) { case ELEMENT: diff --git a/src/save.c b/src/save.c index 47e818ae..7d72835b 100644 --- a/src/save.c +++ b/src/save.c @@ -124,7 +124,8 @@ int filter_data(const char *din, const size_t ilen, fprintf(stderr, "error: conversion failed\n"); ret = 1; } - _exit(ret); + _exit(ret); /* childs should always use _exit() to avoid + * flushing open stdio streams and other unwanted side effects */ } /* parent */ close(p1[0]); /*only write to p1 */