mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 04:34:26 +08:00
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:
committed by
Yggdroot
parent
7a7e368205
commit
02b31cd3af
@@ -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
|
||||
|
||||
|
||||
@@ -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*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user