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

Code before:
        ## grid 4
          {17:┌}{23:Title}{17:──────────┐}|
          {17:│}{11:popup    text}{18:  }{17:│}|
          {17:│}{19:~              }{17:│}|*2
          {17:└}{23:Footer}{17:─────────┘}|
        ]],
          float_pos = { [4] = { 1001, 'NW', 1, 2, 5, true, 50, 1, 2, 5 } },
        }
      else
        screen:expect([[
          Ut enim ad minim veniam, quis nostrud             |
          exercitation ullamco laboris nisi ut aliquip ex   |
          ea co{26:┌}{27:Title}{26:──────────┐}Duis aute irure dolor in    |
          repre{26:│}{5:popup}{6:it i}{5:text}{20:lu}{26:│}tate velit esse cillum      |
          dolor{26:│}{21:~}{20:eu fugiat null}{26:│} pariatur. Excepteur sint   |
          occae{26:│}{21:~}{20:t cupidatat no}{26:│} proident, sunt in culpa    |
          {16:^qui o}{22:└}{25:Footer}{22:─────────┘}{16:ollit anim id est           }|
          laborum.                                          |
                                                            |
        ]])
      end

      -- issue #18576
      command('hi Nomral guibg=NONE ctermbg=NONE')
      api.nvim_win_set_option(win, 'winhighlight', 'Normal:Normal')
      api.nvim_set_option_value('winblend', 100, { win = win })
      if multigrid then
        screen:expect({
          grid = [[
          ## grid 1
            [2:--------------------------------------------------]|*8
            [3:--------------------------------------------------]|
          ## grid 2
            Ut enim ad minim veniam, quis nostrud             |
            exercitation ullamco laboris nisi ut aliquip ex   |
            ea commodo consequat. Duis aute irure dolor in    |
            reprehenderit in voluptate velit esse cillum      |
            dolore eu fugiat nulla pariatur. Excepteur sint   |
            occaecat cupidatat non proident, sunt in culpa    |
            {16:^qui officia deserunt mollit anim id est           }|
            laborum.                                          |
          ## grid 3
                                                              |
          ## grid 4
            {17:┌}{23:Title}{17:──────────┐}|
            {17:│}{31:popup    text}{17:  │}|
            {17:│}{32:~              }{17:│}|*2
            {17:└}{23:Footer}{17:─────────┘}|
          ]],
          win_pos = {
            [2] = {

Review comment (suggestion):
can this be added to the `Check that 'winblend' applies to border/title/footer` test case above? The two test cases don't seem to conflict with each other. That would avoid 70 lines of new test code.

Code after:
          ## grid 3
                                                              |
          ## grid 4
            {17:┌}{23:Title}{17:──────────┐}|
            {17:│}{31:popup    text}{17:  │}|
            {17:│}{32:~              }{17:│}|*2
            {17:└}{23:Footer}{17:─────────┘}|
          ]],
          win_pos = { [2] = { height = 8, startcol = 0, startrow = 0, width = 50, win = 1000 } },
          float_pos = { [4] = { 1001, 'NW', 1, 2, 5, true, 50, 1, 2, 5 } },
          win_viewport = {
            [2] = { win = 1000, topline = 3, botline = 11, curline = 9, curcol = 0, linecount = 11, sum_scroll_delta = 3 },
            [4] = { win = 1001, topline = 2, botline = 4, curline = 2, curcol = 7, linecount = 3, sum_scroll_delta = 2 },
          },
          win_viewport_margins = {
            [2] = { bottom = 0, left = 0, right = 0, top = 0, win = 1000 },
            [4] = { bottom = 1, left = 1, right = 1, top = 1, win = 1001 },
          },
        })
      else
        screen:expect([[
          Ut enim ad minim veniam, quis nostrud             |
          exercitation ullamco laboris nisi ut aliquip ex   |
          ea co{26:┌}{27:Title}{26:──────────┐}Duis aute irure dolor in    |
          repre{26:│}{28:popup}{29:it i}{28:text}{26:lu│}tate velit esse cillum      |
          dolor{26:│}{30:~}{26:eu fugiat null│} pariatur. Excepteur sint   |
          occae{26:│}{30:~}{26:t cupidatat no│} proident, sunt in culpa    |
          {16:^qui o}{22:└}{25:Footer}{22:─────────┘}{16:ollit anim id est           }|
          laborum.                                          |
                                                            |
        ]])
      end
    end)

    it('can overlap doublewidth chars', function()
      insert([[
        # TODO: 测试字典信息的准确性
        # FIXME: 测试字典信息的准确性]])
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, -1, true, { '口', '口' })
      local win = api.nvim_open_win(buf, false, { relative = 'editor', width = 5, height = 3, row = 0, col = 11, style = 'minimal' })
      if multigrid then
        screen:expect {
          grid = [[
        ## grid 1
          [2:----------------------------------------]|*6
          [3:----------------------------------------]|
        ## grid 2
          # TODO: 测试字典信息的准确性            |
          # FIXME: 测试字典信息的准确^性           |
          {0:~                                       }|*4