mirror of
https://github.com/osyo-manga/vim-brightest.git
synced 2025-11-09 12:03:54 -05:00
call the CursorMoved to the next CursorHold
This commit is contained in:
@@ -2,8 +2,8 @@ scriptencoding utf-8
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" let s:V = vital#of("vital")
|
let s:V = vital#of("vital")
|
||||||
let s:V = vital#of("brightest")
|
" let s:V = vital#of("brightest")
|
||||||
let s:Prelude = s:V.import("Prelude")
|
let s:Prelude = s:V.import("Prelude")
|
||||||
let s:Buffer = s:V.import("Coaster.Buffer")
|
let s:Buffer = s:V.import("Coaster.Buffer")
|
||||||
let s:Search = s:V.import("Coaster.Search")
|
let s:Search = s:V.import("Coaster.Search")
|
||||||
@@ -70,6 +70,11 @@ function! s:highlight_off()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! Test()
|
||||||
|
call s:Highlight.as_windo().disable_all()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
let s:old_enable_window_all = g:brightest#enable_highlight_all_window
|
let s:old_enable_window_all = g:brightest#enable_highlight_all_window
|
||||||
function! brightest#hl_clear()
|
function! brightest#hl_clear()
|
||||||
if empty(s:Highlight.hl_list())
|
if empty(s:Highlight.hl_list())
|
||||||
@@ -267,16 +272,21 @@ function! s:is_enable_on_cursorhold()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:is_CursorMoved = 1
|
||||||
function! brightest#on_CursorHold()
|
function! brightest#on_CursorHold()
|
||||||
if s:is_enable() && s:is_enable_on_cursorhold()
|
" Workaround : call the CursorMoved to the next CursorHold
|
||||||
|
" call feedkeys(mode() ==# 'i' ? "\<C-g>\<ESC>" : "g\<ESC>", 'n')
|
||||||
|
if s:is_enable() && s:is_enable_on_cursorhold() && s:is_CursorMoved
|
||||||
call brightest#highlighting()
|
call brightest#highlighting()
|
||||||
endif
|
endif
|
||||||
|
let s:is_CursorMoved = 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
let g:brightest#enable_clear_highlight_on_CursorMoved = get(g:, "brightest#enable_clear_highlight_on_CursorMoved", 1)
|
let g:brightest#enable_clear_highlight_on_CursorMoved = get(g:, "brightest#enable_clear_highlight_on_CursorMoved", 1)
|
||||||
|
|
||||||
function! brightest#on_CursorMoved()
|
function! brightest#on_CursorMoved()
|
||||||
|
let s:is_CursorMoved = 1
|
||||||
let mode = mode()
|
let mode = mode()
|
||||||
|
|
||||||
if s:is_enable_on_cursorhold() && g:brightest#enable_clear_highlight_on_CursorMoved
|
if s:is_enable_on_cursorhold() && g:brightest#enable_clear_highlight_on_CursorMoved
|
||||||
|
|||||||
Reference in New Issue
Block a user