Skip to content

Commit 09d6849

Browse files
Fritz Mehnervim-scripts
Fritz Mehner
authored andcommitted
Version 5.16.1
- Bugfix: problem with a system-wide installation under Windows (thanks to Ricardo Vrech).
1 parent bdd024f commit 09d6849

File tree

3 files changed

+70
-61
lines changed

3 files changed

+70
-61
lines changed

README.csupport

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README for c.vim (Version 5.16) / November 05 2011
1+
README for c.vim (Version 5.16.1) / November 10 2011
22

33
* DESCRIPTION
44
* INSTALLATION
@@ -147,13 +147,9 @@ Any problems ? See the TROUBLESHOOTING section at the end of the help file
147147
'doc/csupport.txt'.
148148

149149
================================================================================
150-
RELEASE NOTES FOR VERSION 5.16
150+
RELEASE NOTES FOR VERSION 5.16.1
151151
================================================================================
152-
- Plugin loads faster: loading the templates is delayed until the first use.
153-
- Plugin now works with pathogen.vim.
154-
- Menus will always be generated (for the use with :emenu).
155-
- Bugfix: no local templates available with a system-wide installation (thanks to Iain Arnell).
156-
- Several improvements.
152+
- Bugfix: problem with a system-wide installation under Windows (thanks to Ricardo Vrech).
157153

158154
OLDER RELEASE NOTES : see file 'ChangeLog'
159155

doc/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
================================================================================
2+
RELEASE NOTES FOR VERSION 5.16
3+
================================================================================
4+
- Plugin loads faster: loading the templates is delayed until the first use.
5+
- Plugin now works with pathogen.vim.
6+
- Menus will always be generated (for the use with :emenu).
7+
- Bugfix: no local templates available with a system-wide installation (thanks to Iain Arnell).
8+
- Several improvements.
9+
110
================================================================================
211
RELEASE NOTES FOR VERSION 5.15
312
================================================================================

plugin/c.vim

Lines changed: 58 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
" warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
2828
" PURPOSE.
2929
" See the GNU General Public License version 2 for more details.
30-
" Revision: $Id: c.vim,v 1.150 2011/10/14 18:10:21 mehner Exp $
30+
" Revision: $Id: c.vim,v 1.152 2011/11/10 20:47:33 mehner Exp $
3131
"
3232
"------------------------------------------------------------------------------
3333
"
@@ -41,7 +41,7 @@ endif
4141
if exists("g:C_Version") || &cp
4242
finish
4343
endif
44-
let g:C_Version= "5.16" " version number of this script; do not change
44+
let g:C_Version= "5.16.1" " version number of this script; do not change
4545
"
4646
"#################################################################################
4747
"
@@ -54,42 +54,47 @@ let g:C_Version= "5.16" " version number of this script; do not change
5454
let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95")
5555
let s:UNIX = has("unix") || has("macunix") || has("win32unix")
5656
"
57-
let s:installation = 'local'
58-
let s:vimfiles = $VIM
59-
let s:sourced_script_file = expand("<sfile>")
60-
let s:C_GlobalTemplateFile= ''
61-
let s:C_GlobalTemplateDir = ''
57+
let s:installation = '*undefined*'
58+
let s:C_GlobalTemplateFile = ''
59+
let s:C_GlobalTemplateDir = ''
6260

