diff --git a/src/getchar.c b/src/getchar.c index c0dfc2b0b8997..49eb3d7df9e86 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -252,8 +252,11 @@ add_buff( static void delete_buff_tail(buffheader_T *buf, int slen) { - int len = (int)STRLEN(buf->bh_curr->b_str); + int len; + if (buf->bh_curr == NULL || buf->bh_curr->b_str == NULL) + return; // nothing to delete + len = (int)STRLEN(buf->bh_curr->b_str); if (len >= slen) { buf->bh_curr->b_str[len - slen] = NUL; diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index bbc7c1911d2bd..89d9d7cad7c46 100644 --- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -739,6 +739,15 @@ func Test_record_in_insert_mode() bwipe! endfunc +func Test_record_in_select_mode() + new + call setline(1, 'text') + sil norm q00 + sil norm q + call assert_equal('0ext', getline(1)) + bwipe! +endfunc + " Make sure that y_append is correctly reset " and the previous register is working as expected func Test_register_y_append_reset() diff --git a/src/version.c b/src/version.c index 2f872e98110e4..bc956cee0a66a 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4233, /**/ 4232, /**/