ammonite.terminal.filters

UndoFilter

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!

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UndoFilter
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. DelegateFilter
  7. Filter
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UndoFilter(maxUndo: Int = 25)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def currentUndo: (Vector[Char], Int)

  9. implicit val enclosing: Enclosing

    Definition Classes
    DelegateFilter
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def filter: Filter

    Definition Classes
    UndoFilterDelegateFilter
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def identifier: String

    the .toString of 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 .toString of 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
    DelegateFilterFilter
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. val maxUndo: Int

  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def op(ti: TermInfo): Option[TermAction]

    Definition Classes
    DelegateFilterFilter
  21. def pushUndos(b: Vector[Char], c: Int): Unit

  22. def redo(b: Vector[Char], c: Int): (Vector[Char], Int, Str)

  23. 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

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    Filter → AnyRef → Any
  26. def undo(b: Vector[Char], c: Int): (Vector[Char], Int, Str)

  27. 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 maxUndo in length we remove one element from the start whenever we append one element to the end, which costs O(n). On the other hand, It also costs O(n) to maintain the buffer of previous states, and so n is probably going to be pretty small anyway (tens?) so O(n) is perfectly fine.

  28. var undoIndex: Int

    The current position in the undoStack that the terminal is currently in.

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def wrap(bc: (Vector[Char], Int, Str), rest: LazyList[Int]): TermState

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DelegateFilter

Inherited from Filter

Inherited from AnyRef

Inherited from Any

Ungrouped