From c525db8cb4088d02448c5ddcf4a80ffa028c3181 Mon Sep 17 00:00:00 2001 From: aiotter Date: Fri, 17 Apr 2020 16:26:08 +0900 Subject: [PATCH] Swap substitution order for echoed message This prevents 'code' string in liter_name to be substituted by accident. Linters including pycodestyle have been affected by this problem. --- autoload/ale.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/ale.vim b/autoload/ale.vim index ee1a0d54..01e17b15 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -258,9 +258,9 @@ function! ale#GetLocItemMessage(item, format_string) abort " Replace special markers with certain information. " \=l:variable is used to avoid escaping issues. + let l:msg = substitute(l:msg, '\v\%([^\%]*)code([^\%]*)\%', l:code_repl, 'g') let l:msg = substitute(l:msg, '\V%severity%', '\=l:severity', 'g') let l:msg = substitute(l:msg, '\V%linter%', '\=l:linter_name', 'g') - let l:msg = substitute(l:msg, '\v\%([^\%]*)code([^\%]*)\%', l:code_repl, 'g') " Replace %s with the text. let l:msg = substitute(l:msg, '\V%s', '\=a:item.text', 'g')