ronantakizawa/codereview-bench huggingface dataset:
Repository: neovim/neovim
File: src/nvim/eval.c (C)

Code before:
      // Invalid column number.
      return NULL;
    }
    pos.col--;

    // Get the virtual offset.  Defaults to zero.
    pos.coladd = (colnr_T)tv_list_find_nr(l, 2, &error);
    if (error) {
      pos.coladd = 0;
    }

    return &pos;
  }

  const char *const name = tv_get_string_chk(tv);
  if (name == NULL) {
    return NULL;
  }

  pos.lnum = 0;
  if (name[0] == '.') {
    // cursor
    pos = wp->w_cursor;
  } else if (name[0] == 'v' && name[1] == NUL) {
    // Visual start
    if (VIsual_active) {
      pos = VIsual;
    } else {
      pos = wp->w_cursor;
    }
  } else if (name[0] == '\'') {
    // mark
    int mname = (uint8_t)name[1];
    const fmark_T *const fm = mark_get(bp, wp, NULL, kMarkAll, mname);
    if (fm == NULL || fm->mark.lnum <= 0) {
      return NULL;
    }
    pos = fm->mark;
    // Vimscript behavior, only provide fnum if mark is global.
    *ret_fnum = ASCII_ISUPPER(mname) || ascii_isdigit(mname) ? fm->fnum : *ret_fnum;
  }
  if (pos.lnum != 0) {
    if (charcol) {
      pos.col = buf_byteidx_to_charidx(bp, pos.lnum, pos.col);
    }
    return &pos;
  }

  pos.coladd = 0;

  if (name[0] == 'w' && dollar_lnum) {

Review comment (suggestion):
```suggestion
    if (VIsual_active && wp == curwin) {
```

Code after:
      // Invalid column number.
      return NULL;
    }
    pos.col--;

    // Get the virtual offset.  Defaults to zero.
    pos.coladd = (colnr_T)tv_list_find_nr(l, 2, &error);
    if (error) {
      pos.coladd = 0;
    }

    return &pos;
  }

  const char *const name = tv_get_string_chk(tv);
  if (name == NULL) {
    return NULL;
  }

  pos.lnum = 0;
  if (name[0] == '.') {
    // cursor
    pos = wp->w_cursor;
  } else if (name[0] == 'v' && name[1] == NUL) {
    // Visual start
    if (VIsual_active && wp == curwin) {
      pos = VIsual;
    } else {
      pos = wp->w_cursor;
    }
  } else if (name[0] == '\'') {
    // mark
    int mname = (uint8_t)name[1];
    const fmark_T *const fm = mark_get(bp, wp, NULL, kMarkAll, mname);
    if (fm == NULL || fm->mark.lnum <= 0) {
      return NULL;
    }
    pos = fm->mark;
    // Vimscript behavior, only provide fnum if mark is global.
    *ret_fnum = ASCII_ISUPPER(mname) || ascii_isdigit(mname) ? fm->fnum : *ret_fnum;
  }
  if (pos.lnum != 0) {
    if (charcol) {
      pos.col = buf_byteidx_to_charidx(bp, pos.lnum, pos.col);
    }
    return &pos;
  }

  pos.coladd = 0;

  if (name[0] == 'w' && dollar_lnum) {
Repository: neovim/neovim
File: src/nvim/autocmd.c (C)

Code before:
  } else {
    ac->handler_cmd = NULL;
    callback_copy(&ac->handler_fn, handler_fn);
  }
  ac->script_ctx = current_sctx;
  ac->script_ctx.sc_lnum += SOURCING_LNUM;
  nlua_set_sctx(&ac->script_ctx);
  ac->once = once;
  ac->nested = nested;
  ac->desc = desc == NULL ? NULL : xstrdup(desc);

  return OK;
}

size_t aucmd_span_pattern(const char *pat, const char **start)
  FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
  // Skip leading commas.
  while (*pat == ',') {
    pat++;
  }

  // Find end of the pattern.
  // Watch out for a comma in braces, like "*.\{obj,o\}".
  const char *p = pat;
  for (int brace_level = 0; *p && (*p != ',' || brace_level || (p > pat && p[-1] == '\\')); p++) {
    if (*p == '{') {
      brace_level++;
    } else if (*p == '}') {
      brace_level--;
    }
  }

  *start = pat;
  return (size_t)(p - pat);
}

