mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-27 20:54:21 +01:00
fix: pasting issue (#1182)
This commit is contained in:
@@ -60,6 +60,10 @@ func (s selection) selecting() bool {
|
||||
return s.startX >= 0 && s.startY >= 0
|
||||
}
|
||||
|
||||
func (s selection) hasCompleteSelection() bool {
|
||||
return s.startX >= 0 && s.startY >= 0 && s.endX >= 0 && s.endY >= 0
|
||||
}
|
||||
|
||||
func (s selection) coords(offset int) selection {
|
||||
// selecting backwards
|
||||
if s.startY > s.endY && s.endY >= 0 {
|
||||
@@ -127,7 +131,7 @@ func (m *messagesComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
|
||||
case tea.MouseReleaseMsg:
|
||||
if m.selection.selecting() {
|
||||
if m.selection.hasCompleteSelection() {
|
||||
m.selection = selection{
|
||||
startX: -1,
|
||||
startY: -1,
|
||||
|
||||
Reference in New Issue
Block a user