on main help sign in
fix(ui): fix bug preventing pasting text on windows (#2126)
2d0a0e2Andrey Nering
internal/ui/model/ui.go+3
@@ -2921,6 +2921,9 @@ func (m *UI) handlePasteMsg(msg tea.PasteMsg) tea.Cmd {
2921 // Otherwise, paste as text.
2921 // Otherwise, paste as text.
2922 paths := fsext.ParsePastedFiles(msg.Content)
2922 paths := fsext.ParsePastedFiles(msg.Content)
2923 allExistsAndValid := func() bool {
2923 allExistsAndValid := func() bool {
2924+ if len(paths) == 0 {
2925+ return false
2926+ }
2924 for _, path := range paths {
2927 for _, path := range paths {
2925 if _, err := os.Stat(path); os.IsNotExist(err) {
2928 if _, err := os.Stat(path); os.IsNotExist(err) {
2926 return false
2929 return false