comparison runtime/indent/json.vim @ 11518:63b0b7b79b25

Update runtime files. commit https://github.com/vim/vim/commit/3ec574f2b549f456f664f689d6da36dc5719aeb9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 13 18:12:01 2017 +0200 Update runtime files. Includes changing &sw to shiftwidth() for all indent scripts.
author Christian Brabandt <cb@256bit.org>
date Tue, 13 Jun 2017 18:15:04 +0200
parents 6921742f396a
children d4c7b3e9cd17
comparison
equal deleted inserted replaced
11517:01330ca5f7f8 11518:63b0b7b79b25
1 " Vim indent file 1 " Vim indent file
2 " Language: JSON 2 " Language: JSON
3 " Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json 3 " Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
4 " Last Change: 2014 Aug 29 4 " Last Change: 2017 Jun 13
5 " https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c 5 " https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
6 " Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json 6 " Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
7 " Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe 7 " Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
8 " http://www.vim.org/scripts/script.php?script_id=2765 8 " http://www.vim.org/scripts/script.php?script_id=2765
9 9
139 let line = getline(lnum) 139 let line = getline(lnum)
140 let ind = indent(lnum) 140 let ind = indent(lnum)
141 141
142 " If the previous line ended with a block opening, add a level of indent. 142 " If the previous line ended with a block opening, add a level of indent.
143 " if s:Match(lnum, s:block_regex) 143 " if s:Match(lnum, s:block_regex)
144 " return indent(lnum) + &sw 144 " return indent(lnum) + shiftwidth()
145 " endif 145 " endif
146 146
147 " If the previous line contained an opening bracket, and we are still in it, 147 " If the previous line contained an opening bracket, and we are still in it,
148 " add indent depending on the bracket type. 148 " add indent depending on the bracket type.
149 if line =~ '[[({]' 149 if line =~ '[[({]'
150 let counts = s:LineHasOpeningBrackets(lnum) 150 let counts = s:LineHasOpeningBrackets(lnum)
151 if counts[0] == '1' || counts[1] == '1' || counts[2] == '1' 151 if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
152 return ind + &sw 152 return ind + shiftwidth()
153 else 153 else
154 call cursor(v:lnum, vcol) 154 call cursor(v:lnum, vcol)
155 end 155 end
156 endif 156 endif
157 157