aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.cc
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2019-10-28 21:36:34 +0100
committerzimbatm <zimbatm@zimbatm.com>2019-10-28 21:36:34 +0100
commit3774fe55fd6c96e80cc91e13fe0a231ce836ac47 (patch)
tree1923c36ab6c05268163eb788d75224e2bf8790b9 /src/libutil/args.cc
parentec448f8bb694b6f9546e49fe6a79b86ff2b2f90a (diff)
editorFor: take a pos object instead
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r--src/libutil/args.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 35ec3e4ab..b7baad375 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -178,16 +178,16 @@ Strings argvToStrings(int argc, char * * argv)
return args;
}
-Strings editorFor(std::string filename, int lineno)
+Strings editorFor(Pos pos)
{
auto editor = getEnv("EDITOR", "cat");
auto args = tokenizeString<Strings>(editor);
- if (lineno > 0 && (
+ if (pos.line > 0 && (
editor.find("emacs") != std::string::npos ||
editor.find("nano") != std::string::npos ||
editor.find("vim") != std::string::npos))
- args.push_back(fmt("+%d", lineno));
- args.push_back(filename);
+ args.push_back(fmt("+%d", pos.line));
+ args.push_back(pos.file);
return args;
}