diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Decoration.cxx | 4 | ||||
-rw-r--r-- | src/Document.cxx | 6 | ||||
-rw-r--r-- | src/Editor.cxx | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/Decoration.cxx b/src/Decoration.cxx index 90bde57f2..24632d7c1 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -126,9 +126,13 @@ bool DecorationList::FillRange(int &position, int value, int &fillLength) { } void DecorationList::InsertSpace(int position, int insertLength) { + const bool atEnd = position == lengthDocument; lengthDocument += insertLength; for (Decoration *deco=root; deco; deco = deco->next) { deco->rs.InsertSpace(position, insertLength); + if (atEnd) { + deco->rs.FillRange(position, 0, insertLength); + } } } diff --git a/src/Document.cxx b/src/Document.cxx index 2729d3d7b..5c05aa5e0 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -87,10 +87,10 @@ void LexInterface::Colourise(int start, int end) { Document::Document() { refCount = 0; -#ifdef __unix__ - eolMode = SC_EOL_LF; -#else +#ifdef _WIN32 eolMode = SC_EOL_CRLF; +#else + eolMode = SC_EOL_LF; #endif dbcsCodePage = 0; stylingBits = 5; diff --git a/src/Editor.cxx b/src/Editor.cxx index 74698a13d..1257ac4b0 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6051,20 +6051,20 @@ bool Editor::PositionInSelection(int pos) { bool Editor::PointInSelection(Point pt) { SelectionPosition pos = SPositionFromLocation(pt, false, true); - int xPos = XFromPosition(pos); + Point ptPos = LocationFromPosition(pos); for (size_t r=0; r<sel.Count(); r++) { SelectionRange range = sel.Range(r); if (range.Contains(pos)) { bool hit = true; if (pos == range.Start()) { // see if just before selection - if (pt.x < xPos) { + if (pt.x < ptPos.x) { hit = false; } } if (pos == range.End()) { // see if just after selection - if (pt.x > xPos) { + if (pt.x > ptPos.x) { hit = false; } } @@ -8423,7 +8423,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return vs.caretStyle; case SCI_SETCARETWIDTH: - if (wParam <= 0) + if (static_cast<int>(wParam) <= 0) vs.caretWidth = 0; else if (wParam >= 3) vs.caretWidth = 3; |