-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental support of clap plugin (#950)
* Clap plugin * Introduce PluginSession * Rename to notify_provider() * Remove unused other notification variant * Commit plugin/mod.rs * Skip matchdelete if win is not valid * Separate out plugin/highlight_cursor_word.rs * Return WordHighlights in find_highlight_positions() * Update last_cword when current cword is empty * Fix line start 0 * Clean up * Skip when cursor word is not meaningful * Use byte positions * Fix multiple words in a line * Distinguish the current and others * Fixes * I * Move clap#init#() into clap#() * Introduce g:clap_start_server_on_startup * Refactor service * Minor refactorings * Clean up * Fix clippy * Make session_id in MethodCall optional * Nits * Separate out plugin * Rename clap#client#notify() to clap#client#notify_provider() * Do not return early for the same word * Minor refactorings Rename to request_async() Nits * Nits * Clear highlights on InsertEnter * Fix col index * open-config * Adjust display line width * Add ignore-comment-line config * Remove unnecessary clone * Nits * Add ignore_files * Adjust context tag header line width * getpos() * Adjust grep sink * Fix clippy * Fxi deprecated clap#client#call_on_move() * markdown_toc plugin * preview title for recent_files * Fix clippy * Refactor note_recent_files * Add help for g:clap_start_server_on_startup * update-toc & delete-toc * Initialize tagfiles provider Copied from #557 * Make tagfiles compile * Minor refactorings to tagfiles * tagfiles provider * Add [input-history] config * Add g:clap_plugin_experimental * Add blines TODO * Fix tagfiles * Empty on_move impl for tagfiles * Add [input-history] config * Add g:clap_plugin_experimental * Add blines TODO * Initialize tagfiles provider Copied from #557 * Make tagfiles compile * Minor refactorings to tagfiles * Introduce tagfiles provider Use empty on_move impl for tagfiles. * Fix tagfiles Fix tagfiles sink * Tiny refactorings * extract handle_action() * Add color-eyre * Always load ftplugin clap * Start using markdown_toc plugin in README.md * Add TODO * Fix win_is_valid api * api: append_and_write() * Fix tests * Keep plugin undocumented for now
- Loading branch information
1 parent
d7dcadd
commit 9560801
Showing
62 changed files
with
1,712 additions
and
621 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
" Author: liuchengxu <xuliuchengxlc@gmail.com> | ||
|
||
let s:save_cpo = &cpoptions | ||
set cpoptions&vim | ||
|
||
hi ClapUnderline gui=underline cterm=underline | ||
|
||
hi default link ClapCurrentWord IncSearch | ||
hi default link ClapCurrentWordTwins ClapUnderline | ||
|
||
function! clap#plugin#highlight_cursor_word#add_highlights(word_highlights) abort | ||
let cword_len = a:word_highlights.cword_len | ||
let match_ids = [] | ||
let [lnum, col] = a:word_highlights.cword_highlight | ||
let match_id = matchaddpos('ClapCurrentWord', [[lnum, col+1, cword_len]]) | ||
if match_id > -1 | ||
call add(match_ids, match_id) | ||
endif | ||
for [lnum, col] in a:word_highlights.other_words_highlight | ||
let match_id = matchaddpos('ClapCurrentWordTwins', [[lnum, col+1, cword_len]]) | ||
if match_id > -1 | ||
call add(match_ids, match_id) | ||
endif | ||
endfor | ||
return match_ids | ||
endfunction | ||
|
||
let &cpoptions = s:save_cpo | ||
unlet s:save_cpo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.