- Clear filter only when a plugin is selected manually.
Plugin dir should be unfiltered when opened.
- Plugins invoked by keys don't require clearing filter
of original context. If a new context is opened using
the plugin, it will be unfiltered by default. If the
same context is re-used (when all the contexts are in
use) the filter should be cleared so the the new path
is opened unfiltered.
static void clearfilter(void)
{
static void clearfilter(void)
{
- char *fltr = g_ctx[cfg.curctx].c_fltr;
+ char * const fltr = g_ctx[cfg.curctx].c_fltr;
if (fltr[1]) {
fltr[REGEX_MAX - 1] = fltr[1];
if (fltr[1]) {
fltr[REGEX_MAX - 1] = fltr[1];
ctx = (int)(get_free_ctx() + 1);
if (ctx == 0 || ctx == cfg.curctx + 1) { /* Same context */
ctx = (int)(get_free_ctx() + 1);
if (ctx == 0 || ctx == cfg.curctx + 1) { /* Same context */
xstrsncpy(*lastdir, *path, PATH_MAX);
xstrsncpy(*path, nextpath, PATH_MAX);
} else { /* New context */
xstrsncpy(*lastdir, *path, PATH_MAX);
xstrsncpy(*path, nextpath, PATH_MAX);
} else { /* New context */
xstrsncpy(runfile, pdents[cur].name, NAME_MAX);
g_state.runctx = cfg.curctx;
lastname[0] = '\0';
xstrsncpy(runfile, pdents[cur].name, NAME_MAX);
g_state.runctx = cfg.curctx;
lastname[0] = '\0';
if (g_state.runplugin == 1) /* Allow filtering in plugins directory */
presel = FILTER;
goto begin;
if (g_state.runplugin == 1) /* Allow filtering in plugins directory */
presel = FILTER;
goto begin;