From 3774fe55fd6c96e80cc91e13fe0a231ce836ac47 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 28 Oct 2019 21:36:34 +0100 Subject: editorFor: take a pos object instead --- src/nix/repl.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/nix/repl.cc') diff --git a/src/nix/repl.cc b/src/nix/repl.cc index ed67c285f..683a117f3 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -472,22 +472,19 @@ bool NixRepl::processLine(string line) Value v; evalString(arg, v); - std::string filename; - int lineno = 0; + Pos pos; if (v.type == tPath || v.type == tString) { PathSet context; - filename = state.coerceToString(noPos, v, context); - lineno = 0; + auto filename = state.coerceToString(noPos, v, context); + pos.file = state.symbols.create(filename); } else { // assume it's a derivation - Pos pos = findDerivationFilename(state, v, arg); - filename = pos.file; - lineno = pos.line; + pos = findDerivationFilename(state, v, arg); } // Open in EDITOR - auto args = editorFor(filename, lineno); + auto args = editorFor(pos); auto editor = args.front(); args.pop_front(); runProgram(editor, args); -- cgit v1.2.3