summaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/elm/util.vim8
-rw-r--r--autoload/go/config.vim6
-rw-r--r--autoload/racket.vim7
-rw-r--r--autoload/rustfmt.vim10
-rw-r--r--autoload/scss_indent.vim41
5 files changed, 20 insertions, 52 deletions
diff --git a/autoload/elm/util.vim b/autoload/elm/util.vim
index aee823c5..6d1014e0 100644
--- a/autoload/elm/util.vim
+++ b/autoload/elm/util.vim
@@ -136,7 +136,13 @@ function! elm#util#GoToModule(name)
endfunction
function! s:findLocalModule(rel_path, root)
- let l:package_json = a:root . '/elm-package.json'
+ let l:old_match = findfile('elm-package.json', a:root . ';')
+ let l:new_match = findfile('elm.json', a:root . ';')
+ if !empty(l:new_match)
+ let l:package_json = l:new_match
+ elseif !empty(l:old_match)
+ let l:package_json = l:old_match
+ endif
if exists('*json_decode')
let l:package = json_decode(readfile(l:package_json))
let l:source_roots = l:package['source-directories']
diff --git a/autoload/go/config.vim b/autoload/go/config.vim
index 7c840c53..4a9c149a 100644
--- a/autoload/go/config.vim
+++ b/autoload/go/config.vim
@@ -52,7 +52,7 @@ function! go#config#TermMode() abort
endfunction
function! go#config#TermEnabled() abort
- return get(g:, 'go_term_enabled', 0)
+ return has('nvim') && get(g:, 'go_term_enabled', 0)
endfunction
function! go#config#SetTermEnabled(value) abort
@@ -214,6 +214,10 @@ function! go#config#DebugCommands() abort
return g:go_debug_commands
endfunction
+function! go#config#DebugLogOutput() abort
+ return get(g:, 'go_debug_log_output', 'debugger, rpc')
+endfunction
+
function! go#config#LspLog() abort
" make sure g:go_lsp_log is set so that it can be added to easily.
let g:go_lsp_log = get(g:, 'go_lsp_log', [])
diff --git a/autoload/racket.vim b/autoload/racket.vim
deleted file mode 100644
index 08e0d31f..00000000
--- a/autoload/racket.vim
+++ /dev/null
@@ -1,7 +0,0 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'racket') != -1
- finish
-endif
-
-if !exists("g:raco_command")
- let g:raco_command = system("which raco")
-endif
diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim
index 96fffb26..908eb325 100644
--- a/autoload/rustfmt.vim
+++ b/autoload/rustfmt.vim
@@ -149,6 +149,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
call delete(l:stderr_tmpname)
+ let l:open_lwindow = 0
if v:shell_error == 0
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
@@ -169,7 +170,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
- lwindow
+ let l:open_lwindow = 1
endif
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
" otherwise get the errors and put them in the location list
@@ -201,7 +202,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
endif
let s:got_fmt_error = 1
- lwindow
+ let l:open_lwindow = 1
endif
" Restore the current directory if needed
@@ -213,6 +214,11 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
endif
endif
+ " Open lwindow after we have changed back to the previous directory
+ if l:open_lwindow == 1
+ lwindow
+ endif
+
silent! loadview
endfunction
diff --git a/autoload/scss_indent.vim b/autoload/scss_indent.vim
deleted file mode 100644
index 27caa780..00000000
--- a/autoload/scss_indent.vim
+++ /dev/null
@@ -1,41 +0,0 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1
- finish
-endif
-
-" usage:
-" set indentexpr=scss_indent#GetIndent(v:lnum)
-fun! scss_indent#GetIndent(lnum)
- " { -> increase indent
- " } -> decrease indent
- if a:lnum == 1
- " start at 0 indentation
- return 0
- endif
-
- " try to find last line ending with { or }
- " ignoring // comments
- let regex = '\([{}]\)\%(\/\/.*\)\?$'
- let nr = search(regex, 'bnW')
- if nr > 0
- let last = indent(nr)
- let m = matchlist(getline(nr), regex)
- let m_curr = matchlist(getline(a:lnum), regex)
- echoe string(m).string(m_curr)
- if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
- " last was open, current is close, use same indent
- return last
- elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
- " } line and last line was }: decrease
- return last - &sw
- endif
- if m[1] == '{'
- " line after {: increase indent
- return last + &sw
- else
- " line after } or { - same indent
- return last
- endif
- else
- return 0
- endif
-endfun