* Mostly notes

This commit is contained in:
Bryan Ashby 2015-06-11 16:53:34 -06:00
parent 9ead6ab0fa
commit 251a4777f6
1 changed files with 6 additions and 12 deletions

View File

@ -368,8 +368,7 @@ function MultiLineEditTextView2(options) {
// * A lot of this can be used for backspacing also // * A lot of this can be used for backspacing also
// * See how Sublime treats tabs in *non* overtype mode... just overwrite them? // * See how Sublime treats tabs in *non* overtype mode... just overwrite them?
// //
// * If the cursor is part of a word that wraps (beg/end/mid), then the cursor // * Wrapping/etc. breaks with tabs!!!
// should be restored at the same position in teh wrapped line
if(self.overtypeMode) { if(self.overtypeMode) {
// :TODO: special handing for insert over eol mark? // :TODO: special handing for insert over eol mark?
@ -394,6 +393,9 @@ function MultiLineEditTextView2(options) {
var wrapped = self.wordWrapSingleLine(self.getOutputText(index, nextEolIndex)); var wrapped = self.wordWrapSingleLine(self.getOutputText(index, nextEolIndex));
var newLines = wrapped.wrapped; var newLines = wrapped.wrapped;
console.log('--------------Newlines')
console.log(newLines)
// //
// If our cursor was within the bounds of the last wrapped word // If our cursor was within the bounds of the last wrapped word
// we'll want to adjust the cursor to the same relative position // we'll want to adjust the cursor to the same relative position
@ -412,15 +414,7 @@ function MultiLineEditTextView2(options) {
newLines[i] = { text : newLines[i] }; newLines[i] = { text : newLines[i] };
} }
newLines[newLines.length - 1].eol = true; newLines[newLines.length - 1].eol = true;
/*console.log('--------------Newlines')
console.log(newLines)
console.log('--------------Textlines')
console.log(self.textLines)
console.log('nextEolIndex='+ nextEolIndex + ' / index=' + index + '/ newLines.length=' + newLines.length)
*/
Array.prototype.splice.apply( Array.prototype.splice.apply(
self.textLines, self.textLines,
[ index, (nextEolIndex - index) + 1 ].concat(newLines)); [ index, (nextEolIndex - index) + 1 ].concat(newLines));
@ -677,7 +671,7 @@ MultiLineEditTextView2.prototype.setFocus = function(focused) {
MultiLineEditTextView2.prototype.setText = function(text) { MultiLineEditTextView2.prototype.setText = function(text) {
this.textLines = [ ]; this.textLines = [ ];
//text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!"; //text = "Tab:\r\n\tA\tB\tC\tD\tE\tF\tG\r\n reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally long word!!!";
text = require('fs').readFileSync('/home/nuskooler/Downloads/test_text.txt', { encoding : 'utf-8'}); text = require('fs').readFileSync('/home/bashby/Downloads/test_text.txt', { encoding : 'utf-8'});
//text = 'An excerpt from A Clockwork Orange:' //text = 'An excerpt from A Clockwork Orange:'
this.insertText(text);//, 0, 0); this.insertText(text);//, 0, 0);