Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _value



I wrote _value to complete values for parameter assignments.

And I found a problem with this.  When I try the completion by _value
first time, it is failed and "funcstack wrapper with wrong function"
is displayed.  Since second time, there is no problem.

Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% compconf group_matches=yes message_format='%d' description_format='%d'
is27e1u11% compconf describe_options=yes describe_values=yes option_prefix=yes
is27e1u11% A=<TAB>

->

is27e1u11% A=funcstack wrapper with wrong function

--- /dev/null	Tue Nov  2 21:12:50 1999
+++ Completion/Base/_value	Tue Nov  2 16:05:52 1999
@@ -0,0 +1,31 @@
+#compdef -value-
+
+_value () {
+  #_view_completion_parameters
+  if (( $+functions[_value:$compstate[parameter]] )); then
+    "_value:$compstate[parameter]" "$@"
+  else
+    _default
+  fi
+}
+
+_value:CPPFLAGS () {
+  compset -q
+  if compset -P '-I'; then
+    _files -/ "$@"
+  else
+    _default "$@"
+  fi
+}
+
+_value:LDFLAGS () {
+  compset -q
+  if compset -P '-L'; then
+    _files -/ "$@"
+  elif compset -P '-R'; then
+    compset -P '*:'
+    _files -/ -S/ -r ' :' "$@"
+  else
+    _default "$@"
+  fi
+}
-- 
Tanaka Akira



Messages sorted by: Reverse Date, Date, Thread, Author