/// Implementation of ":doautocmd [group] event [fname]".
/// Return OK for success, FAIL for failure;
///
/// @param do_msg  give message for no matching autocmds?
int do_doautocmd(char *arg_start, bool do_msg, bool *did_something)
{
  char *arg = arg_start;
  int nothing_done = true;

  if (did_something != NULL) {
    *did_something = false;
  }

  // Check for a legal group name.  If not, use AUGROUP_ALL.

Review comment (suggestion):
I'd prefer initializing `brace_level` before the `for`. It just feels a bit strange to initialize it in the `for` init statement when `p` is initialized before the `for`.
```suggestion
  const char *p = pat;
  int brace_level = 0;
  for (; *p && (*p != ',' || brace_level || (p > pat && p[-1] == '\\')); p++) {
```

Code after:
  } else {
    ac->handler_cmd = NULL;
    callback_copy(&ac->handler_fn, handler_fn);
  }
  ac->script_ctx = current_sctx;
  ac->script_ctx.sc_lnum += SOURCING_LNUM;
  nlua_set_sctx(&ac->script_ctx);
  ac->once = once;
  ac->nested = nested;
  ac->desc = desc == NULL ? NULL : xstrdup(desc);

  return OK;
}

size_t aucmd_span_pattern(const char *pat, const char **start)
  FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
  // Skip leading commas.
  while (*pat == ',') {
    pat++;
  }

  // Find end of the pattern.
  // Watch out for a comma in braces, like "*.\{obj,o\}".
  const char *p = pat;
  int brace_level = 0;
  for (; *p && (*p != ',' || brace_level || (p > pat && p[-1] == '\\')); p++) {
    if (*p == '{') {
      brace_level++;
    } else if (*p == '}') {
      brace_level--;
    }
  }

  *start = pat;
  return (size_t)(p - pat);
}

/// Implementation of ":doautocmd [group] event [fname]".
/// Return OK for success, FAIL for failure;
///
/// @param do_msg  give message for no matching autocmds?
int do_doautocmd(char *arg_start, bool do_msg, bool *did_something)
{
  char *arg = arg_start;
  int nothing_done = true;

  if (did_something != NULL) {
    *did_something = false;
  }
Repository: neovim/neovim
File: src/nvim/popupmenu.c (C)

Code before:
  win_config_float(wp, wp->w_config);
  return true;
}

/// Used for nvim__complete_set
///
/// @param selected the selected compl item.
/// @param info     Info string.
/// @return a win_T pointer.
win_T *pum_set_info(int selected, char *info)
{
  if (!pum_is_visible || !compl_match_curr_select(selected)) {
    return NULL;
  }
  block_autocmds();
  RedrawingDisabled++;
  no_u_sync++;
  win_T *wp = win_float_find_preview();
  if (wp == NULL) {
    wp = win_float_create(false, true);
    if (!wp) {
      return NULL;
    }
    wp->w_topline = 1;
    wp->w_p_wfb = true;
    wp->w_buffer->b_p_ts = curbuf->b_p_ts;
  }
  linenr_T lnum = 0;
  int max_info_width = 0;
  pum_preview_set_text(wp, info, &lnum, &max_info_width);
  no_u_sync--;
  RedrawingDisabled--;
  redraw_later(wp, UPD_NOT_VALID);

  if (!pum_adjust_info_position(wp, max_info_width)) {
    wp = NULL;
  }
  unblock_autocmds();
  return wp;
}

/// Set the index of the currently selected item.  The menu will scroll when
/// necessary.  When "n" is out of range don't scroll.
/// This may be repeated when the preview window is used:
/// "repeat" == 0: open preview window normally
/// "repeat" == 1: open preview window but don't set the size
/// "repeat" == 2: don't open preview window
///
/// @param n
/// @param repeat
///

Review comment (suggestion):
```suggestion
```

I don't think it's worth only copying `&ts`; tab padding may also be affected by `&vts` (plus `&list` and `&lcs`).  
Also this code is only used by `nvim__complete_set`, so this change won't affect the info popup in the usual case. (`pum_set_selected`)

