From 31bebcc5f09dadec62ff69149330c6a9036c0cd1 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 1 May 2018 15:33:56 -0400 Subject: [PATCH] doc/commands: term accept CmdEntityLink commands Signed-off-by: Alexandre Terrasa --- src/doc/term/term.nit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/term/term.nit b/src/doc/term/term.nit index a82d7b8..200d93f 100644 --- a/src/doc/term/term.nit +++ b/src/doc/term/term.nit @@ -23,9 +23,8 @@ redef class CommandParser var cmd = self.parse(query) var error = self.error - # If not a command, try a comment query - if cmd == null and error isa CmdParserError then - error = null + # Translate links to doc commands + if cmd isa CmdEntityLink then cmd = new CmdComment(view, mentity_name = query) var opts = new HashMap[String, String] var status = cmd.parser_init(query, opts) @@ -36,7 +35,8 @@ redef class CommandParser error.print_message(no_color) print "" end - cmd.as(not null).execute(no_color) + if cmd == null then return + cmd.execute(no_color) end end -- 1.7.9.5