• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンb9c4628cc7c95c556f9f44a6add68dff6c54d361 (tree)
日時2023-01-19 18:47:59
作者badcoff33 <none@none>
コミッターbadcoff33

ログメッセージ

merged

変更サマリ

差分

--- a/plugin/visuals.lua
+++ b/plugin/visuals.lua
@@ -47,26 +47,34 @@ end
4747 -- default to ON
4848 toggle_blinky()
4949
50-
5150 function hl_word_toggle()
5251 if hl_word_timer == nil or #vim.fn.timer_info(hl_word_timer) == 0 then
53- hl_word_timer = vim.fn.timer_start(500, cb_hl_word)
52+ cb_new_color_scheme()
53+ hl_word_timer = vim.fn.timer_start(1000, cb_hl_word)
54+ print("ON")
5455 else
5556 vim.fn.timer_stop(hl_word_timer)
5657 local save_winid = vim.fn.winnr()
5758 vim.cmd('windo match NONE')
5859 vim.cmd(save_winid .. ' wincmd w')
60+ print("OFF")
5961 end
6062 end
6163
64+local hl_word_curpos = {}
65+
6266 function cb_hl_word()
6367 local cword = vim.fn.expand("<cword>")
6468 if string.match(cword, "[a-zA-Z0-9_]") ~= nil then
65- vim.cmd('match HlWordUnderline "\\<' .. cword .. '\\>"')
69+ if vim.fn.getcurpos() ~= hl_word_curpos then
70+ vim.cmd('match HlWordUnderline "\\<' .. cword .. '\\>"')
71+ else
72+ hl_word_curpos = vim.fn.getcurpos()
73+ end
6674 else
6775 vim.cmd('match NONE')
6876 end
69- hl_word_timer = vim.fn.timer_start(500, cb_hl_word)
77+ hl_word_timer = vim.fn.timer_start(1000, cb_hl_word)
7078 end
7179
7280 -- Description: Print highlighting information at current cursor position.
@@ -84,8 +92,6 @@ vim.api.nvim_create_autocmd(
8492 { group = gid_visuals, pattern = { "*" }, callback = cb_new_color_scheme }
8593 )
8694
87-cb_new_color_scheme() -- set it up when Neovim starts
88-
8995 vim.api.nvim_create_user_command(
9096 "ToggleHlWord",
9197 "lua hl_word_toggle()",