diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-28 12:44:10 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-28 12:44:10 +0100 |
commit | de5375ccbc459165132ecb26c466ba677a3247a8 (patch) | |
tree | 3319e8a11061e81ded12e12fffbe7dd2a794373d /crawl-ref/source/luaterp.cc | |
parent | 55ff07fdddffb794bb86b18dfd403f78ead6f0ec (diff) | |
download | crawl-ref-de5375ccbc459165132ecb26c466ba677a3247a8.tar.gz crawl-ref-de5375ccbc459165132ecb26c466ba677a3247a8.zip |
Convert to cancelable_get_line_autohist.
Diffstat (limited to 'crawl-ref/source/luaterp.cc')
-rw-r--r-- | crawl-ref/source/luaterp.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/luaterp.cc b/crawl-ref/source/luaterp.cc index 39252d1fa3..5ccbfffbc1 100644 --- a/crawl-ref/source/luaterp.cc +++ b/crawl-ref/source/luaterp.cc @@ -35,10 +35,11 @@ static int _pushline(lua_State *ls, int firstline) char *b = buffer; size_t l; mpr(firstline ? "> " : ". ", MSGCH_PROMPT); - get_input_line(buffer, sizeof(buffer)); + if (cancelable_get_line_autohist(buffer, sizeof(buffer))) + return (0); l = strlen(b); if (l == 0) - return (0); + return (1); if (l > 0 && b[l-1] == '\n') // line ends with newline? b[l-1] = '\0'; // remove it @@ -46,7 +47,7 @@ static int _pushline(lua_State *ls, int firstline) lua_pushfstring(ls, "return %s", b+1); // change it to `return' else lua_pushstring(ls, b); - return 1; + return (1); } static int _loadline(lua_State *ls) |