summary refs log tree commit diff
path: root/Completion/Base/Widget
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Widget')
-rw-r--r--Completion/Base/Widget/_correct_word20
1 files changed, 20 insertions, 0 deletions
diff --git a/Completion/Base/Widget/_correct_word b/Completion/Base/Widget/_correct_word
new file mode 100644
index 000000000..11b37efb1
--- /dev/null
+++ b/Completion/Base/Widget/_correct_word
@@ -0,0 +1,20 @@
+#compdef -k complete-word \C-xc
+
+# Simple completion front-end implementing spelling correction.
+# The maximum number of errors is set quite high, and
+# the numeric prefix can be used to specify a different value.
+#
+# If configurations keys with the prefix `correctword_' are
+# given they override those starting with `correct_'.
+
+setopt localoptions ${_comp_options[@]}
+
+local curcontext="$curcontext"
+
+if [[ -z "$curcontext" ]]; then
+  curcontext="correct-word:::"
+else
+  curcontext="correct-word:${curcontext#*:}"
+fi
+
+_main_complete _correct