fix missing \n after copy-paste

This commit is contained in:
gazer 2016-01-31 22:52:49 +03:00
parent 26e5e831d2
commit 26f6f891b7
2 changed files with 7 additions and 10 deletions

View File

@ -128,8 +128,8 @@ version (Windows) {
/// concat strings from array using delimiter
dstring concatDStrings(dstring[] lines, dstring delimiter = SYSTEM_DEFAULT_EOL) {
dchar[] buf;
foreach(line; lines) {
if (buf.length)
foreach(i, line; lines) {
if(i > 0)
buf ~= delimiter;
buf ~= line;
}
@ -996,12 +996,8 @@ class EditableContent {
for (int lineIndex = range.start.line; lineIndex <= range.end.line; lineIndex++) {
dstring lineText = line(lineIndex);
dstring lineFragment = lineText;
int startchar = 0;
int endchar = cast(int)lineText.length;
if (lineIndex == range.start.line)
startchar = range.start.pos;
if (lineIndex == range.end.line)
endchar = range.end.pos;
int startchar = (lineIndex == range.start.line) ? range.start.pos : 0;
int endchar = (lineIndex == range.end.line) ? range.end.pos : cast(int)lineText.length;
if (endchar > lineText.length)
endchar = cast(int)lineText.length;
if (endchar <= startchar)

View File

@ -332,7 +332,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
// modified, not saved
buf.fillRect(rc, 0xFFD040);
} else if (m == EditStateMark.saved) {
// modified, not saved
// modified, saved
buf.fillRect(rc, 0x20C020);
}
}
@ -2140,7 +2140,8 @@ class EditBox : EditWidgetBase {
int lineIndex = p.line - _firstVisibleLine;
res.top = lineIndex * _lineHeight;
res.bottom = res.top + _lineHeight;
if (lineIndex >=0 && lineIndex < _visibleLines.length) {
// if visible
if (lineIndex >= 0 && lineIndex < _visibleLines.length) {
if (p.pos == 0)
res.left = 0;
else if (p.pos >= _visibleLinesMeasurement[lineIndex].length)