Mercurial > vim
comparison src/ops.c @ 1969:2e915ea7110f v7.2.266
updated for version 7.2-266
author | vimboss |
---|---|
date | Wed, 30 Sep 2009 13:17:02 +0000 |
parents | 75a69023117c |
children | b1b09b68d706 |
comparison
equal
deleted
inserted
replaced
1968:eb27e3e2df70 | 1969:2e915ea7110f |
---|---|
4471 int c; /* character to be inserted */ | 4471 int c; /* character to be inserted */ |
4472 { | 4472 { |
4473 int use_sandbox = was_set_insecurely((char_u *)"formatexpr", | 4473 int use_sandbox = was_set_insecurely((char_u *)"formatexpr", |
4474 OPT_LOCAL); | 4474 OPT_LOCAL); |
4475 int r; | 4475 int r; |
4476 #ifdef FEAT_MBYTE | |
4477 char_u buf[MB_MAXBYTES]; | |
4478 #else | |
4479 char_u buf[2]; | |
4480 #endif | |
4481 | 4476 |
4482 /* | 4477 /* |
4483 * Set v:lnum to the first line number and v:count to the number of lines. | 4478 * Set v:lnum to the first line number and v:count to the number of lines. |
4484 * Set v:char to the character to be inserted (can be NUL). | 4479 * Set v:char to the character to be inserted (can be NUL). |
4485 */ | 4480 */ |
4486 set_vim_var_nr(VV_LNUM, lnum); | 4481 set_vim_var_nr(VV_LNUM, lnum); |
4487 set_vim_var_nr(VV_COUNT, count); | 4482 set_vim_var_nr(VV_COUNT, count); |
4488 | 4483 set_vim_var_char(c); |
4489 #ifdef FEAT_MBYTE | |
4490 if (has_mbyte) | |
4491 buf[(*mb_char2bytes)(c, buf)] = NUL; | |
4492 else | |
4493 #endif | |
4494 { | |
4495 buf[0] = c; | |
4496 buf[1] = NUL; | |
4497 } | |
4498 set_vim_var_string(VV_CHAR, buf, -1); | |
4499 | 4484 |
4500 /* | 4485 /* |
4501 * Evaluate the function. | 4486 * Evaluate the function. |
4502 */ | 4487 */ |
4503 if (use_sandbox) | 4488 if (use_sandbox) |