From 138ede7194061003dad31d0dac5d6cc09a279d26 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 26 Feb 2025 09:12:28 +0100 Subject: [PATCH] Fix #134092: Keymap Editor can add an extra . to the end of an attribute This happened for context attributes if already "complete" attributes were typed/pasted in. Reason is that this copies functionality from our intellisense codecompletion where this is expected behavior, for context attributes we cannot really use "tab" to expand, so it is less useful here. When confirming (with the additional "."), the keymap entry would be broken, so better solve in a way that we dont end up with those "." by removing it. NOTE: there might be ways to enhance the string-search behavior here (by properly supporting "tab-expanding"), but this is a bit out-of-scope for this bugfix. Pull Request: https://projects.blender.org/blender/blender/pulls/135098 --- scripts/startup/bl_operators/wm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index a8e5a9bcfa9..5bdbaa53e5d 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -46,7 +46,8 @@ def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs): ".bl_rna", ".rna_type", )): continue - attr_full = prefix + attr.lstrip() + # If we type/paste in complete attributes, intellisense expands with a ".", remove that again (see #134092) + attr_full = (prefix + attr.lstrip()).removesuffix(".") if attr_full in unique_attrs: continue unique_attrs.add(attr_full)