fix: file type handling on Enter - extensions checked before executable bit
- Reorder Category() to check known extensions (text, config, image, pdf, audio, video, archive) before the executable bit check. Fixes video/audio/image files with executable bit being opened in editor instead of system default application. - Remove 'executable' from isEditableEntry() - executables are now launched via handleExecute() instead of opened in Neovim. - Add handleExecute() method that runs executable files in the terminal via tea.ExecProcess. - Update handleOpenSelected() to route: text/config -> editor, executable -> launch, everything else -> system default (xdg-open). - Bump version to v0.2.1
This commit is contained in:
parent
c0df75c57e
commit
df4df6b8f6
3 changed files with 35 additions and 17 deletions
|
|
@ -116,14 +116,14 @@ func (e Entry) Category() string {
|
|||
return "parent"
|
||||
case e.IsDir:
|
||||
return "directory"
|
||||
case e.IsExecutable():
|
||||
return "executable"
|
||||
case hasExt(configExtensions, e.Extension):
|
||||
return "config"
|
||||
case hasExt(imageExtensions, e.Extension):
|
||||
return "image"
|
||||
case hasExt(textExtensions, e.Extension):
|
||||
return "text"
|
||||
case hasExt(textFilenames, strings.ToLower(e.Name)):
|
||||
return "text"
|
||||
case hasExt(imageExtensions, e.Extension):
|
||||
return "image"
|
||||
case hasExt(pdfExtensions, e.Extension):
|
||||
return "pdf"
|
||||
case hasExt(audioExtensions, e.Extension):
|
||||
|
|
@ -132,8 +132,8 @@ func (e Entry) Category() string {
|
|||
return "video"
|
||||
case hasExt(archiveExtensions, e.Extension):
|
||||
return "archive"
|
||||
case hasExt(textFilenames, strings.ToLower(e.Name)):
|
||||
return "text"
|
||||
case e.IsExecutable():
|
||||
return "executable"
|
||||
default:
|
||||
return "binary"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue