/* * Check all file marks for a name that matches the file name in buf. * May replace the name with an fnum. * Used for marks that come from the .viminfo file. */ void fmarks_check_names(buf_T *buf) { char_u *name; int i; if (buf->b_ffname == NULL) return; name = home_replace_save(buf, buf->b_ffname); for (i = 0; i < NMARKS + EXTRA_MARKS; ++i) fmarks_check_one(&namedfm[i], name, buf); FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { for (i = 0; i < wp->w_jumplistlen; ++i) { fmarks_check_one(&wp->w_jumplist[i], name, buf); } } free(name); }
/* * Return TRUE if "name" is on removable media (depending on 'viminfo'). */ int removable(char_u *name) { char_u *p; char_u part[51]; int retval = FALSE; size_t n; name = home_replace_save(NULL, name); if (name != NULL) { for (p = p_viminfo; *p; ) { copy_option_part(&p, part, 51, ", "); if (part[0] == 'r') { n = STRLEN(part + 1); if (MB_STRNICMP(part + 1, name, n) == 0) { retval = TRUE; break; } } } vim_free(name); } return retval; }