mirror of https://github.com/buggins/dlangui.git
fix missing \n after copy-paste
This commit is contained in:
parent
26e5e831d2
commit
26f6f891b7
|
@ -128,8 +128,8 @@ version (Windows) {
|
||||||
/// concat strings from array using delimiter
|
/// concat strings from array using delimiter
|
||||||
dstring concatDStrings(dstring[] lines, dstring delimiter = SYSTEM_DEFAULT_EOL) {
|
dstring concatDStrings(dstring[] lines, dstring delimiter = SYSTEM_DEFAULT_EOL) {
|
||||||
dchar[] buf;
|
dchar[] buf;
|
||||||
foreach(line; lines) {
|
foreach(i, line; lines) {
|
||||||
if (buf.length)
|
if(i > 0)
|
||||||
buf ~= delimiter;
|
buf ~= delimiter;
|
||||||
buf ~= line;
|
buf ~= line;
|
||||||
}
|
}
|
||||||
|
@ -996,12 +996,8 @@ class EditableContent {
|
||||||
for (int lineIndex = range.start.line; lineIndex <= range.end.line; lineIndex++) {
|
for (int lineIndex = range.start.line; lineIndex <= range.end.line; lineIndex++) {
|
||||||
dstring lineText = line(lineIndex);
|
dstring lineText = line(lineIndex);
|
||||||
dstring lineFragment = lineText;
|
dstring lineFragment = lineText;
|
||||||
int startchar = 0;
|
int startchar = (lineIndex == range.start.line) ? range.start.pos : 0;
|
||||||
int endchar = cast(int)lineText.length;
|
int endchar = (lineIndex == range.end.line) ? range.end.pos : cast(int)lineText.length;
|
||||||
if (lineIndex == range.start.line)
|
|
||||||
startchar = range.start.pos;
|
|
||||||
if (lineIndex == range.end.line)
|
|
||||||
endchar = range.end.pos;
|
|
||||||
if (endchar > lineText.length)
|
if (endchar > lineText.length)
|
||||||
endchar = cast(int)lineText.length;
|
endchar = cast(int)lineText.length;
|
||||||
if (endchar <= startchar)
|
if (endchar <= startchar)
|
||||||
|
|
|
@ -332,7 +332,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
// modified, not saved
|
// modified, not saved
|
||||||
buf.fillRect(rc, 0xFFD040);
|
buf.fillRect(rc, 0xFFD040);
|
||||||
} else if (m == EditStateMark.saved) {
|
} else if (m == EditStateMark.saved) {
|
||||||
// modified, not saved
|
// modified, saved
|
||||||
buf.fillRect(rc, 0x20C020);
|
buf.fillRect(rc, 0x20C020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2140,7 +2140,8 @@ class EditBox : EditWidgetBase {
|
||||||
int lineIndex = p.line - _firstVisibleLine;
|
int lineIndex = p.line - _firstVisibleLine;
|
||||||
res.top = lineIndex * _lineHeight;
|
res.top = lineIndex * _lineHeight;
|
||||||
res.bottom = res.top + _lineHeight;
|
res.bottom = res.top + _lineHeight;
|
||||||
if (lineIndex >=0 && lineIndex < _visibleLines.length) {
|
// if visible
|
||||||
|
if (lineIndex >= 0 && lineIndex < _visibleLines.length) {
|
||||||
if (p.pos == 0)
|
if (p.pos == 0)
|
||||||
res.left = 0;
|
res.left = 0;
|
||||||
else if (p.pos >= _visibleLinesMeasurement[lineIndex].length)
|
else if (p.pos >= _visibleLinesMeasurement[lineIndex].length)
|
||||||
|
|
Loading…
Reference in New Issue