6361
if s:MSWIN
6462
" ========== MS Windows ======================================================
6563
"
66-
if match( s:sourced_script_file, escape( s:vimfiles, ' \' ) ) == 0
67-
" system wide installation
64+
" change '\' to '/' to avoid interpretation as escape character
65+
if match( substitute( expand("<sfile>"), '\', '/', 'g' ),
66+
\ substitute( expand("$HOME"), '\', '/', 'g' ) ) == 0
67+
" USER INSTALLATION ASSUMED
68+
let s:installation = 'local'
69+
let s:plugin_dir = expand('<sfile>:p:h:h')
70+
let s:C_LocalTemplateFile = s:plugin_dir.'/c-support/templates/Templates'
71+
let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
72+
else
73+
" SYSTEM WIDE INSTALLATION
6874
let s:installation = 'system'
6975
let s:plugin_dir = $VIM.'/vimfiles'
7076
let s:C_GlobalTemplateDir = s:plugin_dir.'/c-support/templates'
7177
let s:C_GlobalTemplateFile = s:C_GlobalTemplateDir.'/Templates'
72-
else
73-
" user installation assumed
74-
let s:plugin_dir = expand('<sfile>:p:h:h')
78+
let s:C_LocalTemplateFile = $HOME.'/vimfiles/c-support/templates/Templates'
79+
let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
7580
endif
7681
"
7782
let s:C_CodeSnippets = s:plugin_dir.'/c-support/codesnippets/'
7883
let s:C_IndentErrorLog = $HOME.'/_indent.errorlog'
79-
"
80-
let s:escfilename = ''
81-
let s:C_Display = ''
84+
let s:escfilename = ''
85+
let s:C_Display = ''
8286
"
8387
else
8488
" ========== Linux/Unix ======================================================
8589
"
8690
if match( expand("<sfile>"), expand("$HOME") ) == 0
87-
" user installation assumed
91+
" USER INSTALLATION ASSUMED
92+
let s:installation = 'local'
8893
let s:plugin_dir = expand('<sfile>:p:h:h')
8994
let s:C_LocalTemplateFile = s:plugin_dir.'/c-support/templates/Templates'
9095
let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
9196
else
92-
" system wide installation
97+
" SYSTEM WIDE INSTALLATION
9398
let s:installation = 'system'
9499
let s:plugin_dir = $VIM.'/vimfiles'
95100
let s:C_GlobalTemplateDir = s:plugin_dir.'/c-support/templates'
@@ -100,9 +105,8 @@ else
100105
"
101106
let s:C_CodeSnippets = s:plugin_dir.'/c-support/codesnippets/'
102107
let s:C_IndentErrorLog = $HOME.'/.indent.errorlog'
103-
"
104-
let s:escfilename = ' \%#[]'
105-
let s:C_Display = $DISPLAY
108+
let s:escfilename = ' \%#[]'
109+
let s:C_Display = $DISPLAY
106110
"
107111
endif
108112
"
@@ -151,7 +155,7 @@ let s:C_XtermDefaults = '-fa courier -fs 12 -geometry 80x24'
151155
let s:C_GuiSnippetBrowser = 'gui' " gui / commandline
152156
let s:C_GuiTemplateBrowser = 'gui' " gui / explorer / commandline
153157
"
154-
let s:C_TemplateOverwrittenMsg= 'yes'
158+
let s:C_TemplateOverriddenMsg = 'no'
155159
let s:C_Ctrl_j = 'on'
156160
"
157161
let s:C_FormatDate = '%x'
@@ -169,38 +173,38 @@ function! C_CheckGlobal ( name )
169173
endif
170174
endfunction " ---------- end of function C_CheckGlobal ----------
171175
"
172-
call C_CheckGlobal('C_CCompiler ')
173-
call C_CheckGlobal('C_CExtension ')
174-
call C_CheckGlobal('C_CFlags ')
175-
call C_CheckGlobal('C_CodeCheckExeName ')
176-
call C_CheckGlobal('C_CodeCheckOptions ')
177-
call C_CheckGlobal('C_CodeSnippets ')
178-
call C_CheckGlobal('C_CplusCompiler ')
179-
call C_CheckGlobal('C_Ctrl_j ')
180-
call C_CheckGlobal('C_ExeExtension ')
181-
call C_CheckGlobal('C_FormatDate ')
182-
call C_CheckGlobal('C_FormatTime ')
183-
call C_CheckGlobal('C_FormatYear ')
184-
call C_CheckGlobal('C_GlobalTemplateFile ')
185-
call C_CheckGlobal('C_GuiSnippetBrowser ')
186-
call C_CheckGlobal('C_GuiTemplateBrowser ')
187-
call C_CheckGlobal('C_IndentErrorLog ')
188-
call C_CheckGlobal('C_LFlags ')
189-
call C_CheckGlobal('C_Libs ')
190-
call C_CheckGlobal('C_LineEndCommColDefault ')
191-
call C_CheckGlobal('C_LoadMenus ')
192-
call C_CheckGlobal('C_LocalTemplateFile ')
193-
call C_CheckGlobal('C_Man ')
194-
call C_CheckGlobal('C_MenuHeader ')
195-
call C_CheckGlobal('C_ObjExtension ')
196-
call C_CheckGlobal('C_OutputGvim ')
197-
call C_CheckGlobal('C_Printheader ')
198-
call C_CheckGlobal('C_Root ')
199-
call C_CheckGlobal('C_SourceCodeExtensions ')
200-
call C_CheckGlobal('C_TemplateOverwrittenMsg ')
201-
call C_CheckGlobal('C_TypeOfH ')
202-
call C_CheckGlobal('C_VimCompilerName ')
203-
call C_CheckGlobal('C_XtermDefaults ')
176+
call C_CheckGlobal('C_CCompiler ')
177+
call C_CheckGlobal('C_CExtension ')
178+
call C_CheckGlobal('C_CFlags ')
179+
call C_CheckGlobal('C_CodeCheckExeName ')
180+
call C_CheckGlobal('C_CodeCheckOptions ')
181+
call C_CheckGlobal('C_CodeSnippets ')
182+
call C_CheckGlobal('C_CplusCompiler ')
183+
call C_CheckGlobal('C_Ctrl_j ')
184+
call C_CheckGlobal('C_ExeExtension ')
185+
call C_CheckGlobal('C_FormatDate ')
186+
call C_CheckGlobal('C_FormatTime ')
187+
call C_CheckGlobal('C_FormatYear ')
188+
call C_CheckGlobal('C_GlobalTemplateFile ')
189+
call C_CheckGlobal('C_GuiSnippetBrowser ')
190+
call C_CheckGlobal('C_GuiTemplateBrowser ')
191+
call C_CheckGlobal('C_IndentErrorLog ')
192+
call C_CheckGlobal('C_LFlags ')
193+
call C_CheckGlobal('C_Libs ')
194+
call C_CheckGlobal('C_LineEndCommColDefault')
195+
call C_CheckGlobal('C_LoadMenus ')
196+
call C_CheckGlobal('C_LocalTemplateFile ')
197+
call C_CheckGlobal('C_Man ')
198+
call C_CheckGlobal('C_MenuHeader ')
199+
call C_CheckGlobal('C_ObjExtension ')
200+
call C_CheckGlobal('C_OutputGvim ')
201+
call C_CheckGlobal('C_Printheader ')
202+
call C_CheckGlobal('C_Root ')
203+
call C_CheckGlobal('C_SourceCodeExtensions ')
204+
call C_CheckGlobal('C_TemplateOverriddenMsg')
205+
call C_CheckGlobal('C_TypeOfH ')
206+
call C_CheckGlobal('C_VimCompilerName ')
207+
call C_CheckGlobal('C_XtermDefaults ')
204208

205209
if exists('g:C_GlobalTemplateFile') && !empty(g:C_GlobalTemplateFile)
206210
let s:C_GlobalTemplateDir = fnamemodify( s:C_GlobalTemplateFile, ":h" )
@@ -2822,7 +2826,7 @@ function! C_ReadTemplates ( templatefile )
28222826
if !empty(name)
28232827
let part = split( name, '\s*==\s*')
28242828
let item = part[0]
2825-
if has_key( s:C_Template[s:style], item ) && s:C_TemplateOverwrittenMsg == 'yes'
2829+
if has_key( s:C_Template[s:style], item ) && s:C_TemplateOverriddenMsg == 'yes'
28262830
echomsg "existing C/C++ template '".item."' overwritten"
28272831
endif
28282832
let s:C_Template[s:style][item] = ''

0 commit comments

Comments
 (0)