Skip to content

Commit

Permalink
Run stylua (nvim-lua#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
dam9000 authored and mayronH committed Feb 21, 2024
1 parent 63d0054 commit 290c662
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lua/cmp-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmp.setup {
end,
},
completion = {
completeopt = 'menu,menuone,noinsert'
completeopt = 'menu,menuone,noinsert',
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
Expand Down
14 changes: 7 additions & 7 deletions lua/telescope-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ local function find_git_root()
local current_dir
local cwd = vim.fn.getcwd()
-- If the buffer is not associated with a file, return nil
if current_file == "" then
if current_file == '' then
current_dir = cwd
else
-- Extract the directory from the current file's path
current_dir = vim.fn.fnamemodify(current_file, ":h")
current_dir = vim.fn.fnamemodify(current_file, ':h')
end

-- Find the Git root directory from the current file's path
local git_root = vim.fn.systemlist("git -C " .. vim.fn.escape(current_dir, " ") .. " rev-parse --show-toplevel")[1]
local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1]
if vim.v.shell_error ~= 0 then
print("Not a git repository. Searching on current working directory")
print 'Not a git repository. Searching on current working directory'
return cwd
end
return git_root
Expand All @@ -42,9 +42,9 @@ end
local function live_grep_git_root()
local git_root = find_git_root()
if git_root then
require('telescope.builtin').live_grep({
search_dirs = {git_root},
})
require('telescope.builtin').live_grep {
search_dirs = { git_root },
}
end
end

Expand Down

0 comments on commit 290c662

Please sign in to comment.