summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-03-23 08:22:34 +1100
committerMaxime Coste <mawww@kakoune.org>2018-03-23 08:22:34 +1100
commita732037b539db23010fcb379d643159670e05960 (patch)
treee0bd8f7a579310e86572858e12e5a3379a70fb31 /src/normal.cc
parent42404ddb3a6822fd5777e7d2582b2fe74b43c48b (diff)
Support `%` in `path` option to mean current buffer directory
In the end, % is not that painful to work with as its only set seldomly, and we usually dont need to use expansion at the same time. Moreover, it just requires a single \ to be escaped. Fixes #1562
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 05a5246e..968293b6 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -278,11 +278,8 @@ void goto_commands(Context& context, NormalParams params)
return;
auto paths = context.options()["path"].get<Vector<String, MemoryDomain::Options>>();
- StringView buffer_dir = split_path(buffer.name()).first;
- if (not buffer_dir.empty())
- paths.insert(paths.begin(), buffer_dir.str());
-
- String path = find_file(filename, paths);
+ const StringView buffer_dir = split_path(buffer.name()).first;
+ String path = find_file(filename, buffer_dir, paths);
if (path.empty())
throw runtime_error(format("unable to find file '{}'", filename));