aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Document.h1
-rw-r--r--src/Editor.cxx8
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Document.h b/src/Document.h
index 21713d3a2..00f80914c 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -340,6 +340,7 @@ public:
cb.GetCharRange(buffer, position, lengthRetrieve);
}
char SCI_METHOD StyleAt(Sci_Position position) const { return cb.StyleAt(position); }
+ int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(position)); }
void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const {
cb.GetStyleRange(buffer, position, lengthRetrieve);
}
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 5014b2abb..170f6a931 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -794,15 +794,15 @@ SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int mov
pos.SetPosition(posMoved);
if (vs.ProtectionActive()) {
if (moveDir > 0) {
- if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()) {
+ if ((pos.Position() > 0) && vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()) {
while ((pos.Position() < pdoc->Length()) &&
- (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()))
pos.Add(1);
}
} else if (moveDir < 0) {
- if (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()) {
+ if (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()) {
while ((pos.Position() > 0) &&
- (vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()))
pos.Add(-1);
}
}