You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a potential indentation issue in the documentation for ConditionalKeyBindings:
The bindings = ConditionalKeyBindings(...) line appears to be indented under the is_active() function. This could confuse readers, as it implies the line is part of the function, which would result in it not being executed after the return statement.
Here’s the snippet in question (with the indentation issue):
from prompt_toolkit.key_binding import ConditionalKeyBindings
@Condition
def is_active():
" Only activate key binding on the second half of each minute. "
return datetime.datetime.now().second > 30
bindings = ConditionalKeyBindings(
key_bindings=my_bindings,
filter=is_active)
This would lead to the bindings = ... line not being executed. I believe the bindings = ... line should be outside the function like this:
@Condition
def is_active():
"Only activate key binding on the second half of each minute."
return datetime.datetime.now().second > 30
bindings = ConditionalKeyBindings(
key_bindings=my_bindings,
filter=is_active
)
Could you please confirm if this is indeed an error?
Thank you for your hard work on this fantastic library! 🙏
Best,
Joe
The text was updated successfully, but these errors were encountered:
Hi,
I noticed a potential indentation issue in the documentation for ConditionalKeyBindings:
The
bindings = ConditionalKeyBindings(...)
line appears to be indented under the is_active() function. This could confuse readers, as it implies the line is part of the function, which would result in it not being executed after the return statement.Here’s the snippet in question (with the indentation issue):
This would lead to the
bindings = ...
line not being executed. I believe thebindings = ...
line should be outside the function like this:Could you please confirm if this is indeed an error?
Thank you for your hard work on this fantastic library! 🙏
Best,
Joe
The text was updated successfully, but these errors were encountered: