Main: fix cut selection deleting selection before copying.

This commit is contained in:
Luke I. Wilson 2021-04-02 15:05:59 -05:00
parent d1dd389dba
commit 1b50aff0c6

View File

@ -287,11 +287,11 @@ func main() {
bytes := te.GetSelectedBytes() bytes := te.GetSelectedBytes()
var err error var err error
if len(bytes) > 0 { // If something is selected... if len(bytes) > 0 { // If something is selected...
te.Delete(false) // Delete the selection
err = ClipWrite(string(bytes)) // Add the selectedStr to clipboard err = ClipWrite(string(bytes)) // Add the selectedStr to clipboard
if err != nil { if err != nil {
showErrorDialog("Clipboard Failure", fmt.Sprintf("%v", err), nil) showErrorDialog("Clipboard Failure", fmt.Sprintf("%v", err), nil)
} }
te.Delete(false) // Delete selection
} }
if err == nil { // Prevent hiding error dialog if err == nil { // Prevent hiding error dialog
changeFocus(tabContainer) changeFocus(tabContainer)