Skip to content

Commit

Permalink
Merge pull request #43 from amedama41/feature/support_socket_and_fifo
Browse files Browse the repository at this point in the history
feat: support socket and fifo files
  • Loading branch information
obaland authored May 9, 2024
2 parents 43f19be + baf0af9 commit 1ebd8fb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/vfiler/actions/utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function M.open_preview(vfiler, context, view)

preview.line = vim.fn.line('.')
local item = view:get_item(preview.line)
if item.type == 'directory' then
if item.type ~= 'file' then
preview:close()
else
local hook = config.configs.hook.read_preview_file
Expand Down
18 changes: 18 additions & 0 deletions lua/vfiler/columns/name.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ function NameColumn.new()
},
highlight = 'vfilerHidden',
},
{
group = 'vfilerName_Socket',
name = 'socket',
region = {
start_mark = 'n.=</',
end_mark = end_mark,
},
highlight = 'vfilerSocket',
},
{
group = 'vfilerName_Fifo',
name = 'fifo',
region = {
start_mark = 'n.|</',
end_mark = end_mark,
},
highlight = 'vfilerFifo',
},
})
self.variable = true
self.stretch = true
Expand Down
7 changes: 6 additions & 1 deletion lua/vfiler/items/directory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ local function new_item(stat)
local item
if stat.type == 'directory' then
item = Directory.new(stat)
elseif stat.type == 'file' or stat.type == 'link' then
elseif
stat.type == 'file'
or stat.type == 'link'
or stat.type == 'fifo'
or stat.type == 'socket'
then
item = File.new(stat)
else
core.message.warning('Unknown "%s" file type. (%s)', stat.type, stat.path)
Expand Down
2 changes: 2 additions & 0 deletions plugin/vfiler.vim
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ highlight default link vfilerFile None
highlight default link vfilerHeader Statement
highlight default link vfilerHidden Comment
highlight default link vfilerLink Constant
highlight default link vfilerFifo Debug
highlight default link vfilerSocket Error
highlight default link vfilerSelected Title
highlight default link vfilerSize Statement
highlight default link vfilerTime None
Expand Down

0 comments on commit 1ebd8fb

Please sign in to comment.