diff options
author | Christian Clason <c.clason@uni-graz.at> | 2024-09-11 09:28:15 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-09-11 09:47:30 +0200 |
commit | c1a4b8680b6b52d3cf94006f34903d88d2260842 (patch) | |
tree | 5c80fae901728c449d734727e4eb2d2290c4803e | |
parent | f6579a4db10c031588fd29986817ff7c85b7940c (diff) | |
download | rneovim-c1a4b8680b6b52d3cf94006f34903d88d2260842.tar.gz rneovim-c1a4b8680b6b52d3cf94006f34903d88d2260842.tar.bz2 rneovim-c1a4b8680b6b52d3cf94006f34903d88d2260842.zip |
vim-patch:e401576: runtime(spec): Recognize epoch when making spec changelog in ftplugin
closes: vim/vim#15537
https://github.com/vim/vim/commit/e40157641c1ddb9cc805c04ca23fb80a6382a349
Co-authored-by: fundawang <fundawang@yeah.net>
-rw-r--r-- | runtime/ftplugin/spec.vim | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index 9040e19ce1..fa125be52c 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -2,8 +2,9 @@ " Filename: spec.vim " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014) -" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko -" Update by Zdenek Dohnal, 2022 May 17 +" Last Change: 2015 Jun 01 +" Update by Zdenek Dohnal, 2022 May 17 +" 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537 if exists("b:did_ftplugin") finish @@ -66,9 +67,11 @@ if !exists("*s:SpecChangelog") endif let line = 0 let name = "" + let epoch = "" let ver = "" let rel = "" let nameline = -1 + let epochline = -1 let verline = -1 let relline = -1 let chgline = -1 @@ -77,6 +80,9 @@ if !exists("*s:SpecChangelog") if name == "" && linestr =~? '^Name:' let nameline = line let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','') + elseif epoch == "" && linestr =~? '^Epoch:' + let epochline = line + let epoch = substitute(strpart(linestr,6), '^[ ]*\([^ ]\+\)[ ]*$','\1','') elseif ver == "" && linestr =~? '^Version:' let verline = line let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') @@ -93,6 +99,7 @@ if !exists("*s:SpecChangelog") if nameline != -1 && verline != -1 && relline != -1 let include_release_info = exists("g:spec_chglog_release_info") let name = s:ParseRpmVars(name, nameline) + let epoch = s:ParseRpmVars(epoch, epochline) let ver = s:ParseRpmVars(ver, verline) let rel = s:ParseRpmVars(rel, relline) else @@ -117,6 +124,9 @@ if !exists("*s:SpecChangelog") if chgline != -1 let tmptime = v:lc_time language time C + if strlen(epoch) + let ver = epoch.":".ver + endif let parsed_format = "* ".strftime(format)." - ".ver."-".rel execute "language time" tmptime let release_info = "+ ".name."-".ver."-".rel |