We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ce4065 commit 04bb8bcCopy full SHA for 04bb8bc
src/prompt_toolkit/filters/app.py
@@ -20,6 +20,7 @@
20
"has_focus",
21
"buffer_has_focus",
22
"has_selection",
23
+ "has_suggestion",
24
"has_validation_error",
25
"is_done",
26
"is_read_only",
@@ -114,6 +115,15 @@ def has_selection() -> bool:
114
115
return bool(get_app().current_buffer.selection_state)
116
117
118
+@Condition
119
+def has_suggestion() -> bool:
120
+ """
121
+ Enable when the current buffer has a suggestion.
122
123
+ buffer = get_app().current_buffer
124
+ return buffer.suggestion is not None and buffer.suggestion.text != ""
125
+
126
127
@Condition
128
def has_completions() -> bool:
129
"""
0 commit comments