Advertisement
Guest User

Untitled

a guest
May 17th, 2013
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. #ifdef FEAT_AUTOCMD
  2.     /*
  3.      * Trigger InsertEnter autocommands.  Do not do this for "r<CR>" or "grx".
  4.      */
  5.     if (cmdchar != 'r' && cmdchar != 'v')
  6.     {
  7.     pos_T   save_cursor = curwin->w_cursor;
  8.  
  9. # ifdef FEAT_EVAL
  10.     if (cmdchar == 'R')
  11.         ptr = (char_u *)"r";
  12.     else if (cmdchar == 'V')
  13.         ptr = (char_u *)"v";
  14.     else
  15.         ptr = (char_u *)"i";
  16.     set_vim_var_string(VV_INSERTMODE, ptr, 1);
  17. # endif
  18.     apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
  19.  
  20.     /* Since Insert mode was not started yet a call to check_cursor_col()
  21.      * may have moved the cursor, especially with the "A" command. */
  22.     if (curwin->w_cursor.col != save_cursor.col
  23.         && curwin->w_cursor.lnum == save_cursor.lnum)
  24.     {
  25.         int save_state = State;
  26.  
  27.         curwin->w_cursor = save_cursor;
  28.         State = INSERT;
  29.         check_cursor_col();
  30.         State = save_state;
  31.     }
  32.     }
  33. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement