Skip to content

Commit 99c590f

Browse files
committed
Windows Runtime changes
1 parent 3b8307b commit 99c590f

File tree

1 file changed

+38
-34
lines changed
  • .vim/bundle/rbtweaks/plugin

1 file changed

+38
-34
lines changed

.vim/bundle/rbtweaks/plugin/c.vim

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95")
5656
if s:MSWIN
5757
"
5858
let s:escfilename = ''
59-
let s:plugin_dir = $VIM.'\vimfiles\'
59+
"Change plugin_dir to remain consistent with .vimrc windows runtime settings
60+
"let s:plugin_dir = $VIM.'\vimfiles\'
61+
let s:plugin_dir = $HOME.'\.vim\'
6062
let s:C_CodeSnippets = s:plugin_dir.'c-support/codesnippets/'
6163
let s:C_IndentErrorLog = $HOME.'.indent.errorlog'
6264
let s:installation = 'system'
@@ -133,7 +135,9 @@ let s:C_GlobalTemplateFile = s:plugin_dir.'c-support/templates/Templates'
133135
let s:C_GlobalTemplateDir = fnamemodify( s:C_GlobalTemplateFile, ":p:h" ).'/'
134136
let s:C_LocalTemplateFile = $HOME.'/.vim/c-support/templates/Templates'
135137
let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
136-
let s:C_TemplateOverwrittenMsg= 'yes'
138+
"Message not needed
139+
"let s:C_TemplateOverwrittenMsg= 'yes'
140+
let s:C_TemplateOverwrittenMsg= 'no'
137141
let s:C_Ctrl_j = 'on'
138142
"
139143
let s:C_FormatDate = '%x'
@@ -266,12 +270,12 @@ let s:C_ForTypes = [
266270
\ 'unsigned int ' ,
267271
\ 'unsigned long int ' ,
268272
\ 'unsigned long ' ,
269-
\ 'unsigned short int ',
270-
\ 'unsigned short ' ,
271-
\ 'unsigned ' ,
273+
\ 'unsigned short int ',
274+
\ 'unsigned short ' ,
275+
\ 'unsigned ' ,
272276
\ ]
273277

274-
let s:MsgInsNotAvail = "insertion not available for a fold"
278+
let s:MsgInsNotAvail = "insertion not available for a fold"
275279

276280
"------------------------------------------------------------------------------
277281

@@ -2485,7 +2489,7 @@ function! C_Help( type )
24852489
endif
24862490
setlocal modifiable
24872491
"
2488-
if a:type == 'm'
2492+
if a:type == 'm'
24892493
"
24902494
" Is there more than one manual ?
24912495
"
@@ -2501,7 +2505,7 @@ function! C_Help( type )
25012505
" Select manuals where the name exactly matches
25022506
"
25032507
for line in catalogs
2504-
if line =~ '^'.item.'\s\+('
2508+
if line =~ '^'.item.'\s\+('
25052509
let itempart = split( line, '\s\+' )
25062510
let catalog = itempart[1][1:-2]
25072511
if match( catalog, '.p$' ) == -1
@@ -2687,7 +2691,7 @@ function! C_ReadTemplates ( templatefile )
26872691
"-------------------------------------------------------------------------------
26882692
"
26892693
let string = matchlist( line, s:C_TemplateIf )
2690-
if !empty(string)
2694+
if !empty(string)
26912695
if !has_key( s:C_Template, string[1] )
26922696
" new s:style
26932697
let s:style = string[1]
@@ -2793,7 +2797,7 @@ endfunction " ---------- end of function C_StyleList ----------
27932797

27942798
"------------------------------------------------------------------------------
27952799
" C_OpenFold {{{1
2796-
" Open fold and go to the first or last line of this fold.
2800+
" Open fold and go to the first or last line of this fold.
27972801
"------------------------------------------------------------------------------
27982802
function! C_OpenFold ( mode )
27992803
if foldclosed(".") >= 0
@@ -2825,7 +2829,7 @@ function! C_InsertTemplate ( key, ... )
28252829
return
28262830
endif
28272831

