summaryrefslogtreecommitdiff
blob: 7ac062d8ad774eb282da688e95e57eb888893069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
--- plugin/vimspell.vim	2004-04-22 19:47:29.000000000 +0400
+++ plugin/vimspell.vim	2004-10-21 12:10:12.811142448 +0400
@@ -445,11 +445,15 @@ endfunction
 " Function: s:SpellVerifyLanguage(a:language) {{{2
 " Verify the availability of the language for the previously selected
 " spell checker.
 function! s:SpellVerifyLanguage(language)
   if  b:spell_executable == "ispell" || b:spell_executable == "aspell"
-    let l:dirs = system("echo word |". b:spell_executable ." -l -d". a:language )
+	if  b:spell_executable == "ispell"
+		let l:dirs = system("echo word |". b:spell_executable ." -l -d". a:language )
+	else
+		let l:dirs = system("echo word |". b:spell_executable ." -d". a:language . " list ")
+	endif
     if v:shell_error != 0
       echo "Language '". a:language ."' not known from ". b:spell_executable ."."
       return 1
     endif
   else
@@ -470,12 +474,17 @@ function! s:SpellGuessLanguage()
 
   let l:mlang=substitute(b:spell_internal_language_list,",.*","","")
 
   while matchstr(l:mlang,",") == "" 
 	\ && l:langnum <= s:SpellGetOption("spell_guess_max_languages",3)
-    let l:errors=system(b:spell_executable . b:spell_options . " -l -d " .
-	  \ l:mlang . " < " . escape(expand("%"),' \'))
+	if b:spell_executable == "ispell"
+		let l:errors=system(b:spell_executable . b:spell_options . " -l -d " .
+			\ l:mlang . " < " . escape(expand("%"),' \'))
+	else
+		let l:errors=system(b:spell_executable . b:spell_options . " -d " .
+			\ l:mlang . " list " . " < " . escape(expand("%"),' \'))
+	endif
     let l:errors=escape(l:errors,'"')
     let l:index=stridx(l:errors, "\n")
     let l:spellcount=0
     let l:errorcount=0
 
@@ -527,12 +536,13 @@ function! s:SpellGetDicoList()
     let l:dirfiles = substitute(l:dirfiles,"\.hash","","g")
     let l:dirfiles = substitute(l:dirfiles,"\n",",","g")
   elseif b:spell_executable == "aspell"
     " Thanks to Alexandre Beneteau <alexandre.beneteau@wanadoo.fr> for showing
     " me a way to get aspell directory for dictionaries.
-    let l:dirs = system('aspell config | '. s:grep . ' "dict-dir current"')
-    let l:dirs = substitute(l:dirs,'^.*dict-dir current: \(\/.*\)','\1',"")
+"    let l:dirs = system('aspell config | '. s:grep . ' "dict-dir current"')
+"    let l:dirs = substitute(l:dirs,'^.*dict-dir current: \(\/.*\)','\1',"")
+	let l:dirs = system('aspell config dict-dir')
     "don't know, why there is a <NUL> char at the end of line ? Get rid of it.
     let l:dirs = substitute(l:dirs,".$","","")
 
     let l:dirfiles = glob("`".s:find . l:dirs . s:findname . '"*.multi"' . s:findopt ."`")
     let l:dirfiles = substitute(l:dirfiles,"\/[^\n]*\/","","g")
@@ -743,10 +758,11 @@ endfunction
 "   1 if new document installed, 0 otherwise.
 " Note: Cleaned and generalized by guo-peng Wen
 "'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
 function! s:SpellInstallDocumentation(full_name, revision)
+    return 0
     " Name of the document path based on the system we use:
     if (has("unix"))
         " On UNIX like system, using forward slash:
         let l:slash_char = '/'
         let l:mkdir_cmd  = ':silent !mkdir -p '
@@ -895,15 +911,26 @@ function! s:SpellCheck()
   let b:spellerrors="nonexisitingwordinthisdociumnt\\"
   let b:spellcorrected="nonexisitingwordinthisdociumnt"
   let b:spellicorrected="nonexisitingwordinthisdociumnt"
 
   if exists("b:spell_filter") && b:spell_filter != ""
-    let l:errors=system('cat '. escape(l:filename,' \')."|".b:spell_filter_pipe 
-	  \. b:spell_executable . b:spell_options . " -l -d ".b:spell_language)
+	if b:spell_executable == "ispell"
+		let l:errors=system('cat '. escape(l:filename,' \')."|".b:spell_filter_pipe
+			\. b:spell_executable . b:spell_options . " -l -d ".b:spell_language)
+	else
+		let l:errors=system('cat '. escape(l:filename,' \')."|".b:spell_filter_pipe
+			\. b:spell_executable . b:spell_options . " -d ".b:spell_language
+			\. " list ")
+	endif
   else
-    let l:errors=system(b:spell_executable . b:spell_options
-	  \. " -l -d ".b:spell_language." < ".escape(l:filename,' \'))
+	if b:spell_executable == "ispell"
+		let l:errors=system(b:spell_executable . b:spell_options
+			\. " -l -d ".b:spell_language." < ".escape(l:filename,' \') )
+	else
+		let l:errors=system(b:spell_executable . b:spell_options
+			\. " -d ".b:spell_language." list "." < ".escape(l:filename,' \') )
+	endif
   endif
 
   let l:errors=escape(l:errors,'"')
   let l:index=stridx(l:errors, "\n")
   let l:spellcount=0
@@ -1015,12 +1042,17 @@ function! s:SpellCheckWindow()
     let b:spellerrors="nonexisitingwordinthisdociumnt\\"
     let b:spellcorrected="nonexisitingwordinthisdociumnt"
     let b:spellicorrected="nonexisitingwordinthisdociumnt"
   endif
 
-  let l:errors=system(b:spell_executable . b:spell_options
-	\ . " -l -d ".b:spell_language." < ".w:tempname)
+  if  b:spell_executable == "ispell"
+	let l:errors=system(b:spell_executable . b:spell_options
+		\ . " -l -d ".b:spell_language." < ".w:tempname)
+  else
+	let l:errors=system(b:spell_executable . b:spell_options
+		\ . " -d ".b:spell_language. " list " ." < ".w:tempname)
+  endif
   let l:errors=escape(l:errors,'"')
   let l:index=stridx(l:errors, "\n")
 
   while (l:index > 0)
     " use stridx/strpart instead of sustitude, because it is faster
@@ -1087,12 +1119,17 @@ function! s:SpellCheckLine()
     let b:spellerrors="nonexisitingwordinthisdociumnt\\"
     let b:spellcorrected="nonexisitingwordinthisdociumnt"
     let b:spellicorrected="nonexisitingwordinthisdociumnt"
   endif
 
-  let l:ispexpr = "echo \"".escape(getline('.'),'\"<>')."\"|".b:spell_filter_pipe
-	\ . b:spell_executable . b:spell_options . ' -l -d '.b:spell_language
+  if  b:spell_executable == "ispell"
+	let l:ispexpr = "echo \"".escape(getline('.'),'\"<>')."\"|".b:spell_filter_pipe
+		\ . b:spell_executable . b:spell_options . ' -l -d '.b:spell_language
+  else
+	let l:ispexpr = "echo \"".escape(getline('.'),'\"<>')."\"|".b:spell_filter_pipe
+		\ . b:spell_executable . b:spell_options . ' -d '.b:spell_language . " list "
+  endif
   let l:errors=system(l:ispexpr)
   let l:errors=escape(l:errors,'"')
   let l:index=stridx(l:errors, "\n")
 
   while (l:index > 0)