comparison src/popupwin.c @ 17584:65a8099fc0e8 v8.1.1789

patch 8.1.1789: cannot see file name of preview popup window commit https://github.com/vim/vim/commit/90f3e7ac56056ffad50bac9d4497b5830c37ab26 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 1 22:40:44 2019 +0200 patch 8.1.1789: cannot see file name of preview popup window Problem: Cannot see file name of preview popup window. Solution: Add the file name as the title.
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Aug 2019 22:45:05 +0200
parents d5e5d0fc3fa8
children 506dd2efcbb2
comparison
equal deleted inserted replaced
17583:231b482948de 17584:65a8099fc0e8
3196 res.vval.v_number = -1; 3196 res.vval.v_number = -1;
3197 popup_close_and_callback(wp, &res); 3197 popup_close_and_callback(wp, &res);
3198 } 3198 }
3199 } 3199 }
3200 3200
3201 /*
3202 * Set the title of the popup window to the file name.
3203 */
3204 void
3205 popup_set_title(win_T *wp)
3206 {
3207 if (wp->w_buffer->b_fname != NULL)
3208 {
3209 char_u dirname[MAXPATHL];
3210 size_t len;
3211
3212 mch_dirname(dirname, MAXPATHL);
3213 shorten_buf_fname(wp->w_buffer, dirname, FALSE);
3214
3215 vim_free(wp->w_popup_title);
3216 len = STRLEN(wp->w_buffer->b_fname) + 3;
3217 wp->w_popup_title = alloc((int)len);
3218 if (wp->w_popup_title != NULL)
3219 vim_snprintf((char *)wp->w_popup_title, len, " %s ",
3220 wp->w_buffer->b_fname);
3221 redraw_win_later(wp, VALID);
3222 }
3223 }
3224
3225 /*
3226 * If there is a preview window, update the title.
3227 * Used after changing directory.
3228 */
3229 void
3230 popup_update_preview_title(void)
3231 {
3232 win_T *wp = popup_find_preview_window();
3233
3234 if (wp != NULL)
3235 popup_set_title(wp);
3236 }
3237
3201 #endif // FEAT_TEXT_PROP 3238 #endif // FEAT_TEXT_PROP