dotty.tools.dotc.repl.ammonite.terminal.filters

UndoFilter

Related Docs: object UndoFilter | package filters

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
Serializable, Serializable, Product, Equals, DelegateFilter, Filter, AnyRef, Any
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: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

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

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def filter: Filter

    Definition Classes
    UndoFilterDelegateFilter
  9. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  11. 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
    UndoFilterFilter
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. val maxUndo: Int

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

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

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

    Definition Classes
    AnyRef
  17. val op: (TermInfo) ⇒ Option[TermAction]

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

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

  20. 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 plai 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

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

    Definition Classes
    AnyRef
  22. def toString(): String

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

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

  25. var undoIndex: Int

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

  26. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. 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