From be2c94001355de67882d8295d477e07c0006f52d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 20 May 2015 13:24:39 -0600 Subject: [PATCH] * Some notes and minor changes --- core/ansi_term.js | 4 ++++ core/multi_line_edit_text_view.js | 39 ++++++++++++++++++++++++++++++- core/vertical_menu_view.js | 6 ++--- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/core/ansi_term.js b/core/ansi_term.js index 52269e2e..b9e26b92 100644 --- a/core/ansi_term.js +++ b/core/ansi_term.js @@ -8,6 +8,7 @@ // * http://ansi-bbs.org/ // * http://www.bbsdocumentary.com/library/PROGRAMS/GRAPHICS/ANSI/ansisys.txt // * http://en.wikipedia.org/wiki/ANSI_escape_code +// * https://github.com/chjj/term.js/blob/master/src/term.js // var assert = require('assert'); @@ -65,6 +66,9 @@ var CONTROL = { hideCursor : '?25l', // Nonstandard - cterm.txt showCursor : '?25h', // Nonstandard - cterm.txt + + // :TODO: see https://code.google.com/p/conemu-maximus5/wiki/AnsiEscapeCodes + // apparently some terms can report screen size and text area via 18t and 19t }; /* diff --git a/core/multi_line_edit_text_view.js b/core/multi_line_edit_text_view.js index e9b9fc5b..bb724145 100644 --- a/core/multi_line_edit_text_view.js +++ b/core/multi_line_edit_text_view.js @@ -9,6 +9,35 @@ var ansi = require('./ansi_term.js'); var assert = require('assert'); var _ = require('lodash'); +// +// Notes +// * options.tabSize can be used to resolve \t +// * See https://github.com/dominictarr/hipster/issues/15 about insert/delete lines +// +// Blessed +// insertLine: CSR(top, bottom) + CUP(y, 0) + IL(1) + CSR(0, height) +// deleteLine: CSR(top, bottom) + CUP(y, 0) + DL(1) + CSR(0, height) +// Quick Ansi -- update only what was changed: +// https://github.com/dominictarr/quickansi +// +// This thread is awesome: +// https://github.com/dominictarr/hipster/issues/15 +// +// See Atom's implementations +// Newer TextDocument +// https://github.com/atom/text-document +// +// Older TextBuffer +// http://www.oscon.com/oscon2014/public/schedule/detail/37593 +// +// Span Skip List could be used for mappings of rows/cols (display) to +// character offsets in a buffer +// https://github.com/atom/span-skip-list + +// +// Buffer: Actual text buffer +// Transform: Display of soft wrap & tab expansion (e.g. tab -> ' ' * tabWidth) +// // // General Design @@ -33,7 +62,15 @@ exports.MultiLineEditTextView = MultiLineEditTextView; // // Syncronet // - +// +// Projects of use/interest: +// +// https://github.com/atom/text-buffer +// http://danieltao.com/lazy.js/ +// http://www.jbox.dk/downloads/edit.c +// https://github.com/slap-editor/slap +// https://github.com/chjj/blessed +// function MultiLineEditTextView(options) { diff --git a/core/vertical_menu_view.js b/core/vertical_menu_view.js index c9cc7c12..402da6d8 100644 --- a/core/vertical_menu_view.js +++ b/core/vertical_menu_view.js @@ -60,10 +60,10 @@ util.inherits(VerticalMenuView, MenuView); VerticalMenuView.prototype.redraw = function() { VerticalMenuView.super_.prototype.redraw.call(this); - var x = this.position.row; + var row = this.position.row; for(var i = this.viewWindow.top; i <= this.viewWindow.bottom; ++i) { - this.items[i].row = x; - x += this.itemSpacing + 1; + this.items[i].row = row; + row += this.itemSpacing + 1; this.items[i].focused = this.focusedItemIndex === i; this.drawItem(i); }