I think it's OK to not copy anything and just leave the buffer to use the global values from when it's created.

Code after:
  win_config_float(wp, wp->w_config);
  return true;
}

/// Used for nvim__complete_set
///
/// @param selected the selected compl item.
/// @param info     Info string.
/// @return a win_T pointer.
win_T *pum_set_info(int selected, char *info)
{
  if (!pum_is_visible || !compl_match_curr_select(selected)) {
    return NULL;
  }
  block_autocmds();
  RedrawingDisabled++;
  no_u_sync++;
  win_T *wp = win_float_find_preview();
  if (wp == NULL) {
    wp = win_float_create(false, true);
    if (!wp) {
      return NULL;
    }
    wp->w_topline = 1;
    wp->w_p_wfb = true;
  }
  linenr_T lnum = 0;
  int max_info_width = 0;
  pum_preview_set_text(wp, info, &lnum, &max_info_width);
  no_u_sync--;
  RedrawingDisabled--;
  redraw_later(wp, UPD_NOT_VALID);

  if (!pum_adjust_info_position(wp, max_info_width)) {
    wp = NULL;
  }
  unblock_autocmds();
  return wp;
}

/// Set the index of the currently selected item.  The menu will scroll when
/// necessary.  When "n" is out of range don't scroll.
/// This may be repeated when the preview window is used:
/// "repeat" == 0: open preview window normally
/// "repeat" == 1: open preview window but don't set the size
/// "repeat" == 2: don't open preview window
///
/// @param n
/// @param repeat
///
/// @returns true when the window was resized and the location of the popup
Repository: neovim/neovim
File: src/nvim/move.c (C)

Code before:
void changed_cline_bef_curs(win_T *wp)
{
  wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                   |VALID_CHEIGHT|VALID_TOPLINE);
}

// Call this function when the length of a line (in screen characters) above
// the cursor have changed.
// Need to take care of w_botline separately!
void changed_line_abv_curs(void)
{
  curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                       |VALID_CHEIGHT|VALID_TOPLINE);
}

void changed_line_abv_curs_win(win_T *wp)
{
  wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                   |VALID_CHEIGHT|VALID_TOPLINE);
}

/// Make sure the value of curwin->w_botline is valid.
void validate_botline(void)
{
  validate_botline_win(curwin);
}

/// Make sure the value of wp->w_botline is valid.
void validate_botline_win(win_T *wp)
  FUNC_ATTR_NONNULL_ALL
{
  if (!(wp->w_valid & VALID_BOTLINE)) {
    comp_botline(wp);
  }
}

/// Mark curwin->w_botline as invalid (because of some change in the buffer).
void invalidate_botline(void)
{
  invalidate_botline_win(curwin);
}

/// Mark wp->w_botline as invalid (because of some change in the buffer).
void invalidate_botline_win(win_T *wp)
  FUNC_ATTR_NONNULL_ALL
{
  wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
}

void approximate_botline_win(win_T *wp)
{

Review comment (suggestion):
We don't want these alias functions back. caller should spell out `curwin` if that is what is intended.

Code after:
void changed_cline_bef_curs(win_T *wp)
{
  wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                   |VALID_CHEIGHT|VALID_TOPLINE);
}

// Call this function when the length of a line (in screen characters) above
// the cursor have changed.
// Need to take care of w_botline separately!
void changed_line_abv_curs(void)
{
  curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                       |VALID_CHEIGHT|VALID_TOPLINE);
}

void changed_line_abv_curs_win(win_T *wp)
{
  wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
                   |VALID_CHEIGHT|VALID_TOPLINE);
}

/// Make sure the value of wp->w_botline is valid.
void validate_botline_win(win_T *wp)
  FUNC_ATTR_NONNULL_ALL
{
  if (!(wp->w_valid & VALID_BOTLINE)) {
    comp_botline(wp);
  }
}

/// Mark wp->w_botline as invalid (because of some change in the buffer).
void invalidate_botline_win(win_T *wp)
  FUNC_ATTR_NONNULL_ALL
{
  wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
}

void approximate_botline_win(win_T *wp)
{
  wp->w_valid &= ~VALID_BOTLINE;
}

