From: Alexandre Terrasa Date: Tue, 1 May 2018 19:33:56 +0000 (-0400) Subject: doc/commands: term accept CmdEntityLink commands X-Git-Url: http://nitlanguage.org doc/commands: term accept CmdEntityLink commands Signed-off-by: Alexandre Terrasa --- 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