The docsearch function is now working.
This commit is contained in:
@@ -933,11 +933,23 @@ LuaDefine(doc, "function",
|
||||
std::ostream *ostream = w->lthread_print_stream();
|
||||
LuaArg func;
|
||||
LuaDefStack LS(L, func);
|
||||
eng::string doc = w->get_source().function_docs(LS, func);
|
||||
if (doc == "") {
|
||||
(*ostream) << "no doc found" << std::endl;
|
||||
bool ok = w->get_source().function_docs(LS, func, *ostream);
|
||||
if (!ok) {
|
||||
(*ostream) << "No documentation found.";
|
||||
}
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
LuaDefine(docsearch, "search-string", "Search the docs for the specified string") {
|
||||
World *w = World::fetch_global_pointer(L);
|
||||
std::ostream *ostream = w->lthread_print_stream();
|
||||
LuaArg ss;
|
||||
LuaDefStack LS(L, ss);
|
||||
eng::string searchstring = LS.ckstring(ss);
|
||||
bool ok = w->get_source().search_docs(searchstring, *ostream);
|
||||
if (!ok) {
|
||||
(*ostream) << "No documentation found.";
|
||||
}
|
||||
(*ostream) << doc;
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user