diff options
author | 2016-04-05 20:49:54 -0400 | |
---|---|---|
committer | 2016-04-05 20:49:54 -0400 | |
commit | 4b0e565061d8e0b292966cbc5935e9abb410ebab (patch) | |
tree | 1f4eac10e70768d269dbbbed54a3edbc982c2e5a /src | |
parent | 47d8b1a2beba8a737c325fcfe95050f399fdeaf9 (diff) | |
download | textadept-4b0e565061d8e0b292966cbc5935e9abb410ebab.tar.gz textadept-4b0e565061d8e0b292966cbc5935e9abb410ebab.zip |
Improved efficiency of word autocompletion from all buffers.
Also fixed a bug that reset some non-focused buffer properties.
Diffstat (limited to 'src')
-rw-r--r-- | src/textadept.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c index a5daadda..fcd5da62 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -963,8 +963,8 @@ static sptr_t l_todoc(lua_State *L, int index) { * returns 0 if they are equivalent, less than zero if that document belongs to * the command entry, and greater than zero otherwise. * In the last case, loads the document in `dummy_view` for non-global document - * use. Raises and error if the value is not a Scintilla document or if the - * document no longer exists. + * use (unless it is already loaded). Raises and error if the value is not a + * Scintilla document or if the document no longer exists. * @param L The Lua state. * @param index The stack index of the Scintilla document. * @return 0, -1, or the Scintilla document's pointer @@ -981,6 +981,7 @@ static sptr_t l_globaldoccompare(lua_State *L, int index) { index, "this Buffer does not exist"); lua_pop(L, 2); // buffer, ta_buffers if (doc == SS(command_entry, SCI_GETDOCPOINTER, 0, 0)) return -1; + if (doc == SS(dummy_view, SCI_GETDOCPOINTER, 0, 0)) return doc; // keep return (SS(dummy_view, SCI_SETDOCPOINTER, 0, doc), doc); } else return 0; } |