mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 20:54:26 +08:00
fix issue #102
This commit is contained in:
@@ -64,8 +64,20 @@ function! s:InitColor()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"{{{1 function! s:SetConcealOption()
|
||||
function! s:SetConcealOption()
|
||||
if ! exists("b:indentLine_ConcealOptionSet")
|
||||
let b:indentLine_ConcealOptionSet = 1
|
||||
if ! exists("g:indentLine_noConcealCursor")
|
||||
setlocal concealcursor=inc
|
||||
endif
|
||||
setlocal conceallevel=2
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"{{{1 function! s:SetIndentLine()
|
||||
function! s:SetIndentLine()
|
||||
call s:SetConcealOption()
|
||||
let b:indentLine_enabled = 1
|
||||
let space = &l:shiftwidth is 0 ? &l:tabstop : &l:shiftwidth
|
||||
|
||||
@@ -91,7 +103,7 @@ function! s:ResetWidth(...)
|
||||
let &l:shiftwidth = a:1
|
||||
endif
|
||||
|
||||
if b:indentLine_enabled
|
||||
if exists("b:indentLine_enabled") && b:indentLine_enabled
|
||||
syntax clear IndentLine
|
||||
endif
|
||||
call s:SetIndentLine()
|
||||
@@ -104,7 +116,7 @@ endfunction
|
||||
|
||||
"{{{1 function! s:IndentLinesDisable()
|
||||
function! s:IndentLinesDisable()
|
||||
if b:indentLine_enabled
|
||||
if exists("b:indentLine_enabled") && b:indentLine_enabled
|
||||
let b:indentLine_enabled = 0
|
||||
syntax clear IndentLine
|
||||
endif
|
||||
@@ -112,7 +124,7 @@ endfunction
|
||||
|
||||
"{{{1 function! s:IndentLinesToggle()
|
||||
function! s:IndentLinesToggle()
|
||||
if b:indentLine_enabled
|
||||
if exists("b:indentLine_enabled") && b:indentLine_enabled
|
||||
call s:IndentLinesDisable()
|
||||
else
|
||||
call s:IndentLinesEnable()
|
||||
@@ -143,11 +155,6 @@ function! s:Setup()
|
||||
return
|
||||
endif
|
||||
|
||||
if ! exists("g:indentLine_noConcealCursor")
|
||||
setlocal concealcursor=inc
|
||||
endif
|
||||
setlocal conceallevel=2
|
||||
|
||||
if &filetype is# ""
|
||||
call s:InitColor()
|
||||
endif
|
||||
@@ -171,6 +178,7 @@ endfunction
|
||||
|
||||
"{{{1 function! s:LeadingSpaceEnable()
|
||||
function! s:LeadingSpaceEnable()
|
||||
call s:SetConcealOption()
|
||||
if g:indentLine_faster
|
||||
echoerr 'LeadingSpace can not be shown when g:indentLine_faster == 1'
|
||||
return
|
||||
@@ -181,7 +189,7 @@ endfunction
|
||||
|
||||
"{{{1 function! s:LeadingSpaceDisable()
|
||||
function! s:LeadingSpaceDisable()
|
||||
if b:indentLine_leadingSpaceEnabled
|
||||
if exists("b:indentLine_leadingSpaceEnabled") && b:indentLine_leadingSpaceEnabled
|
||||
let b:indentLine_leadingSpaceEnabled = 0
|
||||
syntax clear IndentLineLeadingSpace
|
||||
endif
|
||||
@@ -189,7 +197,7 @@ endfunction
|
||||
|
||||
"{{{1 function! s:LeadingSpaceToggle()
|
||||
function! s:LeadingSpaceToggle()
|
||||
if b:indentLine_leadingSpaceEnabled
|
||||
if exists("b:indentLine_leadingSpaceEnabled") && b:indentLine_leadingSpaceEnabled
|
||||
call s:LeadingSpaceDisable()
|
||||
else
|
||||
call s:LeadingSpaceEnable()
|
||||
|
||||
Reference in New Issue
Block a user