Skip to content

Commit

Permalink
Windows Runtime changes
Browse files Browse the repository at this point in the history
  • Loading branch information
spf13 committed Mar 11, 2011
1 parent 3b8307b commit 99c590f
Showing 1 changed file with 38 additions and 34 deletions.
72 changes: 38 additions & 34 deletions .vim/bundle/rbtweaks/plugin/c.vim
Expand Up @@ -56,7 +56,9 @@ let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95")
if s:MSWIN
"
let s:escfilename = ''
let s:plugin_dir = $VIM.'\vimfiles\'
"Change plugin_dir to remain consistent with .vimrc windows runtime settings
"let s:plugin_dir = $VIM.'\vimfiles\'
let s:plugin_dir = $HOME.'\.vim\'
let s:C_CodeSnippets = s:plugin_dir.'c-support/codesnippets/'
let s:C_IndentErrorLog = $HOME.'.indent.errorlog'
let s:installation = 'system'
Expand Down Expand Up @@ -133,7 +135,9 @@ let s:C_GlobalTemplateFile = s:plugin_dir.'c-support/templates/Templates'
let s:C_GlobalTemplateDir = fnamemodify( s:C_GlobalTemplateFile, ":p:h" ).'/'
let s:C_LocalTemplateFile = $HOME.'/.vim/c-support/templates/Templates'
let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
let s:C_TemplateOverwrittenMsg= 'yes'
"Message not needed
"let s:C_TemplateOverwrittenMsg= 'yes'
let s:C_TemplateOverwrittenMsg= 'no'
let s:C_Ctrl_j = 'on'
"
let s:C_FormatDate = '%x'
Expand Down Expand Up @@ -266,12 +270,12 @@ let s:C_ForTypes = [
\ 'unsigned int ' ,
\ 'unsigned long int ' ,
\ 'unsigned long ' ,
\ 'unsigned short int ',
\ 'unsigned short ' ,
\ 'unsigned ' ,
\ 'unsigned short int ',
\ 'unsigned short ' ,
\ 'unsigned ' ,
\ ]

let s:MsgInsNotAvail = "insertion not available for a fold"
let s:MsgInsNotAvail = "insertion not available for a fold"

"------------------------------------------------------------------------------

Expand Down Expand Up @@ -2485,7 +2489,7 @@ function! C_Help( type )
endif
setlocal modifiable
"
if a:type == 'm'
if a:type == 'm'
"
" Is there more than one manual ?
"
Expand All @@ -2501,7 +2505,7 @@ function! C_Help( type )
" Select manuals where the name exactly matches
"
for line in catalogs
if line =~ '^'.item.'\s\+('
if line =~ '^'.item.'\s\+('
let itempart = split( line, '\s\+' )
let catalog = itempart[1][1:-2]
if match( catalog, '.p$' ) == -1
Expand Down Expand Up @@ -2687,7 +2691,7 @@ function! C_ReadTemplates ( templatefile )
"-------------------------------------------------------------------------------
"
let string = matchlist( line, s:C_TemplateIf )
if !empty(string)
if !empty(string)
if !has_key( s:C_Template, string[1] )
" new s:style
let s:style = string[1]
Expand Down Expand Up @@ -2793,7 +2797,7 @@ endfunction " ---------- end of function C_StyleList ----------

"------------------------------------------------------------------------------
" C_OpenFold {{{1
" Open fold and go to the first or last line of this fold.
" Open fold and go to the first or last line of this fold.
"------------------------------------------------------------------------------
function! C_OpenFold ( mode )
if foldclosed(".") >= 0
Expand Down Expand Up @@ -2825,7 +2829,7 @@ function! C_InsertTemplate ( key, ... )
return
endif

if &foldenable
if &foldenable
let foldmethod_save = &foldmethod
set foldmethod=manual
endif
Expand Down Expand Up @@ -3008,7 +3012,7 @@ function! C_InsertTemplate ( key, ... )
" define a pattern to highlight
call C_HighlightJumpTargets ()

