Repository: neovim/neovim
File: test/functional/ui/float_spec.lua (Lua)

Code before:

      -- don't use winborder when reconfig a floating window
      -- still show a single border
      config.border = nil
      api.nvim_win_set_config(winid, config)
      eq('┌', api.nvim_win_get_config(winid).border[1])
      command('fclose!')

      command('set winborder=bold')
      winid = api.nvim_open_win(buf, false, config)
      eq('┏', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=+,-,+,\|,+,-,+,\|]])
      winid = api.nvim_open_win(buf, false, config)
      eq('+', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=●,○,●,○,●,○,●,○]])
      winid = api.nvim_open_win(buf, false, config)
      eq('●', api.nvim_win_get_config(winid).border[1])

      eq('Vim(set):E474: Invalid argument: winborder=,,', pcall_err(command, 'set winborder=,,'))
      eq('Vim(set):E474: Invalid argument: winborder=+,-,+,|,+,-,+,', pcall_err(command, [[set winborder=+,-,+,\|,+,-,+,]]))
      eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
    end)

    it('cursor shape when the cursor is covered by a floating window #test', function()
      local normal_win = api.nvim_get_current_win()
      api.nvim_buf_set_lines(0, 0, -1, true, { 'one', 'two' })
      api.nvim_win_set_cursor(0, { 2, 2 })
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'the only line' })
      local win = api.nvim_open_win(buf, false, { relative = 'editor', row = 0, col = 0, height = 2, width = 20 })
      if multigrid then
        screen:expect({
          grid = [[
          ## grid 1
            [2:----------------------------------------]|*6
            [3:----------------------------------------]|
          ## grid 2
            one                                     |
            tw^o                                     |
            {0:~                                       }|*4
          ## grid 3
                                                    |
          ## grid 4
            {1:the only line       }|
            {1:                    }|
          ]],
          win_pos = {
            [2] = { height = 6, startcol = 0, startrow = 0, width = 40, win = 1000 },
          },

Review comment (suggestion):
```suggestion
    it('cursor shape when the cursor is covered by a floating window', function()
```

Code after:

      -- don't use winborder when reconfig a floating window
      -- still show a single border
      config.border = nil
      api.nvim_win_set_config(winid, config)
      eq('┌', api.nvim_win_get_config(winid).border[1])
      command('fclose!')

      command('set winborder=bold')
      winid = api.nvim_open_win(buf, false, config)
      eq('┏', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=+,-,+,\|,+,-,+,\|]])
      winid = api.nvim_open_win(buf, false, config)
      eq('+', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=●,○,●,○,●,○,●,○]])
      winid = api.nvim_open_win(buf, false, config)
      eq('●', api.nvim_win_get_config(winid).border[1])

      eq('Vim(set):E474: Invalid argument: winborder=,,', pcall_err(command, 'set winborder=,,'))
      eq('Vim(set):E474: Invalid argument: winborder=+,-,+,|,+,-,+,', pcall_err(command, [[set winborder=+,-,+,\|,+,-,+,]]))
      eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
    end)

    it('cursor shape when the cursor is covered by a floating window', function()
      local normal_win = api.nvim_get_current_win()
      api.nvim_buf_set_lines(0, 0, -1, true, { 'one', 'two' })
      api.nvim_win_set_cursor(0, { 2, 2 })
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'the only line' })
      local win = api.nvim_open_win(buf, false, { relative = 'editor', row = 0, col = 0, height = 2, width = 20 })
      if multigrid then
        screen:expect({
          grid = [[
          ## grid 1
            [2:----------------------------------------]|*6
            [3:----------------------------------------]|
          ## grid 2
            one                                     |
            tw^o                                     |
            {0:~                                       }|*4
          ## grid 3
                                                    |
          ## grid 4
            {1:the only line       }|
            {1:                    }|
          ]],
          win_pos = {
            [2] = { height = 6, startcol = 0, startrow = 0, width = 40, win = 1000 },
          },