mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-13 20:33:46 -05:00
Use full option names instead of abreviations
This commit is contained in:
@@ -65,8 +65,8 @@ fun! s:maybe_enable_autoformat() abort
|
||||
return
|
||||
en
|
||||
|
||||
let l:ft = get(g:pencil#autoformat_aliases, &ft, &ft)
|
||||
let l:af_cfg = get(g:pencil#autoformat_config, l:ft, {})
|
||||
let l:filetype = get(g:pencil#autoformat_aliases, &filetype, &filetype)
|
||||
let l:af_cfg = get(g:pencil#autoformat_config, l:filetype, {})
|
||||
let l:black = get(l:af_cfg, 'black', [])
|
||||
let l:white = get(l:af_cfg, 'white', [])
|
||||
let l:has_black_re = len(l:black) > 0
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if exists('g:loaded_pencil') || &cp | fini | en
|
||||
if exists('g:loaded_pencil') || &compatible | fini | en
|
||||
let g:loaded_pencil = 1
|
||||
|
||||
" Save 'cpoptions' and set Vim default to enable line continuations.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
let s:save_cpoptions = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
let s:WRAP_MODE_DEFAULT = -1
|
||||
let s:WRAP_MODE_OFF = 0
|
||||
@@ -33,7 +33,7 @@ fun! PencilMode()
|
||||
if b:pencil_wrap_mode ==# s:WRAP_MODE_SOFT
|
||||
return get(g:pencil#mode_indicators, 'soft', 'S')
|
||||
elsei b:pencil_wrap_mode ==# s:WRAP_MODE_HARD
|
||||
if &fo =~# 'a'
|
||||
if &formatoptions =~# 'a'
|
||||
return get(g:pencil#mode_indicators, 'auto', 'A')
|
||||
el
|
||||
return get(g:pencil#mode_indicators, 'hard', 'H')
|
||||
@@ -205,7 +205,7 @@ if g:pencil#legacyCommands
|
||||
com -nargs=0 ShiftPencil call pencil#setAutoFormat(-1)
|
||||
en
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
let &cpoptions = s:save_cpoptions
|
||||
unlet s:save_cpoptions
|
||||
|
||||
" vim:ts=2:sw=2:sts=2
|
||||
|
||||
Reference in New Issue
Block a user