diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-23 13:56:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-23 13:56:35 +0100 |
commit | 4072ba571babd733d1800c082416fe8fe3c28ed7 (patch) | |
tree | 398563288ba4d793e4f2e6d819f292ff4bba2754 /runtime/ftplugin | |
parent | 9f63a65f22b6a899925ba15adbb711e86251114e (diff) | |
download | vim-git-4072ba571babd733d1800c082416fe8fe3c28ed7.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/css.vim | 5 | ||||
-rw-r--r-- | runtime/ftplugin/spec.vim | 36 |
2 files changed, 21 insertions, 20 deletions
diff --git a/runtime/ftplugin/css.vim b/runtime/ftplugin/css.vim index 33fcee31c..ece2def4e 100644 --- a/runtime/ftplugin/css.vim +++ b/runtime/ftplugin/css.vim @@ -2,7 +2,7 @@ " Language: CSS " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Last Change: 2020 Dec 21 if exists("b:did_ftplugin") finish @@ -12,11 +12,12 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl com< cms< inc< fo< ofu<" +let b:undo_ftplugin = "setl com< cms< inc< fo< ofu< isk<" setlocal comments=s1:/*,mb:*,ex:*/ commentstring& setlocal formatoptions-=t formatoptions+=croql setlocal omnifunc=csscomplete#CompleteCSS +setlocal iskeyword+=- let &l:include = '^\s*@import\s\+\%(url(\)\=' diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index 2b33bc81a..ce00021a6 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -73,23 +73,23 @@ if !exists("*s:SpecChangelog") let chgline = -1 while (line <= line("$")) let linestr = getline(line) - if (name == "" && linestr =~? '^Name:') + if name == "" && linestr =~? '^Name:' let nameline = line let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','') - elseif (ver == "" && linestr =~? '^Version:') + elseif ver == "" && linestr =~? '^Version:' let verline = line let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') - elseif (rel == "" && linestr =~? '^Release:') + elseif rel == "" && linestr =~? '^Release:' let relline = line let rel = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') - elseif (linestr =~? '^%changelog') + elseif linestr =~? '^%changelog' let chgline = line execute line break endif let line = line+1 endwhile - if (nameline != -1 && verline != -1 && relline != -1) + if nameline != -1 && verline != -1 && relline != -1 let include_release_info = exists("g:spec_chglog_release_info") let name = s:ParseRpmVars(name, nameline) let ver = s:ParseRpmVars(ver, verline) @@ -100,20 +100,20 @@ if !exists("*s:SpecChangelog") call s:GetRelVer() - if (chgline == -1) + if chgline == -1 let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3) - if (option == 1) + if option == 1 call append(line("$"),"") call append(line("$"),"%changelog") execute line("$") let chgline = line(".") - elseif (option == 2) + elseif option == 2 call append(line("."),"%changelog") normal j - chgline = line(".") + let chgline = line(".") endif endif - if (chgline != -1) + if chgline != -1 let tmptime = v:lc_time language time C let parsed_format = "* ".strftime(format)." - ".ver."-".rel @@ -122,16 +122,16 @@ if !exists("*s:SpecChangelog") let wrong_format = 0 let wrong_release = 0 let insert_line = 0 - if (getline(chgline+1) != parsed_format) + if getline(chgline+1) != parsed_format let wrong_format = 1 endif - if (include_release_info && getline(chgline+2) != release_info) + if include_release_info && getline(chgline+2) != release_info let wrong_release = 1 endif - if (wrong_format || wrong_release) - if (include_release_info && !wrong_release && !exists("g:spec_chglog_never_increase_release")) + if wrong_format || wrong_release + if include_release_info && !wrong_release && !exists("g:spec_chglog_never_increase_release") let option = confirm("Increase release? ","&Yes\n&No",1) - if (option == 1) + if option == 1 execute relline normal let rel = substitute(strpart(getline(relline),8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') @@ -171,13 +171,13 @@ if !exists("*s:ParseRpmVars") let ret = "" while (1) let start = match(a:str, "\%{", end+1) - if (start == -1) + if start == -1 let ret = ret . strpart(a:str, end+1) break endif let ret = ret . strpart(a:str, end+1, start-(end+1)) let end = match(a:str, "}", start) - if (end == -1) + if end == -1 let ret = ret . strpart(a:str, start) break endif @@ -185,7 +185,7 @@ if !exists("*s:ParseRpmVars") execute a:strline let definestr = "^[ \t]*%\\(define\\|global\\)[ \t]\\+".varname."[ \t]\\+\\(.*\\)$" let linenum = search(definestr, "bW") - if (linenum != 0) + if linenum != 0 let ret = ret . substitute(getline(linenum), definestr, "\\2", "") endif endwhile |