In C mode, insertion of pound # can take a count as argument.

This commit is contained in:
Renaud 2016-02-24 21:43:11 +08:00
parent 3436443807
commit 15e5796426
1 changed files with 4 additions and 4 deletions

View File

@ -16,9 +16,9 @@ int gacount = 256 ; /* count until next ASAVE */
/* insert a # into the text here...we are in CMODE */
static int inspound( void) {
static int inspound( int n) {
/* if we are at the beginning of the line, no go */
if( curwp->w_doto != 0) {
if( n == 1 && curwp->w_doto != 0) {
int i ;
/* scan to see if all space before this is white space */
@ -37,7 +37,7 @@ static int inspound( void) {
}
/* and insert the required pound */
return linsert( 1, '#') ;
return linsert( n, '#') ;
}
/*
@ -103,7 +103,7 @@ int execute(int c, int f, int n)
if (c == '}' && (curbp->b_mode & MDCMOD) != 0)
status = insbrace(n, c);
else if (c == '#' && (curbp->b_mode & MDCMOD) != 0)
status = inspound();
status = inspound( n) ;
else
status = linsert(n, c);