Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Replace charcol that is only supported in neovim 0.7 #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lua/hop/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ function M.get_window_context(multi_windows)
-- Generate contexts of windows
local cur_hwin = vim.api.nvim_get_current_win()
local cur_hbuf = vim.api.nvim_win_get_buf(cur_hwin)
local cur_col = vim.fn.strwidth(vim.api.nvim_get_current_line():sub(1, vim.fn.col('.')))

all_ctxs[#all_ctxs + 1] = {
hbuf = cur_hbuf,
contexts = { window_context(cur_hwin, {vim.fn.line('.'), vim.fn.charcol('.')} ) },
contexts = { window_context(cur_hwin, {vim.fn.line('.'), cur_col} ) },
}

if not multi_windows then
Expand Down