Skip to content

Commit

Permalink
text editor design
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan committed Feb 21, 2010
1 parent d8cd7bd commit f2287fc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mud/menu/textEditor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-from util import isFunc, isString, isDefined, endl
from util import isFunc, isString, isDefined, endl
from mud.core.send import sendToClient
from mud.core.prompt import pushPrompt, popPrompt
from mud.core.cmds import pushCmdHandler, popCmdHandler
Expand Down
44 changes: 42 additions & 2 deletions src/org/text-editor.org
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,51 @@
** abort
** finish
** justify text
**
** display original text as it will look if aborted

* impl
** modified form
** impl edit in progress as collection of lines:
*** pros:
**** edit specific line is easy
*** cons:
**** need to convert to/from string when initializing/finishing the edit
**** existing justification algorithms likely take string
*** should go with collection of lines
** TextEditor object manages text data structure and text editor operations
** text editor mode/interface/menu handles the selections/IO/abort/finish
** TextEditor and mode are transient
*** edits in progress are lost on crash
*** finishing saves the edit to a string, which may or may not be transient
*** i.e., let someone else handle persistence

* use cases
**
** oneliner such as name of room or short-name
** room description
** simple essay
** ascii art
*** display should convert color codes, but editing should allow you to change color codes??
*** maybe toggle color code viewing on/off
** paste block of text from internet and edit from there
** urls, bullet points, special characters

* scratch

_Buffer

init( string )

text()

string line( int )

void replaceLine( int, string )

void deleteLine( int )

void wipe()

void appendLine( string )

<display, append, edit line, ?, abort, finish>

0 comments on commit f2287fc

Please sign in to comment.