diff --git a/cre.cpp b/cre.cpp index ea36e83e7..7497fb806 100644 --- a/cre.cpp +++ b/cre.cpp @@ -484,6 +484,13 @@ static int gotoLink(lua_State *L) { return 0; } +static int clearSelection(lua_State *L) { + CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); + + doc->text_view->clearSelection(); + + return 0; +} static int drawCurrentPage(lua_State *L) { CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); @@ -634,6 +641,7 @@ static const struct luaL_Reg credocument_meth[] = { {"findText", findText}, {"getPageLinks", getPageLinks}, {"gotoLink", gotoLink}, + {"clearSelection", clearSelection}, {"close", closeDocument}, {"__gc", closeDocument}, {NULL, NULL}