X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_query%2Fmod_query.lua;h=bd3414bd95764cd5c6d62147d9181e4af0e44d18;hb=0c733f17d41080cd8240eecc5251d08a1776cdc5;hp=f4913f3fc272c6e7fd6e90209c21eb647745b53c;hpb=f869221ce49f0fb7cca48eee28daff8684305963;p=ion3.git diff --git a/mod_query/mod_query.lua b/mod_query/mod_query.lua index f4913f3..bd3414b 100644 --- a/mod_query/mod_query.lua +++ b/mod_query/mod_query.lua @@ -1,7 +1,7 @@ -- -- ion/query/mod_query.lua -- Some common queries for Ion -- --- Copyright (c) Tuomo Valkonen 2004-2007. +-- Copyright (c) Tuomo Valkonen 2004-2009. -- -- See the included file LICENSE for details. -- @@ -65,9 +65,10 @@ function mod_query.query(mplex, prompt, initvalue, handler, completor, wedln:complete('prev', 'normal') end - -- Check that no other queries are open in the mplex. - local ok=mplex:managed_i(function(r) - return not obj_is(r, "WEdln") + -- Check that no other queries or message boxes are open in the mplex. + local ok=mplex:managed_i(function(r) + return not (obj_is(r, "WEdln") or + obj_is(r, "WMessage")) end) if not ok then return @@ -910,7 +911,7 @@ function mod_query.get_hostnicks(mplex) patterns=pat elseif string.find(substr, "^[nN][aA][mM][eE]") and patterns then - for s in string.gfind(patterns, "%S+") do + for s in string.gmatch(patterns, "%S+") do if not string.find(s, "[*?]") then table.insert(mod_query.hostnicks, s) end @@ -1027,6 +1028,7 @@ function mod_query.do_handle_lua(mplex, env, code) local print_res local function collect_print(...) local tmp="" + local arg={...} local l=#arg for i=1,l do tmp=tmp..tostring(arg[i])..(i==l and "\n" or "\t") @@ -1068,7 +1070,7 @@ function mod_query.do_complete_lua(env, str) -- Descend into tables if tocomp and string.len(tocomp)>=1 then - for t in string.gfind(tocomp, "([^.:]*)[.:]") do + for t in string.gmatch(tocomp, "([^.:]*)[.:]") do metas=false if string.len(t)==0 then comptab=env;