Skip to content

Commit

Permalink
feat: ensure fixture names only available in ruby filetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
wassimk committed Mar 12, 2023
1 parent bebd14b commit c6688c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/cmp_rails_fixture_names/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ end
M.is_available = function()
local current_buffer_path = vim.fn.expand('%')

return vim.startswith(current_buffer_path, 'test/')
or vim.startswith(current_buffer_path, 'spec/')
return vim.bo.filetype == 'ruby'
and (
vim.startswith(current_buffer_path, 'test/') or vim.startswith(current_buffer_path, 'spec/')
)
end

M.get_trigger_characters = function()
Expand Down

0 comments on commit c6688c7

Please sign in to comment.