home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
me
/
vi_brace.m
< prev
next >
Wrap
Text File
|
1994-01-31
|
618b
|
38 lines
/*
** vi_brace macro
** Provides brace matching much like vi's "showmatch"
** by William B. McCormick
*/
init()
{
add_hook( 0, "vi_brace" );
}
vi_brace()
{
int i;
c = currchar();
if ( c==')' || c=='}' )
{
if ( brace_match() )
{
/*
** this should be some sort of machine-independent
** delay call. This is a comfortable speed on a
** model 80. Will probably have to be changed for
** a slower (or faster) machine.
*/
for ( i=0; i<1000; i++ )
;
brace_match();
}
else
bell();
}
}