diff src/ops.c @ 12996:973a0037f4c3 v8.0.1374

patch 8.0.1374: CTRL-A does not work with an empty line commit https://github.com/vim/vim/commit/5fe6bdf858a7f2f288d599ffb5efb3c08449c817 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 5 17:22:12 2017 +0100 patch 8.0.1374: CTRL-A does not work with an empty line Problem: CTRL-A does not work with an empty line. (Alex) Solution: Decrement the end only once. (Hirohito Higashi, closes https://github.com/vim/vim/issues/2387)
author Christian Brabandt <cb@256bit.org>
date Tue, 05 Dec 2017 17:30:05 +0100
parents d1cbe8cb05d0
children 6e81a68d63a1
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -5433,7 +5433,7 @@ op_addsub(
 	    }
 	    else /* oap->motion_type == MCHAR */
 	    {
-		if (!oap->inclusive)
+		if (pos.lnum == oap->start.lnum && !oap->inclusive)
 		    dec(&(oap->end));
 		length = (colnr_T)STRLEN(ml_get(pos.lnum));
 		pos.col = 0;