mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-11 03:13:47 -05:00
Use single quoted strings by default
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
if exists("autoloaded_pencil") | fini | en
|
if exists('autoloaded_pencil') | fini | en
|
||||||
let autoloaded_pencil = 1
|
let autoloaded_pencil = 1
|
||||||
|
|
||||||
let s:WRAP_MODE_DEFAULT = -1
|
let s:WRAP_MODE_DEFAULT = -1
|
||||||
@@ -49,9 +49,9 @@ endf
|
|||||||
|
|
||||||
fun! s:imap(preserve_completion, key, icmd) abort
|
fun! s:imap(preserve_completion, key, icmd) abort
|
||||||
if a:preserve_completion
|
if a:preserve_completion
|
||||||
exe ":ino <buffer> <silent> <expr> " . a:key . " pumvisible() ? \"" . a:key . "\" : \"" . a:icmd . "\""
|
exe ':ino <buffer> <silent> <expr> ' . a:key . " pumvisible() ? '" . a:key . "' : '" . a:icmd . "'"
|
||||||
el
|
el
|
||||||
exe ":ino <buffer> <silent> " . a:key . " " . a:icmd
|
exe ':ino <buffer> <silent> ' . a:key . ' ' . a:icmd
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ fun! pencil#setAutoFormat(af) abort
|
|||||||
sil! au! pencil_autoformat * <buffer>
|
sil! au! pencil_autoformat * <buffer>
|
||||||
if l:nu_af && !l:is_hard
|
if l:nu_af && !l:is_hard
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echo "autoformat can only be enabled in hard line break mode"
|
echo 'autoformat can only be enabled in hard line break mode'
|
||||||
echohl NONE
|
echohl NONE
|
||||||
return
|
return
|
||||||
en
|
en
|
||||||
@@ -195,7 +195,7 @@ fun! pencil#init(...) abort
|
|||||||
if !exists('b:pencil_wrap_mode')
|
if !exists('b:pencil_wrap_mode')
|
||||||
let b:pencil_wrap_mode = s:WRAP_MODE_OFF
|
let b:pencil_wrap_mode = s:WRAP_MODE_OFF
|
||||||
en
|
en
|
||||||
if !exists("b:max_textwidth")
|
if !exists('b:max_textwidth')
|
||||||
let b:max_textwidth = -1
|
let b:max_textwidth = -1
|
||||||
en
|
en
|
||||||
|
|
||||||
@@ -408,10 +408,10 @@ fun! pencil#init(...) abort
|
|||||||
en
|
en
|
||||||
|
|
||||||
if b:pencil_wrap_mode
|
if b:pencil_wrap_mode
|
||||||
exe 'nn <buffer> <silent> ' . Mapkey("j", "n") . ' gj'
|
exe 'nn <buffer> <silent> ' . Mapkey('j', 'n') . ' gj'
|
||||||
exe 'nn <buffer> <silent> ' . Mapkey("k", "n") . ' gk'
|
exe 'nn <buffer> <silent> ' . Mapkey('k', 'n') . ' gk'
|
||||||
exe 'vn <buffer> <silent> ' . Mapkey("j", "v") . ' gj'
|
exe 'vn <buffer> <silent> ' . Mapkey('j', 'v') . ' gj'
|
||||||
exe 'vn <buffer> <silent> ' . Mapkey("k", "v") . ' gk'
|
exe 'vn <buffer> <silent> ' . Mapkey('k', 'v') . ' gk'
|
||||||
no <buffer> <silent> <Up> gk
|
no <buffer> <silent> <Up> gk
|
||||||
no <buffer> <silent> <Down> gj
|
no <buffer> <silent> <Down> gj
|
||||||
nn <buffer> <silent> gj j
|
nn <buffer> <silent> gj j
|
||||||
@@ -507,16 +507,16 @@ endf
|
|||||||
" modeline(s) and max line length
|
" modeline(s) and max line length
|
||||||
" Hat tip to https://github.com/ciaranm/securemodelines
|
" Hat tip to https://github.com/ciaranm/securemodelines
|
||||||
fun! s:doModelines() abort
|
fun! s:doModelines() abort
|
||||||
if line("$") > &modelines
|
if line('$') > &modelines
|
||||||
let l:lines={ }
|
let l:lines={ }
|
||||||
call map(filter(getline(1, &modelines) +
|
call map(filter(getline(1, &modelines) +
|
||||||
\ getline(line("$") - &modelines, "$"),
|
\ getline(line('$') - &modelines, '$'),
|
||||||
\ 'v:val =~# ":"'), 'extend(l:lines, { v:val : 0 } )')
|
\ 'v:val =~# ":"'), 'extend(l:lines, { v:val : 0 } )')
|
||||||
for l:line in keys(l:lines)
|
for l:line in keys(l:lines)
|
||||||
call s:doModeline(l:line)
|
call s:doModeline(l:line)
|
||||||
endfo
|
endfo
|
||||||
el
|
el
|
||||||
for l:line in getline(1, "$")
|
for l:line in getline(1, '$')
|
||||||
call s:doModeline(l:line)
|
call s:doModeline(l:line)
|
||||||
endfo
|
endfo
|
||||||
en
|
en
|
||||||
|
|||||||
Reference in New Issue
Block a user