summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-05-08 15:56:37 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-05-08 15:56:37 +0000
commit705fd24fd5c64fcf0bd59c0cda29a2125d7199e3 (patch)
tree4ac67d6fd6a296492e1f4c6b3e1fe00311570591 /Src
parent3c04bfefdad1bb6d2d44b907ddafa5a32d5f7f79 (diff)
downloadzsh-705fd24fd5c64fcf0bd59c0cda29a2125d7199e3.tar.gz
zsh-705fd24fd5c64fcf0bd59c0cda29a2125d7199e3.tar.xz
zsh-705fd24fd5c64fcf0bd59c0cda29a2125d7199e3.zip
11044, 11260: DVORAK options for spell checking.
Diffstat (limited to 'Src')
-rw-r--r--Src/options.c1
-rw-r--r--Src/utils.c19
-rw-r--r--Src/zsh.h1
3 files changed, 20 insertions, 1 deletions
diff --git a/Src/options.c b/Src/options.c
index c68d58986..9125a2380 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -210,6 +210,7 @@ static struct optname optns[] = {
 {NULL, "promptvars",	      OPT_ALIAS, /* bash */	 PROMPTSUBST},
 {NULL, "stdin",		      OPT_ALIAS, /* ksh */	 SHINSTDIN},
 {NULL, "trackall",	      OPT_ALIAS, /* ksh */	 HASHCMDS},
+{NULL, "dvorak",	      0,			 DVORAK},
 {NULL, NULL, 0, 0}
 };
 
diff --git a/Src/utils.c b/Src/utils.c
index 416d0aeaf..e109d8ba5 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2127,7 +2127,7 @@ static int
 spdist(char *s, char *t, int thresh)
 {
     char *p, *q;
-    char *keymap =
+    const char qwertykeymap[] =
     "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\
 \t1234567890-=\t\
 \tqwertyuiop[]\t\
@@ -2139,6 +2139,23 @@ spdist(char *s, char *t, int thresh)
 \tASDFGHJKL:\"\n\t\
 \tZXCVBNM<>?\n\n\t\
 \n\n\n\n\n\n\n\n\n\n\n\n\n\n";
+    const char dvorakkeymap[] =
+    "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\
+\t1234567890[]\t\
+\t',.pyfgcrl/=\t\
+\taoeuidhtns-\n\t\
+\t;qjkxbmwvz\t\t\t\
+\n\n\n\n\n\n\n\n\n\n\n\n\n\n\
+\t!@#$%^&*(){}\t\
+\t\"<>PYFGCRL?+\t\
+\tAOEUIDHTNS_\n\t\
+\t:QJKXBMWVZ\n\n\t\
+\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
+    const char *keymap;
+    if ( isset( DVORAK ) )
+      keymap = dvorakkeymap;
+    else
+      keymap = qwertykeymap;
 
     if (!strcmp(s, t))
 	return 0;
diff --git a/Src/zsh.h b/Src/zsh.h
index 585e94e59..dec00c9e7 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1431,6 +1431,7 @@ enum {
     VERBOSE,
     XTRACE,
     USEZLE,
+    DVORAK,
     OPT_SIZE
 };