// Return true if wp->w_wrow and wp->w_wcol are valid.
int cursor_valid(win_T *wp)
{
  check_cursor_moved(wp);
  return (wp->w_valid & (VALID_WROW|VALID_WCOL)) == (VALID_WROW|VALID_WCOL);
}

// Validate cursor position.  Makes sure w_wrow and w_wcol are valid.
// w_topline must be valid, you may need to call update_topline() first!
Repository: neovim/neovim
File: runtime/lua/vim/lsp/protocol.lua (Lua)

Code before:
  ['textDocument/inlayHint'] = true,
  ['textDocument/inlineCompletion'] = true,
  ['textDocument/inlineValue'] = true,
  ['textDocument/linkedEditingRange'] = true,
  ['textDocument/moniker'] = true,
  ['textDocument/onTypeFormatting'] = true,
  ['textDocument/prepareCallHierarchy'] = true,
  ['textDocument/prepareTypeHierarchy'] = true,
  ['textDocument/rangeFormatting'] = true,
  ['textDocument/references'] = true,
  ['textDocument/rename'] = true,
  ['textDocument/selectionRange'] = true,
  ['textDocument/semanticTokens/full'] = true,
  ['textDocument/signatureHelp'] = true,
  ['textDocument/typeDefinition'] = true,
  ['workspace/executeCommand'] = true,
  ['workspace/symbol'] = true,
}
-- stylua: ignore end

-- stylua: ignore start
-- Generated by gen_lsp.lua, keep at end of file.
-- These methods have no registration options but can still be registered dynamically.
protocol._methods_with_no_registration_options =
{
  ["workspace/didChangeWorkspaceFolders"] = true
}
-- stylua: ignore end

return protocol


Review comment (suggestion):
```suggestion
  ['workspace/didChangeWorkspaceFolders'] = true
```

Code after:
  ['textDocument/documentSymbol'] = true,
  ['textDocument/foldingRange'] = true,
  ['textDocument/formatting'] = true,
  ['textDocument/hover'] = true,
  ['textDocument/implementation'] = true,
  ['textDocument/inlayHint'] = true,
  ['textDocument/inlineCompletion'] = true,
  ['textDocument/inlineValue'] = true,
  ['textDocument/linkedEditingRange'] = true,
  ['textDocument/moniker'] = true,
  ['textDocument/onTypeFormatting'] = true,
  ['textDocument/prepareCallHierarchy'] = true,
  ['textDocument/prepareTypeHierarchy'] = true,
  ['textDocument/rangeFormatting'] = true,
  ['textDocument/references'] = true,
  ['textDocument/rename'] = true,
  ['textDocument/selectionRange'] = true,
  ['textDocument/semanticTokens/full'] = true,
  ['textDocument/signatureHelp'] = true,
  ['textDocument/typeDefinition'] = true,
  ['workspace/executeCommand'] = true,
  ['workspace/symbol'] = true,
}
-- stylua: ignore end

-- stylua: ignore start
-- Generated by gen_lsp.lua, keep at end of file.
-- These methods have no registration options but can still be registered dynamically.
protocol._methods_with_no_registration_options = {
  ['workspace/didChangeWorkspaceFolders'] = true ,
}
-- stylua: ignore end

return protocol
Repository: neovim/neovim
File: src/nvim/window.c (C)