2828-
if &foldenable
2832+
if &foldenable
28292833
let foldmethod_save = &foldmethod
28302834
set foldmethod=manual
28312835
endif
@@ -3008,7 +3012,7 @@ function! C_InsertTemplate ( key, ... )
30083012
" define a pattern to highlight
30093013
call C_HighlightJumpTargets ()
30103014

3011-
if &foldenable
3015+
if &foldenable
30123016
" restore folding method
30133017
exe "set foldmethod=".foldmethod_save
30143018
normal zv
@@ -3034,7 +3038,7 @@ function! C_JumpCtrlJ ()
30343038
" remove the target
30353039
call setline( match, substitute( getline('.'), s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2, '', '' ) )
30363040
else
3037-
" try to jump behind parenthesis or strings in the current line
3041+
" try to jump behind parenthesis or strings in the current line
30383042
if match( getline(".")[col(".") - 1], "[\]})\"'`]" ) != 0
30393043
call search( "[\]})\"'`]", '', line(".") )
30403044
endif
@@ -3255,7 +3259,7 @@ endfunction " ---------- end of function C_DateAndTime ----------
32553259
" check for header or implementation file {{{1
32563260
"------------------------------------------------------------------------------
32573261
function! C_InsertTemplateWrapper ()
3258-
if index( s:C_SourceCodeExtensionsList, expand('%:e') ) >= 0
3262+
if index( s:C_SourceCodeExtensionsList, expand('%:e') ) >= 0
32593263
call C_InsertTemplate("comment.file-description")
32603264
else
32613265
call C_InsertTemplate("comment.file-description-header")
@@ -3266,18 +3270,18 @@ endfunction " ---------- end of function C_InsertTemplateWrapper ----------
32663270
"-------------------------------------------------------------------------------
32673271
" Comment : C/C++ File Sections {{{1
32683272
"-------------------------------------------------------------------------------
3269-
let s:CFileSection = {
3270-
\ "Header\ File\ Includes" : "file-section-cpp-header-includes" ,
3271-
\ "Local\ Macros" : "file-section-cpp-macros" ,
3272-
\ "Local\ Type\ Def\." : "file-section-cpp-typedefs" ,
3273-
\ "Local\ Data\ Types" : "file-section-cpp-data-types" ,
3274-
\ "Local\ Variables" : "file-section-cpp-local-variables" ,
3275-
\ "Local\ Prototypes" : "file-section-cpp-prototypes" ,
3276-
\ "Exp\.\ Function\ Def\." : "file-section-cpp-function-defs-exported" ,
3277-
\ "Local\ Function\ Def\." : "file-section-cpp-function-defs-local" ,
3278-
\ "Local\ Class\ Def\." : "file-section-cpp-class-defs" ,
3279-
\ "Exp\.\ Class\ Impl\." : "file-section-cpp-class-implementations-exported",
3280-
\ "Local\ Class\ Impl\." : "file-section-cpp-class-implementations-local" ,
3273+
let s:CFileSection = {
3274+
\ "Header\ File\ Includes" : "file-section-cpp-header-includes" ,
3275+
\ "Local\ Macros" : "file-section-cpp-macros" ,
3276+
\ "Local\ Type\ Def\." : "file-section-cpp-typedefs" ,
3277+
\ "Local\ Data\ Types" : "file-section-cpp-data-types" ,
3278+
\ "Local\ Variables" : "file-section-cpp-local-variables" ,
3279+
\ "Local\ Prototypes" : "file-section-cpp-prototypes" ,
3280+
\ "Exp\.\ Function\ Def\." : "file-section-cpp-function-defs-exported" ,
3281+
\ "Local\ Function\ Def\." : "file-section-cpp-function-defs-local" ,
3282+
\ "Local\ Class\ Def\." : "file-section-cpp-class-defs" ,
3283+
\ "Exp\.\ Class\ Impl\." : "file-section-cpp-class-implementations-exported",
3284+
\ "Local\ Class\ Impl\." : "file-section-cpp-class-implementations-local" ,
32813285
\ "All\ sections,\ C" : "c",
32823286
\ "All\ sections,\ C++" : "cpp",
32833287
\ }
@@ -3290,7 +3294,7 @@ function! C_CFileSectionListInsert ( arg )
32903294
if has_key( s:CFileSection, a:arg )
32913295
if s:CFileSection[a:arg] == 'c' || s:CFileSection[a:arg] == 'cpp'
32923296
call C_Comment_C_SectionAll( 'comment.'.s:CFileSection[a:arg] )
3293-
return
3297+
return
32943298
endif
32953299
call C_InsertTemplate( 'comment.'.s:CFileSection[a:arg] )
32963300
else
@@ -3301,7 +3305,7 @@ endfunction " ---------- end of function C_CFileSectionListInsert ---------
33013305
"-------------------------------------------------------------------------------
33023306
" Comment : H File Sections {{{1
33033307
"-------------------------------------------------------------------------------
3304-
let s:HFileSection = {
3308+
let s:HFileSection = {
33053309
\ "Header\ File\ Includes" : "file-section-hpp-header-includes" ,
33063310
\ "Exported\ Macros" : "file-section-hpp-macros" ,
33073311
\ "Exported\ Type\ Def\." : "file-section-hpp-exported-typedefs" ,
@@ -3321,7 +3325,7 @@ function! C_HFileSectionListInsert ( arg )
33213325
if has_key( s:HFileSection, a:arg )
33223326
if s:HFileSection[a:arg] == 'c' || s:HFileSection[a:arg] == 'cpp'
33233327
call C_Comment_C_SectionAll( 'comment.'.s:HFileSection[a:arg] )
3324-
return
3328+
return
33253329
endif
33263330
call C_InsertTemplate( 'comment.'.s:HFileSection[a:arg] )
33273331
else
@@ -3332,7 +3336,7 @@ endfunction " ---------- end of function C_HFileSectionListInsert ---------
33323336
"-------------------------------------------------------------------------------
33333337
" Comment : Keyword Comments {{{1
33343338
"-------------------------------------------------------------------------------
3335-
let s:KeywordComment = {
3339+
let s:KeywordComment = {
33363340
\ 'BUG' : 'keyword-bug',
33373341
\ 'COMPILER' : 'keyword-compiler',
33383342
\ 'TODO' : 'keyword-todo',
@@ -3350,7 +3354,7 @@ function! C_KeywordCommentListInsert ( arg )
33503354
if has_key( s:KeywordComment, a:arg )
33513355
if s:KeywordComment[a:arg] == 'c' || s:KeywordComment[a:arg] == 'cpp'
33523356
call C_Comment_C_SectionAll( 'comment.'.s:KeywordComment[a:arg] )
3353-
return
3357+
return
33543358
endif
33553359
call C_InsertTemplate( 'comment.'.s:KeywordComment[a:arg] )
33563360
else
@@ -3361,7 +3365,7 @@ endfunction " ---------- end of function C_KeywordCommentListInsert -------
33613365
"-------------------------------------------------------------------------------
33623366
" Comment : Special Comments {{{1
33633367
"-------------------------------------------------------------------------------
3364-
let s:SpecialComment = {
3368+
let s:SpecialComment = {
33653369
\ 'EMPTY' : 'special-empty' ,
33663370
\ 'FALL\ THROUGH' : 'special-fall-through' ,
33673371
\ 'IMPL\.\ TYPE\ CONV' : 'special-implicit-type-conversion")' ,
@@ -3381,7 +3385,7 @@ function! C_SpecialCommentListInsert ( arg )
33813385
if has_key( s:SpecialComment, a:arg )
33823386
if s:SpecialComment[a:arg] == 'c' || s:SpecialComment[a:arg] == 'cpp'
33833387
call C_Comment_C_SectionAll( 'comment.'.s:SpecialComment[a:arg] )
3384-
return
3388+
return
33853389
endif
33863390
call C_InsertTemplate( 'comment.'.s:SpecialComment[a:arg] )
33873391
else
@@ -3520,7 +3524,7 @@ if has("autocmd")
35203524
"
35213525
else
35223526
"-------------------------------------------------------------------------------
3523-
" template styles are related to file extensions
3527+
" template styles are related to file extensions
35243528
"-------------------------------------------------------------------------------
35253529
for [ pattern, stl ] in items( g:C_Styles )
35263530
exe "autocmd BufNewFile,BufRead,BufEnter ".pattern." call C_Style( '".stl."' )"

0 commit comments

Comments
 (0)