mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Allow deleting or replacing selections
This commit is contained in:
@@ -63,6 +63,18 @@ func (buffer *Buffer) Save() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (buffer *Buffer) GetSelectionEdges() (int, int) {
|
||||
if buffer.Selection == nil {
|
||||
return -1, -1
|
||||
}
|
||||
|
||||
if buffer.Selection.selectionStart < buffer.Selection.selectionEnd {
|
||||
return buffer.Selection.selectionStart, buffer.Selection.selectionEnd
|
||||
} else {
|
||||
return buffer.Selection.selectionEnd, buffer.Selection.selectionStart
|
||||
}
|
||||
}
|
||||
|
||||
func (buffer *Buffer) GetSelectedText() string {
|
||||
if buffer.Selection == nil {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user