commit db2bc4377d8181d64ed461c9cb971bd2ee5311eb
parent 77b6a64b37633148b8afe2a95e1a7827f6881401
Author: Lou Woell <lou.woell@posteo.de>
Date:   Thu,  9 Oct 2025 20:33:08 +0200

[locate] handle tags starting with -

Diffstat:
Mcmd/harehelper/locate.ha | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cmd/harehelper/locate.ha b/cmd/harehelper/locate.ha @@ -70,7 +70,6 @@ fn locate_module ( }; }; - fn locate_symbol ( ctx: *module::context, id: ast::ident @@ -79,8 +78,12 @@ fn locate_symbol ( let ns: module::location = ident_ns(id); // if no namespace prefix is present look for a declaration in the cwd. if (len(id) <= 1) { + let p = path::init(os::getcwd())!; - if (strings::hasprefix(path::peek(&p) as str, '+')) { + let dirname = path::peek(&p) as str; + + if (strings::hasprefix(dirname, '+') || + strings::hasprefix(dirname, '-')) { path::pop(&p); }; ns = &p; @@ -135,7 +138,7 @@ fn locate_symbol ( if (found) return lex::location { path = strings::dup(decl.start.path)!, - line =decl.start.line, + line = decl.start.line, col = decl.start.col, off = decl.start.off, };