]> git.neil.brown.name Git - edlib.git/commitdiff
macro: don't walk up tree to "find" input.
authorNeilBrown <neil@brown.name>
Wed, 28 Jun 2023 06:52:35 +0000 (16:52 +1000)
committerNeilBrown <neil@brown.name>
Wed, 28 Jun 2023 07:51:41 +0000 (17:51 +1000)
We can send "Keystroke" to the focus and it will find the right target.
We don't need to "find" the target first.  Doing so is fragile.

Signed-off-by: NeilBrown <neil@brown.name>
python/lib-macro.py

index fb28821168254690bdeaacc1ae184bb13c6c98cd..87e4ca2a163995c90c01f1d177a1840d6f63dc25 100644 (file)
@@ -112,8 +112,6 @@ def play_macro(key, focus, num, str, **a):
         mac = focus.call("history:get-last", docname, num, ret='str')
     if not mac:
         return edlib.Efail
-    while focus.parent != focus.parent.parent:
-        focus = focus.parent
     keys = macro_split(mac)
     error = False
     i = 0