Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Jul 23, 2024
1 parent e364c4a commit 66ec1be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/internal/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ au(InsertCharPre, {
local ok = it:any(function(v)
return v == vim.bo[bufnr].buftype
end)
if not ok then
if ok then
return
end
local char = vim.v.char
local _, col = unpack(api.nvim_win_get_cursor(0))
local line_text = api.nvim_get_current_line()
col = col + 1 -- Adjust for 1-based index
if char == '/' and is_path_related(line_text, col - 1) then
local lnum, col = unpack(api.nvim_win_get_cursor(0))
local line_text = ffi.string(ffi.C.ml_get(lnum))
if char == '/' and is_path_related(line_text, col) then
feedkeys('<C-X><C-F>')
elseif not char:match('%s') and not buf_has_client(bufnr) then
feedkeys('<C-X><C-N>')
Expand Down

0 comments on commit 66ec1be

Please sign in to comment.