Skip to content

Commit 96dfb08

Browse files
Mike Sharpevim-scripts
authored andcommitted
Version 2.0b
Added support for Ada95 extensions minor bug fixed too.
1 parent 85064bd commit 96dfb08

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

plugin/a.vim

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
" new since 2.0
2-
" + fix errors which occured when no alternate file was available, e.g. no
3-
" extspec
4-
51
" Copyright (c) 1998-2001
62
" Michael Sharpe <feline@irendi.com>
73
"
@@ -30,7 +26,7 @@ if (!exists("g:alternateExtensions"))
3026
" the alternate is .c or .cpp or .cxx. Each extension is tried in order
3127
" for a match file/buffer. If no match is found the first extension is
3228
" used and if necessary the buffer is created.
33-
let alternateExtensions = "|h:c,cpp,cxx,cc,CC|H:C,CPP,CXX,CC|hpp:cpp,c|HPP:CPP:C|c:h|C:H|cpp:h,hpp|CPP:H:HPP|cc:h|CC:H|cxx:h|CXX:H|CC:h,H|psl:ph|ph:psl|"
29+
let alternateExtensions = "|h:c,cpp,cxx,cc,CC|H:C,CPP,CXX,CC|hpp:cpp,c|HPP:CPP:C|c:h|C:H|cpp:h,hpp|CPP:H:HPP|cc:h|CC:H|cxx:h|CXX:H|CC:h,H|psl:ph|ph:psl|adb:ads|ads:adb|"
3430
endif
3531

3632

@@ -103,6 +99,7 @@ func! AlternateFile(splitWindow, ...)
10399

104100
let extSpec = <SID>FindExtensionSpec(extension)
105101
if (extSpec != "")
102+
let firstFilename = ""
106103
let foundMatch = 0
107104
let n = 1
108105
while (!foundMatch)
@@ -121,7 +118,7 @@ func! AlternateFile(splitWindow, ...)
121118
endif
122119
let n = n + 1
123120
endwhile
124-
if (foundMatch == 0)
121+
if (foundMatch == 0 && firstFilename != "")
125122
let newFilename = firstFilename
126123
endif
127124
endif

0 commit comments

Comments
 (0)