Mercurial > vim
comparison src/testdir/test_edit.vim @ 25786:ec62e0764ffa v8.2.3428
patch 8.2.3428: using freed memory when replacing
Commit: https://github.com/vim/vim/commit/35a9a00afcb20897d462a766793ff45534810dc3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 11 21:14:20 2021 +0200
patch 8.2.3428: using freed memory when replacing
Problem: Using freed memory when replacing. (Dhiraj Mishra)
Solution: Get the line pointer after calling ins_copychar().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Sep 2021 21:15:03 +0200 |
parents | 4c1b6f3eb96b |
children | 16a7d1154be8 |
comparison
equal
deleted
inserted
replaced
25785:468662f24b0a | 25786:ec62e0764ffa |
---|---|
1893 call assert_equal(['one two three', 'ruof'], getline(1, '$')) | 1893 call assert_equal(['one two three', 'ruof'], getline(1, '$')) |
1894 set revins& | 1894 set revins& |
1895 bw! | 1895 bw! |
1896 endfunc | 1896 endfunc |
1897 | 1897 |
1898 " Test for getting the character of the line below after "p" | |
1899 func Test_edit_put_CTRL_E() | |
1900 set encoding=latin1 | |
1901 new | |
1902 let @" = '' | |
1903 sil! norm orggRx | |
1904 sil! norm pr | |
1905 call assert_equal(['r', 'r'], getline(1, 2)) | |
1906 bwipe! | |
1907 set encoding=utf-8 | |
1908 endfunc | |
1909 | |
1898 " vim: shiftwidth=2 sts=2 expandtab | 1910 " vim: shiftwidth=2 sts=2 expandtab |