diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-09 15:31:04 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-03-09 15:31:04 +1100 |
| commit | d81454cd915a9786a3b8b9d38f0cf3f0e93d0b06 (patch) | |
| tree | 9d267e919c2a03c1270b0cca683b6e572287f51f | |
| parent | files: change directory monitor return (diff) | |
| download | caelestia-shell-d81454cd915a9786a3b8b9d38f0cf3f0e93d0b06.tar.gz caelestia-shell-d81454cd915a9786a3b8b9d38f0cf3f0e93d0b06.tar.bz2 caelestia-shell-d81454cd915a9786a3b8b9d38f0cf3f0e93d0b06.zip | |
launcher: fix actions not clearing in math mode
| -rw-r--r-- | src/modules/launcher/index.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/launcher/index.tsx b/src/modules/launcher/index.tsx index f3a1e53..3f8645e 100644 --- a/src/modules/launcher/index.tsx +++ b/src/modules/launcher/index.tsx @@ -22,7 +22,7 @@ const getPrettyMode = (mode: Mode) => { return mode; }; -const isAction = (text: string) => text.startsWith(config.actionPrefix.get()); +const isAction = (text: string, action: string = "") => text.startsWith(config.actionPrefix.get() + action); const SearchBar = ({ mode, entry }: { mode: Variable<Mode>; entry: Widget.Entry }) => ( <box className="search-bar"> @@ -127,7 +127,10 @@ export default class Launcher extends PopupWindow { }); // Clear search on hide if not in math mode or creating a todo - this.connect("hide", () => mode.get() !== "math" && !entry.text.startsWith(">todo") && entry.set_text("")); + this.connect("hide", () => { + if ((mode.get() !== "math" || isAction(entry.get_text())) && !isAction(entry.get_text(), "todo")) + entry.set_text(""); + }); } open(mode: Mode) { |