about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config/chapath.nim3
-rw-r--r--src/local/pager.nim4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/config/chapath.nim b/src/config/chapath.nim
index c02a3f1e..d9ba3c50 100644
--- a/src/config/chapath.nim
+++ b/src/config/chapath.nim
@@ -145,7 +145,7 @@ proc stateCurly(ctx: var UnquoteContext; c: char): ChaPathResult[void] =
     ctx.identStr &= c
     return ok()
   of ':', '-', '?', '+': # note: we don't support `=' (assign)
-    if ctx.identStr.len > 0:
+    if ctx.identStr.len == 0:
       return err("substitution without parameter name")
     if c == ':':
       ctx.state = usCurlyColon
@@ -235,6 +235,7 @@ proc flushCurlyExpand(ctx: var UnquoteContext; word: string):
   else: assert false
   ctx.subChar = '\0'
   ctx.hasColon = false
+  ctx.state = usNormal
   return ok()
 
 proc stateCurlyExpand(ctx: var UnquoteContext; c: char): ChaPathResult[void] =
diff --git a/src/local/pager.nim b/src/local/pager.nim
index e9e95895..b2cd779c 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -829,8 +829,8 @@ proc getEditorCommand(pager: Pager; file: string; line = 1): string {.jsfunc.} =
   var editor = pager.config.external.editor
   if (let uqEditor = ChaPath(editor).unquote(); uqEditor.isSome):
     if uqEditor.get in ["vi", "nvi", "vim", "nvim"]:
-      editor &= " +%d"
-  var canpipe = false
+      editor = uqEditor.get & " +%d"
+  var canpipe = true
   var s = unquoteCommand(editor, "", file, nil, canpipe, line)
   if canpipe:
     # %s not in command; add file name ourselves