Better gathering of lines; don't add extra line terms
This commit is contained in:
parent
0035ef4f39
commit
4d97922933
|
@ -288,18 +288,20 @@ function MultiLineEditTextView(options) {
|
||||||
|
|
||||||
this.getOutputText = function (startIndex, endIndex, eolMarker, options) {
|
this.getOutputText = function (startIndex, endIndex, eolMarker, options) {
|
||||||
const lines = self.getTextLines(startIndex, endIndex);
|
const lines = self.getTextLines(startIndex, endIndex);
|
||||||
let text = '';
|
|
||||||
const re = new RegExp('\\t{1,' + self.tabWidth + '}', 'g');
|
const re = new RegExp('\\t{1,' + self.tabWidth + '}', 'g');
|
||||||
|
|
||||||
lines.forEach(line => {
|
return lines
|
||||||
text += line.text.replace(re, '\t');
|
.map((line, lineIndex) => {
|
||||||
|
let text = line.text.replace(re, '\t');
|
||||||
if (options.forceLineTerms || (eolMarker && line.eol)) {
|
if (
|
||||||
text += eolMarker;
|
options.forceLineTerms ||
|
||||||
}
|
(eolMarker && line.eol && lineIndex < lines.length - 1)
|
||||||
});
|
) {
|
||||||
|
text += eolMarker;
|
||||||
return text;
|
}
|
||||||
|
return text;
|
||||||
|
})
|
||||||
|
.join();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getContiguousText = function (startIndex, endIndex, includeEol) {
|
this.getContiguousText = function (startIndex, endIndex, includeEol) {
|
||||||
|
|
Loading…
Reference in New Issue