From 0e6f1183a9f1020c4a2dbc928c1d64c49ed785ed Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 23 Oct 2017 15:39:07 +0800 Subject: [PATCH 1/4] Add base64 api --- autoload/SpaceVim/api/data/base64.vim | 121 ++++++++++++++++++++++++++ test/api/data/base64.vader | 3 + 2 files changed, 124 insertions(+) create mode 100644 autoload/SpaceVim/api/data/base64.vim create mode 100644 test/api/data/base64.vader diff --git a/autoload/SpaceVim/api/data/base64.vim b/autoload/SpaceVim/api/data/base64.vim new file mode 100644 index 000000000..9e6f8c42a --- /dev/null +++ b/autoload/SpaceVim/api/data/base64.vim @@ -0,0 +1,121 @@ +let s:self = {} + + +if has('python') + function! s:self.encode(text) abort + py import vim + py import base64 + + py ret = base64.b64encode(vim.eval('a:text')) + py vim.command("return '{}'".format(ret)) + endfunction + " base64Test => YmFzZTY0VGVzdA== + +function! s:self.decode(text) abort +python < Date: Tue, 24 Oct 2017 22:57:50 +0800 Subject: [PATCH 2/4] Fix lint --- autoload/SpaceVim/api/data/base64.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/SpaceVim/api/data/base64.vim b/autoload/SpaceVim/api/data/base64.vim index 9e6f8c42a..d333cab75 100644 --- a/autoload/SpaceVim/api/data/base64.vim +++ b/autoload/SpaceVim/api/data/base64.vim @@ -2,6 +2,7 @@ let s:self = {} if has('python') + " @vimlint(EVL103, 1, a:text) function! s:self.encode(text) abort py import vim py import base64 @@ -24,6 +25,7 @@ except TypeError, e: vim.command("return '{}'".format(ret)) EOF endfunction + " @vimlint(EVL103, 0, a:text) else function! s:self.encode(data) abort let b64 = self._b64encode(self._str2bytes(a:data), self.standard_table, '=') From 99bfdb4670bd522d0413afb256d2d001c898c867 Mon Sep 17 00:00:00 2001 From: Bigo Date: Wed, 25 Oct 2017 16:28:20 +0100 Subject: [PATCH 3/4] Add statusline errors / warnings report for ale --- autoload/SpaceVim/layers/core/statusline.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index f299d65ce..4867f723b 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -125,6 +125,18 @@ if g:spacevim_enable_neomake let l .= errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors . ' ' : '' return l endfunction +elseif g:spacevim_enable_ale + function! s:syntax_checking() + if !exists('g:ale_enabled') + return '' + endif + let counts = ale#statusline#Count(bufnr('')) + let warnings = counts.warning + counts.style_warning + let errors = counts.error + counts.style_error + let l = warnings ? ' %#SpaceVim_statusline_warn#●' . warnings . ' ' : '' + let l .= errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors . ' ' : '' + return l + endfunction else function! s:syntax_checking() if !exists(':SyntasticCheck') From 698d2bfeafb2c2c9b29d638edc1d448e5961b12f Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Thu, 26 Oct 2017 01:49:53 +0900 Subject: [PATCH 4/4] Fixed ALE setting issues * Fixed an issue that ALE settings get loaded after ALE initialization. * Added linter info to error message by default. --- autoload/SpaceVim/layers/checkers.vim | 2 +- config/{plugins => plugins_before}/ale.vim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename config/{plugins => plugins_before}/ale.vim (83%) diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index 91d2dea71..877679f50 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -9,7 +9,7 @@ function! SpaceVim#layers#checkers#plugins() abort if g:spacevim_enable_neomake call add(plugins, ['neomake/neomake', {'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}]) elseif g:spacevim_enable_ale - call add(plugins, ['w0rp/ale', {'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}]) + call add(plugins, ['w0rp/ale', {'merged' : 0, 'loadconf_before' : 1}]) else call add(plugins, ['wsdjeg/syntastic', {'on_event': 'WinEnter', 'loadconf' : 1, 'merged' : 0}]) endif diff --git a/config/plugins/ale.vim b/config/plugins_before/ale.vim similarity index 83% rename from config/plugins/ale.vim rename to config/plugins_before/ale.vim index 19ddb8334..990fc57cb 100644 --- a/config/plugins/ale.vim +++ b/config/plugins_before/ale.vim @@ -1,6 +1,7 @@ scriptencoding utf-8 let g:ale_sign_error = get(g:, 'spacevim_error_symbol', '✖') let g:ale_sign_warning = get(g:,'spacevim_warning_symbol', '➤') +let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%severity%: %linter%: %s') if g:spacevim_colorscheme == 'gruvbox' highlight link ALEErrorSign GruvboxRedSign