---
title: "EditingBuffer"
description: "The editing buffer

This class manages the all editing relate states, editing buffers, selection, styles, etc."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class EditingBuffer(
    /** The initial text of this editing buffer */
    text: AnnotatedString,
    /**
     * The initial selection range of this buffer. If you provide collapsed selection, it is treated
     * as the cursor position. The cursor and selection cannot exists at the same time. The
     * selection must points the valid index of the initialText, otherwise IndexOutOfBoundsException
     * will be thrown.
     */
    selection: TextRange,
)
```


The editing buffer

This class manages the all editing relate states, editing buffers, selection, styles, etc.


## Secondary Constructors

```kotlin
internal constructor(
    text: String,
    selection: TextRange,
) : this(AnnotatedString(text), selection)
```

## Companion Object



