aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/AutoComplete.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/AutoComplete.cxx')
-rw-r--r--src/AutoComplete.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx
index 3de456371..1447939b7 100644
--- a/src/AutoComplete.cxx
+++ b/src/AutoComplete.cxx
@@ -19,16 +19,19 @@
#include <algorithm>
#include <memory>
+#include "ScintillaTypes.h"
+#include "ScintillaMessages.h"
+
#include "Debugging.h"
#include "Geometry.h"
#include "Platform.h"
-#include "Scintilla.h"
#include "CharacterType.h"
#include "Position.h"
#include "AutoComplete.h"
using namespace Scintilla;
+using namespace Scintilla::Internal;
AutoComplete::AutoComplete() :
active(false),
@@ -41,10 +44,10 @@ AutoComplete::AutoComplete() :
cancelAtStartPos(true),
autoHide(true),
dropRestOfWord(false),
- ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE),
+ ignoreCaseBehaviour(CaseInsensitiveBehaviour::RespectCase),
widthLBDefault(100),
heightLBDefault(100),
- autoSort(SC_ORDER_PRESORTED) {
+ autoSort(Ordering::PreSorted) {
lb = ListBox::Allocate();
}
@@ -60,7 +63,7 @@ bool AutoComplete::Active() const noexcept {
void AutoComplete::Start(Window &parent, int ctrlID,
Sci::Position position, Point location, Sci::Position startLen_,
- int lineHeight, bool unicodeMode, int technology) {
+ int lineHeight, bool unicodeMode, Technology technology) {
if (active) {
Cancel();
}
@@ -147,7 +150,7 @@ struct Sorter {
};
void AutoComplete::SetList(const char *list) {
- if (autoSort == SC_ORDER_PRESORTED) {
+ if (autoSort == Ordering::PreSorted) {
lb->SetList(list, separator, typesep);
sortMatrix.clear();
for (int i = 0; i < lb->Length(); ++i)
@@ -160,7 +163,7 @@ void AutoComplete::SetList(const char *list) {
for (int i = 0; i < static_cast<int>(IndexSort.indices.size()) / 2; ++i)
sortMatrix.push_back(i);
std::sort(sortMatrix.begin(), sortMatrix.end(), IndexSort);
- if (autoSort == SC_ORDER_CUSTOM || sortMatrix.size() < 2) {
+ if (autoSort == Ordering::Custom || sortMatrix.size() < 2) {
lb->SetList(list, separator, typesep);
PLATFORM_ASSERT(lb->Length() == static_cast<int>(sortMatrix.size()));
return;
@@ -253,7 +256,7 @@ void AutoComplete::Select(const char *word) {
}
location = pivot;
if (ignoreCase
- && ignoreCaseBehaviour == SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) {
+ && ignoreCaseBehaviour == CaseInsensitiveBehaviour::RespectCase) {
// Check for exact-case match
for (; pivot <= end; pivot++) {
item = lb->GetValue(sortMatrix[pivot]);
@@ -277,7 +280,7 @@ void AutoComplete::Select(const char *word) {
else
lb->Select(-1);
} else {
- if (autoSort == SC_ORDER_CUSTOM) {
+ if (autoSort == Ordering::Custom) {
// Check for a logically earlier match
for (int i = location + 1; i <= end; ++i) {
std::string item = lb->GetValue(sortMatrix[i]);