Skip to content

Commit

Permalink
refactor(highlight): consistency tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ggandor committed Mar 15, 2024
1 parent 1f7c33f commit 323d7cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions fnl/leap/highlight.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
[(dec wininfo.topline) 0]
[(dec wininfo.botline) -1]
{:priority self.priority.backdrop}))
(let [[curline curcol] (map dec [(vim.fn.line ".") (vim.fn.col ".")])
[win-top win-bot] [(dec (vim.fn.line "w0")) (dec (vim.fn.line "w$"))]
(let [[curline curcol] (map dec (get-cursor-pos))
[win-top win-bot] (map dec [(vim.fn.line "w0") (vim.fn.line "w$")])
[start finish] (if backward?
[[win-top 0] [curline curcol]]
[[curline (inc curcol)] [win-bot -1]])]
Expand All @@ -59,7 +59,7 @@
so we set a temporary highlight on it to see where we are."
(let [[line col] (get-cursor-pos)
line-str (vim.fn.getline line)
ch-at-curpos (case (vim.fn.strpart line-str (- col 1) 1 true)
ch-at-curpos (case (vim.fn.strpart line-str (dec col) 1 true)
"" " " ; on an emtpy line
ch ch)
id (api.nvim_buf_set_extmark 0 self.ns (dec line) (dec col)
Expand Down
6 changes: 3 additions & 3 deletions lua/leap/highlight.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 323d7cd

Please sign in to comment.