* Fix line feed key with tabs

This commit is contained in:
Bryan Ashby 2015-06-14 23:18:21 -06:00
parent 2632c150ac
commit 81dab54f78
1 changed files with 2 additions and 5 deletions

View File

@ -617,11 +617,10 @@ function MultiLineEditTextView2(options) {
// Break up text from cursor position, redraw, and update cursor
// position to start of next line
//
// :TODO: this needs converted to use the getContigousText() and such
var index = self.getTextLinesIndex();
var nextEolIndex = self.getNextEndOfLineIndex(index);
var text = self.getOutputText(index, nextEolIndex);
var newLines = self.wordWrapSingleLine(text.slice(self.cursorPos.col)).wrapped;
var text = self.getContiguousText(index, nextEolIndex);
var newLines = self.wordWrapSingleLine(text.slice(self.cursorPos.col), 'tabsIntact').wrapped;
newLines.unshift( { text : text.slice(0, self.cursorPos.col), eol : true } );
for(var i = 1; i < newLines.length; ++i) {
@ -644,8 +643,6 @@ function MultiLineEditTextView2(options) {
};
this.keyPressTab = function() {
// :TODO: Seems tabs are counted as words when wrapping... they should probably break @ nearest
// full tab if possible? Look into how Sublime handles this.
var index = self.getTextLinesIndex();
self.insertCharactersInText(self.expandTab(self.cursorPos.col, '\t') + '\t', index, self.cursorPos.col);
};