We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent baa7267 commit 544dd15Copy full SHA for 544dd15
lua/lualine/components/branch/git_branch.lua
@@ -77,8 +77,8 @@ function M.find_git_dir(dir_path)
77
-- get file dir so we can search from that dir
78
local file_dir = dir_path or vim.fn.expand('%:p:h')
79
80
- local oil_exists, oil = pcall(require, 'oil')
81
- if oil_exists then
+ if package.loaded.oil then
+ local oil = require('oil')
82
local ok, dir = pcall(oil.get_current_dir)
83
if ok and dir and dir ~= '' then
84
file_dir = vim.fn.fnamemodify(dir, ':p:h')
0 commit comments