Mercurial > vim
comparison src/edit.c @ 11:4424b47a0797
updated for version 7.0003
author | vimboss |
---|---|
date | Wed, 30 Jun 2004 16:16:41 +0000 |
parents | 4e2284e71352 |
children | bdeee1504ac1 |
comparison
equal
deleted
inserted
replaced
10:4e2284e71352 | 11:4424b47a0797 |
---|---|
268 | 268 |
269 #ifdef FEAT_INS_EXPAND | 269 #ifdef FEAT_INS_EXPAND |
270 ins_compl_clear(); /* clear stuff for CTRL-X mode */ | 270 ins_compl_clear(); /* clear stuff for CTRL-X mode */ |
271 #endif | 271 #endif |
272 | 272 |
273 #ifdef FEAT_AUTOCMD | |
274 /* | |
275 * Trigger InsertEnter autocommands. Do not do this for "r<CR>" or "grx". | |
276 */ | |
277 if (cmdchar != 'r' && cmdchar != 'v') | |
278 { | |
279 if (cmdchar == 'R') | |
280 ptr = (char_u *)"r"; | |
281 else if (cmdchar == 'V') | |
282 ptr = (char_u *)"v"; | |
283 else | |
284 ptr = (char_u *)"i"; | |
285 set_vim_var_string(VV_INSERTMODE, ptr, 1); | |
286 apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf); | |
287 } | |
288 #endif | |
289 | |
273 #ifdef FEAT_MOUSE | 290 #ifdef FEAT_MOUSE |
274 /* | 291 /* |
275 * When doing a paste with the middle mouse button, Insstart is set to | 292 * When doing a paste with the middle mouse button, Insstart is set to |
276 * where the paste started. | 293 * where the paste started. |
277 */ | 294 */ |
723 beep_flush(); | 740 beep_flush(); |
724 EMSG(farsi_text_3); /* encoded in Farsi */ | 741 EMSG(farsi_text_3); /* encoded in Farsi */ |
725 break; | 742 break; |
726 } | 743 } |
727 #endif | 744 #endif |
745 #ifdef FEAT_AUTOCMD | |
746 set_vim_var_string(VV_INSERTMODE, | |
747 (char_u *)((State & REPLACE_FLAG) ? "i" : | |
748 replaceState == VREPLACE ? "v" : "r"), 1); | |
749 apply_autocmds(EVENT_INSERTCHANGE, NULL, NULL, FALSE, curbuf); | |
750 #endif | |
728 if (State & REPLACE_FLAG) | 751 if (State & REPLACE_FLAG) |
729 State = INSERT | (State & LANGMAP); | 752 State = INSERT | (State & LANGMAP); |
730 else | 753 else |
731 State = replaceState | (State & LANGMAP); | 754 State = replaceState | (State & LANGMAP); |
732 AppendCharToRedobuff(K_INS); | 755 AppendCharToRedobuff(K_INS); |
857 * still puts the cursor back after the inserted text. */ | 880 * still puts the cursor back after the inserted text. */ |
858 if (o_eol && gchar_cursor() == NUL) | 881 if (o_eol && gchar_cursor() == NUL) |
859 o_lnum = curwin->w_cursor.lnum; | 882 o_lnum = curwin->w_cursor.lnum; |
860 | 883 |
861 if (ins_esc(&count, cmdchar)) | 884 if (ins_esc(&count, cmdchar)) |
885 { | |
886 #ifdef FEAT_AUTOCMD | |
887 if (cmdchar != 'r' && cmdchar != 'v') | |
888 apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, | |
889 FALSE, curbuf); | |
890 #endif | |
862 return (c == Ctrl_O); | 891 return (c == Ctrl_O); |
892 } | |
863 continue; | 893 continue; |
864 | 894 |
865 /* | 895 /* |
866 * Insert the previously inserted text. | 896 * Insert the previously inserted text. |
867 * For ^@ the trailing ESC will end the insert, unless there is an | 897 * For ^@ the trailing ESC will end the insert, unless there is an |