case class UndoFilter(maxUndo: Int = 25) extends DelegateFilter with Product with Serializable
A filter that implements "undo" functionality in the ammonite REPL. It
shares the same Ctrl - hotkey that the bash undo, but shares behavior
with the undo behavior in desktop text editors:
- Multiple deletes in a row get collapsed
- In addition to edits you can undo cursor movements: undo will bring your
cursor back to location of previous edits before it undoes them
- Provides "redo" functionality under Alt -/Esc -: un-undo the things
you didn't actually want to undo!
- Alphabetic
- By Inheritance
- UndoFilter
- Serializable
- Serializable
- Product
- Equals
- DelegateFilter
- Filter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new UndoFilter(maxUndo: Int = 25)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def currentUndo: (Vector[Char], Int)
-
implicit
val
enclosing: Enclosing
- Definition Classes
- DelegateFilter
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
filter: Filter
- Definition Classes
- UndoFilter → DelegateFilter
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
identifier: String
the
.toStringof this object, except by making it separate we force the implementer to provide something and stop them from accidentally leaving it as the meaningless default.the
.toStringof this object, except by making it separate we force the implementer to provide something and stop them from accidentally leaving it as the meaningless default.- Definition Classes
- DelegateFilter → Filter
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maxUndo: Int
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
op(ti: TermInfo): Option[TermAction]
- Definition Classes
- DelegateFilter → Filter
- def pushUndos(b: Vector[Char], c: Int): Unit
- def redo(b: Vector[Char], c: Int): (Vector[Char], Int, Str)
-
var
state: UndoState
An enum representing what the user is "currently" doing.
An enum representing what the user is "currently" doing. Used to collapse sequential actions into one undo step: e.g. 10 plain chars typed becomes 1 undo step, or 10 chars deleted becomes one undo step, but 4 chars typed followed by 3 chars deleted followed by 3 chars typed gets grouped into 3 different undo steps
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Filter → AnyRef → Any
- def undo(b: Vector[Char], c: Int): (Vector[Char], Int, Str)
-
val
undoBuffer: Buffer[(Vector[Char], Int)]
The current stack of states that undo/redo would cycle through.
The current stack of states that undo/redo would cycle through.
Not really the appropriate data structure, since when it reaches
maxUndoin length we remove one element from the start whenever we append one element to the end, which costsO(n). On the other hand, It also costsO(n)to maintain the buffer of previous states, and sonis probably going to be pretty small anyway (tens?) soO(n)is perfectly fine. -
var
undoIndex: Int
The current position in the undoStack that the terminal is currently in.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def wrap(bc: (Vector[Char], Int, Str), rest: LazyList[Int]): TermState