comparison src/ops.c @ 3093:d68f20a86a3e v7.3.318

updated for version 7.3.318 Problem: "C" on the last line deletes that line if it's blank. Solution: Only delete the last line for a delete operation. (James Vega)
author Bram Moolenaar <bram@vim.org>
date Wed, 21 Sep 2011 17:33:53 +0200
parents b9182da84c7e
children 80c529a5650f
comparison
equal deleted inserted replaced
3092:f33e01c96cc1 3093:d68f20a86a3e
1920 /* When deleted a char in the line, reset coladd. */ 1920 /* When deleted a char in the line, reset coladd. */
1921 if (gchar_cursor() != NUL) 1921 if (gchar_cursor() != NUL)
1922 curwin->w_cursor.coladd = 0; 1922 curwin->w_cursor.coladd = 0;
1923 } 1923 }
1924 #endif 1924 #endif
1925 if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count 1925 if (oap->op_type == OP_DELETE
1926 && oap->inclusive
1927 && oap->end.lnum == curbuf->b_ml.ml_line_count
1926 && n > (int)STRLEN(ml_get(oap->end.lnum))) 1928 && n > (int)STRLEN(ml_get(oap->end.lnum)))
1927 { 1929 {
1928 /* Special case: gH<Del> deletes the last line. */ 1930 /* Special case: gH<Del> deletes the last line. */
1929 del_lines(1L, FALSE); 1931 del_lines(1L, FALSE);
1930 } 1932 }
3329 y_type = MCHAR; 3331 y_type = MCHAR;
3330 #ifdef FEAT_EVAL 3332 #ifdef FEAT_EVAL
3331 if (regname == '=') 3333 if (regname == '=')
3332 { 3334 {
3333 /* For the = register we need to split the string at NL 3335 /* For the = register we need to split the string at NL
3334 * characters. */ 3336 * characters.
3335 /* Loop twice: count the number of lines and save them. */ 3337 * Loop twice: count the number of lines and save them. */
3336 for (;;) 3338 for (;;)
3337 { 3339 {
3338 y_size = 0; 3340 y_size = 0;
3339 ptr = insert_string; 3341 ptr = insert_string;
3340 while (ptr != NULL) 3342 while (ptr != NULL)
3346 if (ptr != NULL) 3348 if (ptr != NULL)
3347 { 3349 {
3348 if (y_array != NULL) 3350 if (y_array != NULL)
3349 *ptr = NUL; 3351 *ptr = NUL;
3350 ++ptr; 3352 ++ptr;
3351 /* A trailing '\n' makes the string linewise */ 3353 /* A trailing '\n' makes the register linewise. */
3352 if (*ptr == NUL) 3354 if (*ptr == NUL)
3353 { 3355 {
3354 y_type = MLINE; 3356 y_type = MLINE;
3355 break; 3357 break;
3356 } 3358 }