[BACK]Return to normal.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / vim

Diff for /src/usr.bin/vim/Attic/normal.c between version 1.3 and 1.4

version 1.3, 1996/09/22 01:18:06 version 1.4, 1996/09/26 14:13:07
Line 948 
Line 948 
           case K_S_RIGHT:            case K_S_RIGHT:
                 op_inclusive = FALSE;                  op_inclusive = FALSE;
                 flag = TRUE;                  flag = TRUE;
   
                 /*                  /*
                  * This is a little strange. To match what the real vi does, we                   * "cw" and "cW" are a special case.
                  * effectively map 'cw' to 'ce', and 'cW' to 'cE', provided that we  
                  * are not on a space or a TAB. This seems impolite at first, but it's  
                  * really more what we mean when we say 'cw'.  
                  * Another strangeness: When standing on the end of a word "ce" will  
                  * change until the end of the next wordt, but "cw" will change only  
                  * one character! This is done by setting type to 2.  
                  */                   */
                 if (op_type == CHANGE && (n = gchar_cursor()) != ' ' && n != TAB &&                  if (op_type == CHANGE)
                                                                                                                                 n != NUL)  
                 {                  {
                         op_inclusive = TRUE;                          n = gchar_cursor();
                         flag = FALSE;                          if (n != NUL)                                   /* not an empty line */
                         flag2 = TRUE;                          {
                                   op_inclusive = TRUE;
                                   if (vim_iswhite(n))
                                   {
                                           /*
                                            * Reproduce a funny Vi behaviour: "cw" on a blank only
                                            * changes one character, not all blanks until the start
                                            * of the next word.  Only do this when the 'w' flag is
                                            * included in 'cpoptions'.
                                            */
                                           if (Prenum1 == 1 && vim_strchr(p_cpo, CPO_CW) != NULL)
                                           {
                                                   op_motion_type = MCHAR;
                                                   break;
                                           }
                                   }
                                   else
                                   {
                                           /*
                                            * This is a little strange. To match what the real vi
                                            * does, we effectively map 'cw' to 'ce', and 'cW' to
                                            * 'cE', provided that we are not on a space or a TAB.
                                            * This seems impolite at first, but it's really more what
                                            * we mean when we say 'cw'.
                                            * Another strangeness: When standing on the end of a word
                                            * "ce" will change until the end of the next wordt, but
                                            * "cw" will change only one character! This is done by
                                            * setting flag2.
                                            */
                                           flag = FALSE;
                                           flag2 = TRUE;
                                   }
                           }
                 }                  }
   
 dowrdcmd:  dowrdcmd:

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4