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

Code before:
        [23] = { blend = 100, bold = true, foreground = Screen.colors.Magenta },
        [24] = { foreground = tonumber('0x7f007f'), bold = true, background = Screen.colors.White },
        [25] = { foreground = tonumber('0x7f007f'), bold = true, background = Screen.colors.Grey90 },
        [26] = { foreground = Screen.colors.Black },
        [27] = { bold = true, foreground = tonumber('0x7f007f') },
        [28] = { foreground = tonumber('0x990000') },
        [29] = { foreground = Screen.colors.Gray20 },
        [30] = { bold = true, foreground = tonumber('0x00007f') },
        [31] = { foreground = Screen.colors.Red, blend = 80 },
        [32] = { foreground = Screen.colors.Blue1, blend = 100, bold = true },
        [33] = { foreground = Screen.colors.Gray0, underline = true },
        [34] = { underline = true },
      })
      insert([[
        Lorem ipsum dolor sit amet, consectetur
        adipisicing elit, sed do eiusmod tempor
        incididunt ut labore et dolore magna aliqua.
        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
        qui officia deserunt mollit anim id est
        laborum.]])
      curbuf = api.nvim_get_current_buf()
      local buf = api.nvim_create_buf(false, false)
      local test_data = { 'test', '', 'popup    text' }
      api.nvim_buf_set_lines(buf, 0, -1, true, test_data)
      local win = api.nvim_open_win(buf, false, { relative = 'editor', width = 15, height = 3, row = 2, col = 5 })
      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    |
          qui officia deserunt mollit anim id est           |
          laborum^.                                          |
        ## grid 3
                                                            |
        ## grid 4
          {1:test           }|
          {1:               }|
          {1:popup    text  }|

Review comment (suggestion):
in the rest of this file, curbuf is a function, so reassigning it to a different type is confusing.
```suggestion
      local curbufnr = curbuf()
```

Code after:
        [23] = { blend = 100, bold = true, foreground = Screen.colors.Magenta },
        [24] = { foreground = tonumber('0x7f007f'), bold = true, background = Screen.colors.White },
        [25] = { foreground = tonumber('0x7f007f'), bold = true, background = Screen.colors.Grey90 },
        [26] = { foreground = Screen.colors.Black },
        [27] = { bold = true, foreground = tonumber('0x7f007f') },
        [28] = { foreground = tonumber('0x990000') },
        [29] = { foreground = Screen.colors.Gray20 },
        [30] = { bold = true, foreground = tonumber('0x00007f') },
        [31] = { foreground = Screen.colors.Red, blend = 80 },
        [32] = { foreground = Screen.colors.Blue1, blend = 100, bold = true },
        [33] = { foreground = Screen.colors.Gray0, underline = true },
        [34] = { underline = true },
      })
      insert([[
        Lorem ipsum dolor sit amet, consectetur
        adipisicing elit, sed do eiusmod tempor
        incididunt ut labore et dolore magna aliqua.
        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
        qui officia deserunt mollit anim id est
        laborum.]])
      local curbufnr = api.nvim_get_current_buf()
      local buf = api.nvim_create_buf(false, false)
      local test_data = { 'test', '', 'popup    text' }
      api.nvim_buf_set_lines(buf, 0, -1, true, test_data)
      local win = api.nvim_open_win(buf, false, { relative = 'editor', width = 15, height = 3, row = 2, col = 5 })
      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    |
          qui officia deserunt mollit anim id est           |
          laborum^.                                          |
        ## grid 3
                                                            |
        ## grid 4
          {1:test           }|
          {1:               }|
          {1:popup    text  }|