From: Arun Date: Sat, 28 Jan 2023 02:53:24 +0000 (+0530) Subject: Merge pull request #1571 from KlzXS/plugin_simplification X-Git-Tag: v4.8~29 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=786ecf9fc2c73cf2af234e9f3e5c8cc5cae5da5d;p=nnn.git Merge pull request #1571 from KlzXS/plugin_simplification Simplify the command as plugin codepath --- 786ecf9fc2c73cf2af234e9f3e5c8cc5cae5da5d diff --cc src/nnn.c index 9818c347,24e6d72d..6be52e3f --- a/src/nnn.c +++ b/src/nnn.c @@@ -5188,17 -5172,19 +5188,19 @@@ static void run_cmd_as_plugin(const cha --len; } - if ((flags & F_PAGE) || (flags & F_NOTRACE)) { - if (is_suffix(g_buf, " $nnn")) - g_buf[len - 5] = '\0'; - else - runfile = NULL; + /* This is to catch the old way of doing things so we don't break users' configs */ + if ((flags & (F_PAGE | F_NOTRACE)) && is_suffix(g_buf, " $nnn")) { + g_buf[len - 5] = '\0'; if (flags & F_PAGE) - get_output(g_buf, runfile, NULL, -1, TRUE, TRUE); + get_output(g_buf, runfile, NULL, -1, TRUE); else // F_NOTRACE spawn(g_buf, runfile, NULL, NULL, flags); - } else + } + + if (flags & F_PAGE) + get_output(utils[UTIL_SH_EXEC], g_buf, NULL, -1, TRUE); + else spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags); }