feat: server: show goal state after tactic if cursor not strictly before tactic

This commit is contained in:
Sebastian Ullrich 2021-04-02 23:51:04 +02:00
parent ac9fee5854
commit e20b2c359a
2 changed files with 3 additions and 3 deletions

View file

@ -169,7 +169,7 @@ partial def InfoTree.goalsAt? (t : InfoTree) (hoverPos : String.Pos) : List Goal
| failure
let trailSize := i.stx.getTrailingSize
guard <| pos ≤ hoverPos ∧ hoverPos < tailPos + trailSize
return { ctxInfo := ctx, tacticInfo := ti, useAfter := hoverPos >= tailPos }
return { ctxInfo := ctx, tacticInfo := ti, useAfter := hoverPos > pos }
| _, _ => none
end Lean.Elab

View file

@ -4,5 +4,5 @@
"goals": ["α : Sort ?u\n⊢ αα"]}
{"textDocument": {"uri": "file://plainGoal.lean"},
"position": {"line": 1, "character": 3}}
{"rendered": "```lean\nα : Sort ?u\n⊢ α α\n```",
"goals": ["α : Sort ?u\n⊢ α α"]}
{"rendered": "```lean\nα : Sort ?u\na : α\nα\n```",
"goals": ["α : Sort ?u\na : α\nα"]}