Code before:
    // new window below/right of current one
    if (new_wp == NULL) {
      wp = win_alloc(oldwin, false);
    } else {
      win_append(oldwin, wp, NULL);
    }
  } else {
    if (new_wp == NULL) {
      wp = win_alloc(oldwin->w_prev, false);
    } else {
      win_append(oldwin->w_prev, wp, NULL);
    }
  }

  if (new_wp == NULL) {
    if (wp == NULL) {
      return NULL;
    }

    new_frame(wp);

    // make the contents of the new window the same as the current one
    win_init(wp, curwin, flags);
  } else if (wp->w_floating) {
    // Save the style before clearing config so it can be re-applied later
    WinStyle saved_style = wp->w_config.style;
    ui_comp_remove_grid(&wp->w_grid_alloc);
    if (ui_has(kUIMultigrid)) {
      wp->w_pos_changed = true;
    } else {
      // No longer a float, a non-multigrid UI shouldn't draw it as such
      ui_call_win_hide(wp->w_grid_alloc.handle);
      win_free_grid(wp, true);
    }

    // External windows are independent of tabpages, and may have been the curwin of others.
    if (wp->w_config.external) {
      FOR_ALL_TABS(tp) {
        if (tp != curtab && tp->tp_curwin == wp) {
          tp->tp_curwin = tp->tp_firstwin;
        }
      }
    }

    wp->w_floating = false;
    new_frame(wp);

    // non-floating window doesn't store float config or have a border.
    merge_win_config(&wp->w_config, WIN_CONFIG_INIT);
    CLEAR_FIELD(wp->w_border_adj);
    // Restore the style for later re-application

Review comment (suggestion):
```suggestion
    WinStyle saved_style = wp->w_config.style;
```

Code after:
    // new window below/right of current one
    if (new_wp == NULL) {
      wp = win_alloc(oldwin, false);
    } else {
      win_append(oldwin, wp, NULL);
    }
  } else {
    if (new_wp == NULL) {
      wp = win_alloc(oldwin->w_prev, false);
    } else {
      win_append(oldwin->w_prev, wp, NULL);
    }
  }

  if (new_wp == NULL) {
    if (wp == NULL) {
      return NULL;
    }

    new_frame(wp);

    // make the contents of the new window the same as the current one
    win_init(wp, curwin, flags);
  } else if (wp->w_floating) {
    WinStyle saved_style = wp->w_config.style;
    ui_comp_remove_grid(&wp->w_grid_alloc);
    if (ui_has(kUIMultigrid)) {
      wp->w_pos_changed = true;
    } else {
      // No longer a float, a non-multigrid UI shouldn't draw it as such
      ui_call_win_hide(wp->w_grid_alloc.handle);
      win_free_grid(wp, true);
    }

    // External windows are independent of tabpages, and may have been the curwin of others.
    if (wp->w_config.external) {
      FOR_ALL_TABS(tp) {
        if (tp != curtab && tp->tp_curwin == wp) {
          tp->tp_curwin = tp->tp_firstwin;
        }
      }
    }

    wp->w_floating = false;
    new_frame(wp);

    // non-floating window doesn't store float config or have a border.
    merge_win_config(&wp->w_config, WIN_CONFIG_INIT);
    CLEAR_FIELD(wp->w_border_adj);
    // Restore WinConfig style. #37067
    wp->w_config.style = saved_style;
Repository: neovim/neovim
File: src/nvim/window.c (C)

Code before:
    ui_comp_remove_grid(&wp->w_grid_alloc);
    if (ui_has(kUIMultigrid)) {
      wp->w_pos_changed = true;
    } else {
      // No longer a float, a non-multigrid UI shouldn't draw it as such
      ui_call_win_hide(wp->w_grid_alloc.handle);
      win_free_grid(wp, true);
    }

    // External windows are independent of tabpages, and may have been the curwin of others.
    if (wp->w_config.external) {
      FOR_ALL_TABS(tp) {
        if (tp != curtab && tp->tp_curwin == wp) {
          tp->tp_curwin = tp->tp_firstwin;
        }
      }
    }

    wp->w_floating = false;
    new_frame(wp);

    // non-floating window doesn't store float config or have a border.
    merge_win_config(&wp->w_config, WIN_CONFIG_INIT);
    CLEAR_FIELD(wp->w_border_adj);
    // Restore the style for later re-application
    wp->w_config.style = saved_style;
  }

  // Going to reorganize frames now, make sure they're flat.
  if (to_flatten != NULL) {
    frame_flatten(to_flatten);
  }

  bool before;
  frame_T *curfrp;

  // Reorganise the tree of frames to insert the new window.
  if (toplevel) {
    if ((topframe->fr_layout == FR_COL && !vertical)
        || (topframe->fr_layout == FR_ROW && vertical)) {
      curfrp = topframe->fr_child;
      if (flags & WSP_BOT) {
        while (curfrp->fr_next != NULL) {
          curfrp = curfrp->fr_next;
        }
      }
    } else {
      curfrp = topframe;
    }
    before = (flags & WSP_TOP);
  } else {

Review comment (suggestion):
```suggestion
    // Restore WinConfig style. #37067
    wp->w_config.style = saved_style;
```

Code after:
    ui_comp_remove_grid(&wp->w_grid_alloc);
    if (ui_has(kUIMultigrid)) {
      wp->w_pos_changed = true;
    } else {
      // No longer a float, a non-multigrid UI shouldn't draw it as such
      ui_call_win_hide(wp->w_grid_alloc.handle);
      win_free_grid(wp, true);
    }

    // External windows are independent of tabpages, and may have been the curwin of others.
    if (wp->w_config.external) {
      FOR_ALL_TABS(tp) {
        if (tp != curtab && tp->tp_curwin == wp) {
          tp->tp_curwin = tp->tp_firstwin;
        }
      }
    }

    wp->w_floating = false;
    new_frame(wp);

    // non-floating window doesn't store float config or have a border.
    merge_win_config(&wp->w_config, WIN_CONFIG_INIT);
    CLEAR_FIELD(wp->w_border_adj);
    // Restore WinConfig style. #37067
    wp->w_config.style = saved_style;
  }

  // Going to reorganize frames now, make sure they're flat.
  if (to_flatten != NULL) {
    frame_flatten(to_flatten);
  }

  bool before;
  frame_T *curfrp;

  // Reorganise the tree of frames to insert the new window.
  if (toplevel) {
    if ((topframe->fr_layout == FR_COL && !vertical)
        || (topframe->fr_layout == FR_ROW && vertical)) {
      curfrp = topframe->fr_child;
      if (flags & WSP_BOT) {
        while (curfrp->fr_next != NULL) {
          curfrp = curfrp->fr_next;
        }
      }
    } else {
      curfrp = topframe;
    }
    before = (flags & WSP_TOP);
  } else {
Repository: neovim/neovim
File: test/functional/lua/diagnostic_spec.lua (Lua)

Code before:
            valid = 0,
          },
          {
            bufnr = 1,
            lnum = 20,
            col = 1,
            end_lnum = 20,
            end_col = 5,
            text = 'warning: unused',
            type = 'W',
            nr = 0,
            valid = 1,
          },
        }
        return vim.diagnostic.fromqflist(qflist, { merge_lines = true })
      end)

      eq(2, #result)
      eq(
        "error: [GHC-83865]\n    Couldn't match expected type\n    with actual type",
        result[1].message
      )
      eq('warning: unused', result[2].message)
    end)

    it('ignores continuation lines by default', function()
      local result = exec_lua(function()
        local qflist = {
          {
            bufnr = 1,
            lnum = 10,
            col = 5,
            end_lnum = 10,
            end_col = 10,
            text = 'error: main',
            type = 'E',
            nr = 0,
            valid = 1,
          },
          {
            bufnr = 1,
            lnum = 0,
            col = 0,
            end_lnum = 0,
            end_col = 0,
            text = 'continuation',
            type = '',
            nr = 0,
            valid = 0,
          },
        }

Review comment (suggestion):
```suggestion
    it('merge_lines=false ignores continuation lines', function()
```

Code after:
            valid = 0,
          },
          {
            bufnr = 1,
            lnum = 20,
            col = 1,
            end_lnum = 20,
            end_col = 5,
            text = 'warning: unused',
            type = 'W',
            nr = 0,
            valid = 1,
          },
        }
        return vim.diagnostic.fromqflist(qflist, { merge_lines = true })
      end)

      eq(2, #result)
      eq(
        "error: [GHC-83865]\n    Couldn't match expected type\n    with actual type",
        result[1].message
      )
      eq('warning: unused', result[2].message)
    end)

    it('merge_lines=false ignores continuation lines', function()
      local result = exec_lua(function()
        local qflist = {
          {
            bufnr = 1,
            lnum = 10,
            col = 5,
            end_lnum = 10,
            end_col = 10,
            text = 'error: main',
            type = 'E',
            nr = 0,
            valid = 1,
          },
          {
            bufnr = 1,
            lnum = 0,
            col = 0,
            end_lnum = 0,
            end_col = 0,
            text = 'continuation',
            type = '',
            nr = 0,
            valid = 0,
          },
        }