Mitigate problems caused by default json syntax concealing quotes (#240)

* Respect original values of 'concealcursor' and 'conceallevel', so
  when user disables indentLine - quotes in JSON are back.
* Mention this problem in FAQ to save time.
This commit is contained in:
Michael Lutsiuk
2018-04-15 07:48:08 +03:00
committed by Yggdroot
parent 7a7e368205
commit 02b31cd3af
2 changed files with 17 additions and 2 deletions

View File

@@ -85,13 +85,23 @@ function! s:SetConcealOption()
if !g:indentLine_setConceal
return
endif
if !exists("b:indentLine_ConcealOptionSet")
if !(exists("b:indentLine_ConcealOptionSet") && b:indentLine_ConcealOptionSet)
let b:indentLine_ConcealOptionSet = 1
let b:indentLine_original_concealcursor = &l:concealcursor
let b:indentLine_original_conceallevel = &l:conceallevel
let &l:concealcursor = exists("g:indentLine_concealcursor") ? g:indentLine_concealcursor : "inc"
let &l:conceallevel = exists("g:indentLine_conceallevel") ? g:indentLine_conceallevel : "2"
endif
endfunction
function! s:ResetConcealOption()
if exists("b:indentLine_ConcealOptionSet") && b:indentLine_ConcealOptionSet
let &l:concealcursor = b:indentLine_original_concealcursor
let &l:conceallevel = b:indentLine_original_conceallevel
let b:indentLine_ConcealOptionSet = 0
endif
endfunction
"{{{1 function! s:IndentLinesEnable()
function! s:IndentLinesEnable()
if g:indentLine_newVersion
@@ -162,6 +172,7 @@ function! s:IndentLinesDisable()
let w:indentLine_indentLineId = []
endif
call s:ResetConcealOption()
return
endif

View File

@@ -180,11 +180,15 @@ COMMANDS *indentLine-commands*
==============================================================================
FAQ *indentLine-faq*
Q. How can I make the indent line visuall similar to the line used in Sublime
Q. How can I make the indent line visual similar to the line used in Sublime
Text 2?
A. Use let g:indentLine_char = '┊'
Q. I don't see quotes in JSON.
A. Use let g:vim_json_syntax_conceal = 0 or run :IndentLinesDisable
==============================================================================
CHANGELOG *indentLine-changelog*