Repository: neovim/neovim
File: src/nvim/statusline.c (C)

Code before:
/// If inversion is possible we use it. Else '=' characters are used.
void win_redr_status(win_T *wp)
{
  bool is_stl_global = global_stl_height() > 0;
  static bool busy = false;

  // May get here recursively when 'statusline' (indirectly)
  // invokes ":redrawstatus".  Simply ignore the call then.
  if (busy
      // Also ignore if wildmenu is showing.
      || (wild_menu_showing != 0 && !ui_has(kUIWildmenu))) {
    return;
  }
  busy = true;
  wp->w_redr_status = false;
  if (wp->w_status_height == 0 && !(is_stl_global && wp == curwin)) {
    // no status line, either global statusline is enabled or the window is a last window
    redraw_cmdline = true;
  } else if (!redrawing()) {
    // Don't redraw right now, do it later. Don't update status line when
    // popup menu is visible and may be drawn over it
    wp->w_redr_status = true;
  } else if (wp->w_floating ? ((wp->w_p_stl != empty_string_option
                                || (is_stl_global && wp == curwin))
                               && (*p_stl != NUL || *wp->w_p_stl != NUL))
                            : (*p_stl != NUL || *wp->w_p_stl != NUL)) {
    // redraw custom status line
    redraw_custom_statusline(wp);
  }

  hlf_T group = HLF_C;
  // May need to draw the character below the vertical separator.
  if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing()) {
    schar_T fillchar;
    if (stl_connected(wp)) {
      fillchar = fillchar_status(&group, wp);
    } else {
      fillchar = wp->w_p_fcs_chars.vert;
    }
    int attr = win_hl_attr(wp, (int)group);
    grid_line_start(&default_gridview, W_ENDROW(wp));
    grid_line_put_schar(W_ENDCOL(wp), fillchar, attr);
    grid_line_flush();
  }
  busy = false;
}

void get_trans_bufname(buf_T *buf)
{
  if (buf_spname(buf) != NULL) {
    xstrlcpy(NameBuff, buf_spname(buf), MAXPATHL);

Review comment (suggestion):
```suggestion
  } else if (*wp->w_p_stl != NUL
             || (*p_stl != NUL && (!wp->w_floating || (is_stl_global && wp == curwin))) {
```

Code after:
/// If inversion is possible we use it. Else '=' characters are used.
void win_redr_status(win_T *wp)
{
  bool is_stl_global = global_stl_height() > 0;
  static bool busy = false;

  // May get here recursively when 'statusline' (indirectly)
  // invokes ":redrawstatus".  Simply ignore the call then.
  if (busy
      // Also ignore if wildmenu is showing.
      || (wild_menu_showing != 0 && !ui_has(kUIWildmenu))) {
    return;
  }
  busy = true;
  wp->w_redr_status = false;
  if (wp->w_status_height == 0 && !(is_stl_global && wp == curwin)) {
    // no status line, either global statusline is enabled or the window is a last window
    redraw_cmdline = true;
  } else if (!redrawing()) {
    // Don't redraw right now, do it later. Don't update status line when
    // popup menu is visible and may be drawn over it
    wp->w_redr_status = true;
  } else if (*wp->w_p_stl != NUL
             || (*p_stl != NUL && (!wp->w_floating || (is_stl_global && wp == curwin)))) {
    // redraw custom status line
    redraw_custom_statusline(wp);
  }

  hlf_T group = HLF_C;
  // May need to draw the character below the vertical separator.
  if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing()) {
    schar_T fillchar;
    if (stl_connected(wp)) {
      fillchar = fillchar_status(&group, wp);
    } else {
      fillchar = wp->w_p_fcs_chars.vert;
    }
    int attr = win_hl_attr(wp, (int)group);
    grid_line_start(&default_gridview, W_ENDROW(wp));
    grid_line_put_schar(W_ENDCOL(wp), fillchar, attr);
    grid_line_flush();
  }
  busy = false;
}

void get_trans_bufname(buf_T *buf)
{
  if (buf_spname(buf) != NULL) {
    xstrlcpy(NameBuff, buf_spname(buf), MAXPATHL);
  } else {
    home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, true);