vim-patch:9.1.0644: Unnecessary STRLEN() when applying mapping (#29921)

Problem:  Unnecessary STRLEN() when applying mapping.
          (after v9.1.0642)
Solution: Use m_keylen and vim_strnsave().
          (zeertzjq)

closes: vim/vim#15394

74011dc1fa
This commit is contained in:
zeertzjq
2024-07-31 06:21:55 +08:00
committed by GitHub
parent 617810d72d
commit 63cd2adf3d
2 changed files with 9 additions and 6 deletions

View File

@@ -1694,11 +1694,11 @@ func Test_map_rhs_starts_with_lhs()
endif
let @a = 'foo'
call feedkeys("S\<C-R>a", 'tx')
call assert_nobeep('call feedkeys("S\<C-R>a", "tx")')
call assert_equal('foo', getline('.'))
let @a = 'bar'
call feedkeys("S\<*C-R>a", 'tx')
call assert_nobeep('call feedkeys("S\<*C-R>a", "tx")')
call assert_equal('bar', getline('.'))
endfor
endfor