1 parent a6d6a17 commit 41c9c54Copy full SHA for 41c9c54
1 file changed
scripts/bash-ghost-text
@@ -81,6 +81,12 @@ _ghost_validate_command() {
81
[[ -z "$first_word" ]] && return 0
82
[[ "$first_word" == *"="* ]] && return 0
83
84
+ # Skip validation if it's a function declaration (word followed by parentheses)
85
+ # Examples: test(), my_func(), func_name()
86
+ if [[ "$first_word" =~ ^[a-zA-Z_][a-zA-Z0-9_]*\(\)$ ]]; then
87
+ return 0
88
+ fi
89
+
90
# Expand tilde (~) to $HOME for path validation
91
local expanded_word="$first_word"
92
if [[ "$first_word" == "~"* ]]; then
@@ -133,6 +139,7 @@ _ghost_validate_command() {
133
139
# Invalid command
134
140
return 1
135
141
}
142
136
143
# Notify if the accepted line contains an invalid command
137
144
_ghost_validate_and_notify() {
138
145
local full_line="$1"
0 commit comments