|
73 | 73 |
|
74 | 74 | " }}}1 |
75 | 75 |
|
| 76 | +" Constants {{{1 |
| 77 | + |
| 78 | +let s:_FILE_SHORTCUTS = { |
| 79 | + \ '%FILE_PATH%': '%:p', |
| 80 | + \ '%FILE_NAME%': '%:t', |
| 81 | + \ '%FILE_DIR%': '%:p:h', |
| 82 | + \ } |
| 83 | +lockvar! s:_FILE_SHORTCUTS |
| 84 | + |
| 85 | +" }}}1 |
| 86 | + |
76 | 87 | command! SyntasticJavacEditClasspath call s:EditClasspath() |
77 | 88 |
|
78 | 89 | if g:syntastic_java_javac_config_file_enabled |
@@ -131,10 +142,8 @@ function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1 |
131 | 142 | if g:syntastic_java_javac_custom_classpath_command !=# '' |
132 | 143 | " Pre-process the classpath command string a little. |
133 | 144 | let classpath_command = g:syntastic_java_javac_custom_classpath_command |
134 | | - for sub in [['\V%FILE_PATH%', expand('%:p')], |
135 | | - \ ['\V%FILE_NAME%', expand('%:t')], |
136 | | - \ ['\V%FILE_DIR%', expand('%:p:h')]] |
137 | | - let classpath_command = substitute(classpath_command, sub[0], syntastic#util#shescape(sub[1]), 'g') |
| 145 | + for [key, val] in items(s:_FILE_SHORTCUTS) |
| 146 | + let classpath_command = substitute(classpath_command, '\V' . key, syntastic#util#shexpand(val), 'g') |
138 | 147 | endfor |
139 | 148 | let lines = syntastic#util#system(classpath_command) |
140 | 149 | if syntastic#util#isRunningWindows() || has('win32unix') |
|
0 commit comments