selection

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditorInterface

type EditorInterface interface {
	GetCursor() types.Position // Need current cursor pos
}

EditorInterface defines what the selection manager needs from editor.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles text selection state and logic.

func NewManager

func NewManager(editor EditorInterface) *Manager

NewManager creates a new selection manager.

func (*Manager) ClearSelection

func (m *Manager) ClearSelection()

ClearSelection resets the selection state.

func (*Manager) GetSelection

func (m *Manager) GetSelection() (start types.Position, end types.Position, ok bool)

GetSelection returns the normalized selection range (start <= end).

func (*Manager) HasSelection

func (m *Manager) HasSelection() bool

HasSelection returns whether there is an active selection.

func (*Manager) IsLinewise added in v0.1.3

func (m *Manager) IsLinewise() bool

IsLinewise returns whether the selection is line-wise (Vim 'V' mode).

func (*Manager) IsSelecting

func (m *Manager) IsSelecting() bool

IsSelecting returns the raw selecting flag state.

func (*Manager) SetLinewise added in v0.1.3

func (m *Manager) SetLinewise(lw bool)

SetLinewise sets whether the selection is line-wise.

func (*Manager) StartOrUpdateSelection

func (m *Manager) StartOrUpdateSelection()

StartOrUpdateSelection is called when selection should start or extend (e.g., Shift+Move).

func (*Manager) UpdateSelectionEnd

func (m *Manager) UpdateSelectionEnd()

UpdateSelectionEnd updates just the end position of the selection to match the current cursor position.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL