From c0da4dde30f1f1879a8cbbba1fecd179dc78f574 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 21 Sep 2013 10:32:54 +0200 Subject: [PATCH] When overriding a key, also adjust its number of levels. This gets rid of the age-old warning of the right Alt key being ONE_LEVEL but having two symbols assigned. Reducing the number of levels to that of the later definition takes away the cause of the warning. Signed-off-by: Benno Schulenberg --- symbols.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/symbols.c b/symbols.c index 5547999..d40f962 100644 --- a/symbols.c +++ b/symbols.c @@ -339,18 +339,19 @@ MergeKeyGroups(SymbolsInfo * info, clobber = (from->defs.merge != MergeAugment); report = (warningLevel > 9) || ((into->defs.fileID == from->defs.fileID) && (warningLevel > 0)); - if (into->numLevels[group] >= from->numLevels[group]) - { - resultSyms = into->syms[group]; - resultActs = into->acts[group]; - resultWidth = into->numLevels[group]; - } - else + if ((from->numLevels[group] > into->numLevels[group]) + || (from->defs.merge == MergeOverride)) { resultSyms = from->syms[group]; resultActs = from->acts[group]; resultWidth = from->numLevels[group]; } + else + { + resultSyms = into->syms[group]; + resultActs = into->acts[group]; + resultWidth = into->numLevels[group]; + } if (resultSyms == NULL) { resultSyms = uTypedCalloc(resultWidth, KeySym);