aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers
diff options
context:
space:
mode:
Diffstat (limited to 'lexers')
-rw-r--r--lexers/LexProps.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/lexers/LexProps.cxx b/lexers/LexProps.cxx
index 1aebdbb06..328033dd5 100644
--- a/lexers/LexProps.cxx
+++ b/lexers/LexProps.cxx
@@ -12,6 +12,8 @@
#include <assert.h>
#include <ctype.h>
+#include <string>
+
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
@@ -79,10 +81,9 @@ static void ColourisePropsLine(
}
static void ColourisePropsDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) {
- char lineBuffer[1024];
+ std::string lineBuffer;
styler.StartAt(startPos);
styler.StartSegment(startPos);
- Sci_PositionU linePos = 0;
Sci_PositionU startLine = startPos;
// property lexer.props.allow.initial.spaces
@@ -92,17 +93,16 @@ static void ColourisePropsDoc(Sci_PositionU startPos, Sci_Position length, int,
const bool allowInitialSpaces = styler.GetPropertyInt("lexer.props.allow.initial.spaces", 1) != 0;
for (Sci_PositionU i = startPos; i < startPos + length; i++) {
- lineBuffer[linePos++] = styler[i];
- if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ lineBuffer.push_back(styler[i]);
+ if (AtEOL(styler, i)) {
// End of line (or of line buffer) met, colourise it
- lineBuffer[linePos] = '\0';
- ColourisePropsLine(lineBuffer, linePos, startLine, i, styler, allowInitialSpaces);
- linePos = 0;
+ ColourisePropsLine(lineBuffer.c_str(), lineBuffer.length(), startLine, i, styler, allowInitialSpaces);
+ lineBuffer.clear();
startLine = i + 1;
}
}
- if (linePos > 0) { // Last line does not have ending characters
- ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length - 1, styler, allowInitialSpaces);
+ if (lineBuffer.length() > 0) { // Last line does not have ending characters
+ ColourisePropsLine(lineBuffer.c_str(), lineBuffer.length(), startLine, startPos + length - 1, styler, allowInitialSpaces);
}
}