if &foldenable
if &foldenable
" restore folding method
exe "set foldmethod=".foldmethod_save
normal zv
Expand All @@ -3034,7 +3038,7 @@ function! C_JumpCtrlJ ()
" remove the target
call setline( match, substitute( getline('.'), s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2, '', '' ) )
else
" try to jump behind parenthesis or strings in the current line
" try to jump behind parenthesis or strings in the current line
if match( getline(".")[col(".") - 1], "[\]})\"'`]" ) != 0
call search( "[\]})\"'`]", '', line(".") )
endif
Expand Down Expand Up @@ -3255,7 +3259,7 @@ endfunction " ---------- end of function C_DateAndTime ----------
" check for header or implementation file {{{1
"------------------------------------------------------------------------------
function! C_InsertTemplateWrapper ()
if index( s:C_SourceCodeExtensionsList, expand('%:e') ) >= 0
if index( s:C_SourceCodeExtensionsList, expand('%:e') ) >= 0
call C_InsertTemplate("comment.file-description")
else
call C_InsertTemplate("comment.file-description-header")
Expand All @@ -3266,18 +3270,18 @@ endfunction " ---------- end of function C_InsertTemplateWrapper ----------
"-------------------------------------------------------------------------------
" Comment : C/C++ File Sections {{{1
"-------------------------------------------------------------------------------
let s:CFileSection = {
\ "Header\ File\ Includes" : "file-section-cpp-header-includes" ,
\ "Local\ Macros" : "file-section-cpp-macros" ,
\ "Local\ Type\ Def\." : "file-section-cpp-typedefs" ,
\ "Local\ Data\ Types" : "file-section-cpp-data-types" ,
\ "Local\ Variables" : "file-section-cpp-local-variables" ,
\ "Local\ Prototypes" : "file-section-cpp-prototypes" ,
\ "Exp\.\ Function\ Def\." : "file-section-cpp-function-defs-exported" ,
\ "Local\ Function\ Def\." : "file-section-cpp-function-defs-local" ,
\ "Local\ Class\ Def\." : "file-section-cpp-class-defs" ,
\ "Exp\.\ Class\ Impl\." : "file-section-cpp-class-implementations-exported",
\ "Local\ Class\ Impl\." : "file-section-cpp-class-implementations-local" ,
let s:CFileSection = {
\ "Header\ File\ Includes" : "file-section-cpp-header-includes" ,
\ "Local\ Macros" : "file-section-cpp-macros" ,
\ "Local\ Type\ Def\." : "file-section-cpp-typedefs" ,
\ "Local\ Data\ Types" : "file-section-cpp-data-types" ,
\ "Local\ Variables" : "file-section-cpp-local-variables" ,
\ "Local\ Prototypes" : "file-section-cpp-prototypes" ,
\ "Exp\.\ Function\ Def\." : "file-section-cpp-function-defs-exported" ,
\ "Local\ Function\ Def\." : "file-section-cpp-function-defs-local" ,
\ "Local\ Class\ Def\." : "file-section-cpp-class-defs" ,
\ "Exp\.\ Class\ Impl\." : "file-section-cpp-class-implementations-exported",
\ "Local\ Class\ Impl\." : "file-section-cpp-class-implementations-local" ,
\ "All\ sections,\ C" : "c",
\ "All\ sections,\ C++" : "cpp",
\ }
Expand All @@ -3290,7 +3294,7 @@ function! C_CFileSectionListInsert ( arg )
if has_key( s:CFileSection, a:arg )
if s:CFileSection[a:arg] == 'c' || s:CFileSection[a:arg] == 'cpp'
call C_Comment_C_SectionAll( 'comment.'.s:CFileSection[a:arg] )
return
return
endif
call C_InsertTemplate( 'comment.'.s:CFileSection[a:arg] )
else
Expand All @@ -3301,7 +3305,7 @@ endfunction " ---------- end of function C_CFileSectionListInsert ---------
"-------------------------------------------------------------------------------
" Comment : H File Sections {{{1
"-------------------------------------------------------------------------------
let s:HFileSection = {
let s:HFileSection = {
\ "Header\ File\ Includes" : "file-section-hpp-header-includes" ,
\ "Exported\ Macros" : "file-section-hpp-macros" ,
\ "Exported\ Type\ Def\." : "file-section-hpp-exported-typedefs" ,
Expand All @@ -3321,7 +3325,7 @@ function! C_HFileSectionListInsert ( arg )
if has_key( s:HFileSection, a:arg )
if s:HFileSection[a:arg] == 'c' || s:HFileSection[a:arg] == 'cpp'
call C_Comment_C_SectionAll( 'comment.'.s:HFileSection[a:arg] )
return
return
endif
call C_InsertTemplate( 'comment.'.s:HFileSection[a:arg] )
else
Expand All @@ -3332,7 +3336,7 @@ endfunction " ---------- end of function C_HFileSectionListInsert ---------
"-------------------------------------------------------------------------------
" Comment : Keyword Comments {{{1
"-------------------------------------------------------------------------------
let s:KeywordComment = {
let s:KeywordComment = {
\ 'BUG' : 'keyword-bug',
\ 'COMPILER' : 'keyword-compiler',
\ 'TODO' : 'keyword-todo',
Expand All @@ -3350,7 +3354,7 @@ function! C_KeywordCommentListInsert ( arg )
if has_key( s:KeywordComment, a:arg )
if s:KeywordComment[a:arg] == 'c' || s:KeywordComment[a:arg] == 'cpp'
call C_Comment_C_SectionAll( 'comment.'.s:KeywordComment[a:arg] )
return
return
endif
call C_InsertTemplate( 'comment.'.s:KeywordComment[a:arg] )
else
Expand All @@ -3361,7 +3365,7 @@ endfunction " ---------- end of function C_KeywordCommentListInsert -------
"-------------------------------------------------------------------------------
" Comment : Special Comments {{{1
"-------------------------------------------------------------------------------
let s:SpecialComment = {
let s:SpecialComment = {
\ 'EMPTY' : 'special-empty' ,
\ 'FALL\ THROUGH' : 'special-fall-through' ,
\ 'IMPL\.\ TYPE\ CONV' : 'special-implicit-type-conversion")' ,
Expand All @@ -3381,7 +3385,7 @@ function! C_SpecialCommentListInsert ( arg )
if has_key( s:SpecialComment, a:arg )
if s:SpecialComment[a:arg] == 'c' || s:SpecialComment[a:arg] == 'cpp'
call C_Comment_C_SectionAll( 'comment.'.s:SpecialComment[a:arg] )
return
return
endif
call C_InsertTemplate( 'comment.'.s:SpecialComment[a:arg] )
else
Expand Down Expand Up @@ -3520,7 +3524,7 @@ if has("autocmd")
"
else
"-------------------------------------------------------------------------------
" template styles are related to file extensions
" template styles are related to file extensions
"-------------------------------------------------------------------------------
for [ pattern, stl ] in items( g:C_Styles )
exe "autocmd BufNewFile,BufRead,BufEnter ".pattern." call C_Style( '".stl."' )"
Expand Down

0 comments on commit 99c590f

Please sign in to comment.