Skip to content

exp/textinput: byte slice APIs to handle big texts #3365

@hajimehoshi

Description

@hajimehoshi

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

The current APIs treat string objects:

func (f *Field) SetTextAndSelection(text string, selectionStartInBytes, selectionEndInBytes int)
func (f *Field) Text() string
func (f *Field) TextForRendering() string

This is inefficient especially when this handles pretty big text.

We might need APIs to handle byte slices (e.g. AppendText(bytes []byte) []byte). Also, the implementation can be a more efficient one, like a piece table.

Why is this needed?

In order to handle big texts.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions