diff options
author | Neil <nyamatongwe@gmail.com> | 2021-11-13 10:35:41 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-11-13 10:35:41 +1100 |
commit | 23f58dfe8eb50c7c9231aa81c9a23a5259134cbf (patch) | |
tree | 3803746fdf96b36cc3f8dfc5d18231480646443a /src | |
parent | 2e30b0e2a18037ed362564ba3c150ad8d8459b2b (diff) | |
download | scintilla-mirror-23f58dfe8eb50c7c9231aa81c9a23a5259134cbf.tar.gz |
Bug [#2294] Fix assertion failure with autocompletion list when order is
SC_ORDER_CUSTOM or SC_ORDER_PERFORMSORT and the list is empty.
Diffstat (limited to 'src')
-rw-r--r-- | src/AutoComplete.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index 47e942561..2bf88aa23 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -115,6 +115,11 @@ struct Sorter { Sorter(AutoComplete *ac_, const char *list_) : ac(ac_), list(list_) { int i = 0; + if (!list[i]) { + // Empty list has a single empty member + indices.push_back(i); // word start + indices.push_back(i); // word end + } while (list[i]) { indices.push_back(i); // word start while (list[i] != ac->GetTypesep() && list[i] != ac->GetSeparator() && list[i]) |