Don't touch &formatprg.

Makes sure that gq can always be used in its default fashion.
This commit is contained in:
Chiel ten Brinke 2016-03-10 17:18:15 +01:00
parent 36282560c3
commit 4ef9e937c0
2 changed files with 4 additions and 4 deletions

View File

@ -245,7 +245,7 @@ If you have any suggestions on this plugin or on this readme, if you have some n
* *Backward incompatible patch!* * *Backward incompatible patch!*
* Multiple formatters per filetype are now supported. * Multiple formatters per filetype are now supported.
* Configuration variable names changed. * Configuration variable names changed.
* `gq` is no longer supported. * Using `gq` as alias for `:Autoformat` is no longer supported.
* `:Autoformat` now suppports ranges. * `:Autoformat` now suppports ranges.
* Composite filetypes are fully supported. * Composite filetypes are fully supported.

View File

@ -97,7 +97,7 @@ function! s:TryAllFormatters(...) range
" Eval twice, once for getting definition content, " Eval twice, once for getting definition content,
" once for getting the final expression " once for getting the final expression
let &formatprg = eval(eval(formatdef_var)) let b:formatprg = eval(eval(formatdef_var))
" Detect if +python or +python3 is available, and call the corresponding function " Detect if +python or +python3 is available, and call the corresponding function
if !has("python") && !has("python3") if !has("python") && !has("python3")
@ -156,7 +156,7 @@ import vim, subprocess, os
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
text = os.linesep.join(vim.current.buffer[:]) + os.linesep text = os.linesep.join(vim.current.buffer[:]) + os.linesep
formatprg = vim.eval('&formatprg') formatprg = vim.eval('b:formatprg')
verbose = bool(int(vim.eval('verbose'))) verbose = bool(int(vim.eval('verbose')))
env = os.environ.copy() env = os.environ.copy()
if int(vim.eval('exists("g:formatterpath")')): if int(vim.eval('exists("g:formatterpath")')):
@ -204,7 +204,7 @@ import vim, subprocess, os
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
text = bytes(os.linesep.join(vim.current.buffer[:]) + os.linesep, 'utf-8') text = bytes(os.linesep.join(vim.current.buffer[:]) + os.linesep, 'utf-8')
formatprg = vim.eval('&formatprg') formatprg = vim.eval('b:formatprg')
verbose = bool(int(vim.eval('verbose'))) verbose = bool(int(vim.eval('verbose')))
env = os.environ.copy() env = os.environ.copy()
if int(vim.eval('exists("g:formatterpath")')): if int(vim.eval('exists("g:formatterpath")')):