1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-10 14:00:41 +00:00

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

View File

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