HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/ubuntu/neovim/test/functional/legacy/038_virtual_replace_spec.lua
-- Test Virtual replace mode.

local n = require('test.functional.testnvim')()

local feed = n.feed
local clear, feed_command, expect = n.clear, n.feed_command, n.expect

describe('Virtual replace mode', function()
  setup(clear)

  -- luacheck: ignore 621 (Indentation)
  it('is working', function()
    -- Make sure that backspace works, no matter what termcap is used.
    feed_command('set t_kD=x7f t_kb=x08')
    -- Use vi default for 'smarttab'
    feed_command('set nosmarttab')
    feed('ggdGa<cr>')
    feed('abcdefghi<cr>')
    feed('jk<tab>lmn<cr>')
    feed('<Space><Space><Space><Space>opq<tab>rst<cr>')
    feed('<C-d>uvwxyz<cr>')
    feed('<esc>gg')
    feed_command('set ai')
    feed_command('set bs=2')
    feed('gR0<C-d> 1<cr>')
    feed('A<cr>')
    feed('BCDEFGHIJ<cr>')
    feed('<tab>KL<cr>')
    feed('MNO<cr>')
    feed('PQR<esc>G')
    feed_command('ka')
    feed('o0<C-d><cr>')
    feed('abcdefghi<cr>')
    feed('jk<tab>lmn<cr>')
    feed('<Space><Space><Space><Space>opq<tab>rst<cr>')
    feed('<C-d>uvwxyz<cr>')
    feed([[<esc>'ajgR0<C-d> 1<cr>]])
    feed('A<cr>')
    feed('BCDEFGHIJ<cr>')
    feed('<tab>KL<cr>')
    feed('MNO<cr>')
    feed(
      'PQR<C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><C-h><esc>:$<cr>'
    )
    feed('iab<tab>cdefghi<tab>jkl<esc>0gRAB......CDEFGHI.J<esc>o<esc>:<cr>')
    feed('iabcdefghijklmnopqrst<esc>0gRAB<tab>IJKLMNO<tab>QR<esc>')

    -- Assert buffer contents.
    expect([=[
       1
       A
       BCDEFGHIJ
       	KL
      	MNO
      	PQR
       1
      abcdefghi
      jk	lmn
          opq	rst
      uvwxyz
      AB......CDEFGHI.Jkl
      AB	IJKLMNO	QRst]=])
  end)
end)