Mercurial > vim
comparison runtime/indent/sh.vim @ 12045:444ad56c0cac
Update runtime files.
commit https://github.com/vim/vim/commit/1ccd8fff8acfbd5df0fc0e9b4d288af84e51233e
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 11 19:50:37 2017 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 11 Aug 2017 20:00:05 +0200 |
parents | d183d629509e |
children | a9fdf01085a8 |
comparison
equal
deleted
inserted
replaced
12044:f07a8b5428f9 | 12045:444ad56c0cac |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: Shell Script | 2 " Language: Shell Script |
3 " Maintainer: Christian Brabandt <cb@256bit.org> | 3 " Maintainer: Christian Brabandt <cb@256bit.org> |
4 " Previous Maintainer: Peter Aronoff <telemachus@arpinum.org> | 4 " Previous Maintainer: Peter Aronoff <telemachus@arpinum.org> |
5 " Original Author: Nikolai Weibull <now@bitwi.se> | 5 " Original Author: Nikolai Weibull <now@bitwi.se> |
6 " Latest Revision: 2017-05-02 | 6 " Latest Revision: 2017-08-08 |
7 " License: Vim (see :h license) | 7 " License: Vim (see :h license) |
8 " Repository: https://github.com/chrisbra/vim-sh-indent | 8 " Repository: https://github.com/chrisbra/vim-sh-indent |
9 " Changelog: | 9 " Changelog: |
10 " 20170808: - better indent of line continuation | |
10 " 20170502: - get rid of buffer-shiftwidth function | 11 " 20170502: - get rid of buffer-shiftwidth function |
11 " 20160912: - preserve indentation of here-doc blocks | 12 " 20160912: - preserve indentation of here-doc blocks |
12 " 20160627: - detect heredocs correctly | 13 " 20160627: - detect heredocs correctly |
13 " 20160213: - detect function definition correctly | 14 " 20160213: - detect function definition correctly |
14 " 20160202: - use shiftwidth() function | 15 " 20160202: - use shiftwidth() function |
115 | 116 |
116 return ind | 117 return ind |
117 endfunction | 118 endfunction |
118 | 119 |
119 function! s:is_continuation_line(line) | 120 function! s:is_continuation_line(line) |
120 return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\)$' | 121 return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\||\)' . |
122 \ '\s*\({\s*\)\=\(#.*\)\=$' | |
121 endfunction | 123 endfunction |
122 | 124 |
123 function! s:find_continued_lnum(lnum) | 125 function! s:find_continued_lnum(lnum) |
124 let i = a:lnum | 126 let i = a:lnum |
125 while i > 1 && s:is_continuation_line(getline(i - 1)) | 127 while i > 1 && s:is_continuation_line(getline(i - 1)) |