IndentationContext

Maintains the current indentation state during lexical preservation operations. This class encapsulates a mutable list of indentation elements (spaces/tabs) that represents the current indentation level. It provides methods to increase/decrease indentation and query the current state. Instances of this class are typically created at the start of a difference application and maintained throughout the process.

Constructors

Link copied to clipboard
constructor()
Creates a new IndentationContext with empty indentation.
constructor(initialIndentation: List<TextElement>)
Creates a new IndentationContext with the specified initial indentation.

Functions

Link copied to clipboard
open fun clear()
Clears all indentation, resetting to zero indentation.
Link copied to clipboard
open fun decrease()
Decreases indentation by one level.
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
Returns a copy of the current indentation elements.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun increase()
Increases indentation by one level.
Link copied to clipboard
open fun set(newIndentation: List<TextElement>)
Replaces the current indentation with the specified elements.
Link copied to clipboard
open fun size(): Int
Returns the number of indentation characters currently stored.
Link copied to clipboard
open fun toString(): String