Skip to content

Commit f3f5881

Browse files
Fix various issues with new Vim versions
- Fix a command definition - Update the template engine taken from WolfgangMehner/vim-plugins, revision WolfgangMehner/vim-plugins@e746a3f
1 parent e14a382 commit f3f5881

File tree

8 files changed

+55
-99
lines changed

8 files changed

+55
-99
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The development happens in [WolfgangMehner/vim-plugins](https://github.com/Wolfg
1010

1111
--------------------------------------------------------------------------------
1212

13-
README for perl-support.vim (Version 5.5alpha) / June 15 2019
13+
README for perl-support.vim (Version 5.5alpha) / August 06 2020
1414
================================================================================
1515

1616
* INSTALLATION

autoload/mmtemplates/core.vim

+26-26
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
" Organization:
1212
" Version: see variable g:Templates_Version below
1313
" Created: 30.08.2011
14-
" Revision: 14.04.2017
15-
" License: Copyright (c) 2012-2016, Wolfgang Mehner
14+
" Revision: 06.08.2020
15+
" License: Copyright (c) 2012-2020, Wolfgang Mehner
1616
" This program is free software; you can redistribute it and/or
1717
" modify it under the terms of the GNU General Public License as
1818
" published by the Free Software Foundation, version 2 of the
@@ -23,27 +23,27 @@
2323
" PURPOSE.
2424
" See the GNU General Public License version 2 for more details.
2525
"===============================================================================
26-
"
26+
2727
"-------------------------------------------------------------------------------
2828
" === Basic Checks === {{{1
2929
"-------------------------------------------------------------------------------
30-
"
30+
3131
" need at least 7.0
3232
if v:version < 700
3333
echohl WarningMsg
3434
echo 'The plugin templates.vim needs Vim version >= 7.'
3535
echohl None
3636
finish
3737
endif
38-
"
38+
3939
" prevent duplicate loading
4040
" need compatible
4141
if &cp || ( exists('g:Templates_Version') && g:Templates_Version != 'searching' && ! exists('g:Templates_DevelopmentOverwrite') )
4242
finish
4343
endif
44-
"
45-
let s:Templates_Version = '1.1alpha' " version number of this script; do not change
46-
"
44+
45+
let s:Templates_Version = '1.1beta' " version number of this script; do not change
46+
4747
"----------------------------------------------------------------------
4848
" --- Find Newest Version --- {{{2
4949
"----------------------------------------------------------------------
@@ -133,13 +133,13 @@ else
133133
endif
134134
" }}}2
135135
"-------------------------------------------------------------------------------
136-
"
136+
137137
let g:Templates_Version = s:Templates_Version " version number of this script; do not change
138-
"
138+
139139
"----------------------------------------------------------------------
140140
" === Modul Setup === {{{1
141141
"----------------------------------------------------------------------
142-
"
142+
143143
"-------------------------------------------------------------------------------
144144
" s:ApplyDefaultSetting : Write default setting to a global variable. {{{2
145145
"
@@ -152,13 +152,13 @@ let g:Templates_Version = s:Templates_Version " version number of this scrip
152152
" If g:<varname> does not exists, assign:
153153
" g:<varname> = value
154154
"-------------------------------------------------------------------------------
155-
"
155+
156156
function! s:ApplyDefaultSetting ( varname, value )
157-
if ! exists ( 'g:'.a:varname )
158-
let { 'g:'.a:varname } = a:value
157+
if ! exists( 'g:'.a:varname )
158+
let {'g:'.a:varname} = a:value
159159
endif
160-
endfunction " ---------- end of function s:ApplyDefaultSetting ----------
161-
"
160+
endfunction
161+
162162
"-------------------------------------------------------------------------------
163163
" s:GetGlobalSetting : Get a setting from a global variable. {{{2
164164
"
@@ -175,20 +175,20 @@ endfunction " ---------- end of function s:ApplyDefaultSetting ----------
175175
" g:<varname> == 0 -> s:<varname> = "no"
176176
" otherwise -> s:<varname> = "yes"
177177
"-------------------------------------------------------------------------------
178-
"
178+
179179
function! s:GetGlobalSetting ( varname, ... )
180-
if a:0 > 0 && a:1 == 'bin' && exists ( 'g:'.a:varname ) && type ( 0 ) == type ( { 'g:'.a:varname } )
181-
let { 's:'.a:varname } = { 'g:'.a:varname } == 0 ? 'no' : 'yes'
182-
elseif exists ( 'g:'.a:varname )
183-
let { 's:'.a:varname } = { 'g:'.a:varname }
180+
if a:0 > 0 && a:1 == 'bin' && exists( 'g:'.a:varname ) && type( 0 ) == type( {'g:'.a:varname} )
181+
let {'s:'.a:varname} = {'g:'.a:varname} == 0 ? 'no' : 'yes'
182+
elseif exists( 'g:'.a:varname )
183+
let {'s:'.a:varname} = {'g:'.a:varname}
184184
endif
185-
"
186-
let s:Templates_AllSettings[ a:varname ] = { 's:'.a:varname }
187-
endfunction " ---------- end of function s:GetGlobalSetting ----------
188-
"
185+
186+
let s:Templates_AllSettings[ a:varname ] = {'s:'.a:varname}
187+
endfunction
188+
189189
" }}}2
190190
"-------------------------------------------------------------------------------
191-
"
191+
192192
" platform specifics
193193
let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95")
194194
let s:UNIX = has("unix") || has("macunix") || has("win32unix")

doc/templatesupport.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
*templatesupport.txt* MM Template Support Apr 14 2017
1+
*templatesupport.txt* MM Template Support Aug 06 2020
22

33
MM Template Support *template-support*
44

5-
Plug-in version 1.1alpha
5+
Plug-in version 1.1beta
66
for Vim version 7.0 and above
77
Wolfgang Mehner <wolfgang-mehner at web.de>
88

perl-support/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README for perl-support.vim (Version 5.5alpha) / June 15 2019
1+
README for perl-support.vim (Version 5.5alpha) / August 06 2020
22
================================================================================
33

44
* INSTALLATION

perl-support/rc/perl.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"
55
" Language : Perl
66
" Plugin : perl-support.vim
7-
" Revision : 15.04.2017
7+
" Revision : 26.06.2019
88
" Maintainer : Wolfgang Mehner <wolfgang-mehner@web.de>
99
" (formerly Fritz Mehner <mehner.fritz@web.de>)
1010
"

perl-support/rc/pod.vim

+14-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"
55
" Language : Perl (POD)
66
" Plugin : perl-support.vim
7-
" Revision : 15.04.2017
7+
" Revision : 26.06.2019
88
" Maintainer : Wolfgang Mehner <wolfgang-mehner@web.de>
99
" (formerly Fritz Mehner <mehner.fritz@web.de>)
1010
"
@@ -20,22 +20,26 @@ let b:did_perl_support_pod = 1
2020
" Set tabulator and shift width to 4 conforming to the Perl Style Guide.
2121
" Uncomment the next two lines to force these settings for all files with
2222
" filetype 'perl' .
23-
"
2423
setlocal tabstop=4
2524
setlocal shiftwidth=4
26-
"
25+
2726
" ---------- Add ':' to the keyword characters -------------------------------
2827
" Tokens like 'File::Find' are recognized as
2928
" one keyword
30-
"
3129
setlocal iskeyword+=:
32-
"
30+
3331
" ---------- Set "maplocalleader" as configured using "g:Perl_MapLeader" -----
34-
"
3532
call Perl_SetMapLeader ()
36-
"
33+
34+
" Alt-F9: run syntax check
35+
noremap <buffer> <silent> <A-F9> :PerlCheck<CR>
36+
inoremap <buffer> <silent> <A-F9> <C-C>:PerlCheck<CR>
37+
38+
" Shift-F1: read Perl documentation
39+
noremap <buffer> <silent> <S-F1> :PerlDoc<CR>
40+
inoremap <buffer> <silent> <S-F1> <C-C>:PerlDoc<CR>
41+
3742
" ---------- Maps for the Make tool ------------------------------------------
38-
"
3943
noremap <buffer> <silent> <LocalLeader>rm :Make<CR>
4044
inoremap <buffer> <silent> <LocalLeader>rm <C-C>:Make<CR>
4145
noremap <buffer> <silent> <LocalLeader>rmc :Make clean<CR>
@@ -44,8 +48,7 @@ inoremap <buffer> <silent> <LocalLeader>rmc <C-C>:Make clean<CR>
4448
inoremap <buffer> <LocalLeader>rma <C-C>:MakeCmdlineArgs<space>
4549
noremap <buffer> <LocalLeader>rcm :MakeFile<space>
4650
inoremap <buffer> <LocalLeader>rcm <C-C>:MakeFile<space>
47-
"
51+
4852
" ---------- Reset "maplocalleader" ------------------------------------------
49-
"
5053
call Perl_ResetMapLeader ()
51-
"
54+

plugin/perl-support.vim

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
" Created: 09.07.2001
4242
" Revision: 26.06.2019
4343
" License: Copyright (c) 2001-2014, Fritz Mehner
44-
" Copyright (c) 2015-2019, Wolfgang Mehner
44+
" Copyright (c) 2015-2020, Wolfgang Mehner
4545
" This program is free software; you can redistribute it
4646
" and/or modify it under the terms of the GNU General Public
4747
" License as published by the Free Software Foundation,
@@ -92,10 +92,10 @@ let g:Perl_PluginVersion= "5.5alpha" " version number of this s
9292
"-------------------------------------------------------------------------------
9393

9494
function! s:ApplyDefaultSetting ( varname, value )
95-
if ! exists ( 'g:'.a:varname )
96-
let { 'g:'.a:varname } = a:value
95+
if ! exists( 'g:'.a:varname )
96+
let {'g:'.a:varname} = a:value
9797
endif
98-
endfunction " ---------- end of function s:ApplyDefaultSetting ----------
98+
endfunction
9999

100100
"-------------------------------------------------------------------------------
101101
" s:ErrorMsg : Print an error message. {{{2
@@ -114,7 +114,7 @@ function! s:ErrorMsg ( ... )
114114
echomsg line
115115
endfor
116116
echohl None
117-
endfunction " ---------- end of function s:ErrorMsg ----------
117+
endfunction
118118

119119
"-------------------------------------------------------------------------------
120120
" s:GetGlobalSetting : Get a setting from a global variable. {{{2
@@ -135,10 +135,10 @@ endfunction " ---------- end of function s:ErrorMsg ----------
135135
function! s:GetGlobalSetting ( varname, ... )
136136
let lname = a:varname
137137
let gname = a:0 >= 1 ? a:1 : lname
138-
if exists ( 'g:'.gname )
139-
let { 's:'.lname } = { 'g:'.gname }
138+
if exists( 'g:'.gname )
139+
let {'s:'.lname} = {'g:'.gname}
140140
endif
141-
endfunction " ---------- end of function s:GetGlobalSetting ----------
141+
endfunction
142142

143143
"-------------------------------------------------------------------------------
144144
" s:ImportantMsg : Print an important message. {{{2
@@ -2704,7 +2704,7 @@ function! s:CreateAdditionalMaps ()
27042704

27052705
" ---------- commands : run -------------------------------------
27062706
command! -nargs=* -buffer -complete=file Perl call <SID>Run(<q-args>)
2707-
command! -nargs=0 -buffer -complete=file PerlCheck call <SID>SyntaxCheck()
2707+
command! -nargs=0 -buffer PerlCheck call <SID>SyntaxCheck()
27082708
command! -nargs=* -buffer -complete=file PerlDebug call <SID>Debugger(<q-args>)
27092709

27102710
command! -nargs=* -complete=file PerlScriptArguments call Perl_ScriptCmdLineArguments(<q-args>)

project/release.lua

+1-48
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
-- - awk
1212
-- - bash
1313
-- - c
14-
-- - git
1514
-- - latex
1615
-- - lua
17-
-- - matlab
1816
-- - perl
1917
-- - vim
2018
--
@@ -162,24 +160,6 @@ filelists_repo.c = {
162160
'project/release.lua',
163161
}
164162

165-
------------------------------------------------------------------------
166-
-- Git {{{1
167-
------------------------------------------------------------------------
168-
169-
filelists.git = {
170-
'doc/gitsupport.txt',
171-
'plugin/git-support.vim',
172-
'git-support/doc/',
173-
'git-support/rc/',
174-
'git-support/README.md',
175-
'syntax/gits*.vim',
176-
}
177-
178-
filelists_repo.git = {
179-
'git-support/git-doc/',
180-
'project/release.lua',
181-
}
182-
183163
------------------------------------------------------------------------
184164
-- LaTeX {{{1
185165
------------------------------------------------------------------------
@@ -241,30 +221,6 @@ filelists_repo.lua = {
241221
'project/release.lua',
242222
}
243223

244-
------------------------------------------------------------------------
245-
-- Matlab {{{1
246-
------------------------------------------------------------------------
247-
248-
filelists.matlab = {
249-
'autoload/mmtemplates/',
250-
'doc/matlabsupport.txt',
251-
'doc/templatesupport.txt',
252-
'ftdetect/template.vim',
253-
'ftplugin/matlab.vim',
254-
'ftplugin/template.vim',
255-
'plugin/matlab-support.vim',
256-
'syntax/template.vim',
257-
'matlab-support/codesnippets/',
258-
'matlab-support/doc/',
259-
'matlab-support/rc/',
260-
'matlab-support/templates/',
261-
'matlab-support/README.md',
262-
}
263-
264-
filelists_repo.matlab = {
265-
'project/release.lua',
266-
}
267-
268224
------------------------------------------------------------------------
269225
-- Perl {{{1
270226
------------------------------------------------------------------------
@@ -457,7 +413,6 @@ elseif args[2] == 'cp-repo' then
457413
end
458414

459415
os.execute ( 'mkdir -p '..dest_dir )
460-
os.execute ( 'mkdir -p '..dest_dir..'/project' )
461416

462417
local cmd = 'cp --parents -r '..table.concat ( filelist_compl, ' ' )..' '..dest_dir
463418

@@ -472,7 +427,7 @@ elseif args[2] == 'cp-repo' then
472427
end
473428

474429
if success then
475-
cmd = 'echo "\\ntaken from WolfgangMehner/vim-plugins, revision\\nhttps://github.com/WolfgangMehner/vim-plugins/commit/$(git rev-parse HEAD)" >> '..dest_dir..'/project/commit.txt'
430+
cmd = 'echo "\\ntaken from WolfgangMehner/vim-plugins, revision\\nhttps://github.com/WolfgangMehner/vim-plugins/commit/$(git rev-parse HEAD)" >> '..dest_dir..'/commit.txt'
476431

477432
success, res_reason, res_status = os.execute ( cmd )
478433
end
@@ -510,10 +465,8 @@ if print_help then
510465
print ( '\tawk' )
511466
print ( '\tbash' )
512467
print ( '\tc' )
513-
print ( '\tgit' )
514468
print ( '\tlatex' )
515469
print ( '\tlua' )
516-
print ( '\tmatlab' )
517470
print ( '\tperl' )
518471
print ( '\tvim' )
519472
print ( '' )

0 commit comments

Comments
 (0)