Skip to content

Commit dbb7327

Browse files
authored
Add ignore configs for more providers (#1036)
* Support ignore configs for more providers Any providers using the builtin searcher impl will support the feature of ignoring the certain files/folders in a project by specifying the ignore config via `provider.project-ignores.'your/project/directory'`. * Downgrade diagnostics log * refactor: introduce PickerUpdateInfo * Unify clap#state#process_progress_full() * Unify clap#state#update_picker() * Remove useless clap#picker#update() * Move more functions to picker.vim * Move to legacy#state.vim * Eliminate state.vim * Various minor refactorings * Introduce buffer_attach() * did_change * clippy * Add rustfmt.yml * no_compile * Upgrade to rust 1.76 * Update CHANGELOG.md
1 parent 324148f commit dbb7327

File tree

69 files changed

+794
-591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+794
-591
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v2
2828
- uses: actions-rs/toolchain@v1
2929
with:
30-
toolchain: stable
30+
toolchain: nightly
3131
components: rustfmt
3232
override: true
3333
- uses: actions-rs/cargo@v1

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
[winbar]
1111
enable = true
1212
```
13+
- Added project-specific ignore configs for more providers. You can use
14+
15+
```toml
16+
# Ignore the results from the certain files/folders.
17+
# For example, ignore the test files when searching in the folder ~/src/github.com/bitcoin/bitcoin.
18+
[provider.project-ignores."~/src/github.com/bitcoin/bitcoin"]
19+
ignore-file-path-pattern = ["test"]
20+
ignore-file-name-pattern = ["test"]
21+
```
1322

1423
## Fixed
1524

Cargo.lock

Lines changed: 41 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ config-md:
1414
clippy:
1515
cd crates && cargo clippy --workspace --all-features --all-targets -- -D warnings
1616

17+
fmt:
18+
cargo +nightly fmt --all
19+
1720
.PHONY: all maple python-dynamic-module config-md clippy

autoload/clap.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function! clap#_exit_provider() abort
174174

175175
call clap#sign#reset_all()
176176

177-
call clap#state#clear_post()
177+
call clap#picker#clear_state_post()
178178
endfunction
179179

180180
function! clap#_open_provider(provider_id_or_alias) abort
@@ -279,7 +279,7 @@ function! clap#open_provider(provider_id_or_alias) abort
279279
return
280280
endif
281281

282-
call clap#state#clear_pre()
282+
call clap#picker#clear_state_pre()
283283

284284
" g:__clap_provider_cwd can be set during this process, so this needs to be executed after s:clear_state()
285285
if has_key(g:clap.provider._(), 'source')

autoload/clap/api.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ else
3838
endif
3939

4040
function! clap#api#update_winbar(winid, winbar) abort
41+
if winheight(a:winid) < 2
42+
return 0
43+
endif
4144
if empty(a:winbar)
4245
let l:winbar = ''
4346
else

autoload/clap/impl/on_move.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if clap#maple#is_available()
2020
if a:error isnot v:null
2121
return
2222
endif
23-
call clap#state#update_picker_preview(has_key(a:result, 'result') ? a:result.result : a:result)
23+
call clap#picker#update_preview(has_key(a:result, 'result') ? a:result.result : a:result)
2424
endfunction
2525

2626
function! s:dispatch_on_move_impl() abort

autoload/clap/indicator.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ endfunction
4848
" If you feel the responsive is slow, try to disable the indicator.
4949
" especially for the outside async jobs which could be cpu-intensive.
5050
"
51-
" If the initial_size is possible, use clap#state#refresh_matches_count()
51+
" If the initial_size is possible, use clap#legacy#state#refresh_matches_count()
5252
" instead in that it will combine the initial_size info.
5353
function! s:indicator.render(formatted) abort
5454
if g:clap_disable_matches_indicator

autoload/clap/legacy/dispatcher.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if has('nvim')
3939

4040
function! s:set_matches_count() abort
4141
let matches_count = s:loaded_size + s:dropped_size
42-
call clap#state#refresh_matches_count(matches_count)
42+
call clap#legacy#state#refresh_matches_count(matches_count)
4343
endfunction
4444
else
4545
function! s:handle_cache(to_cache) abort
@@ -48,7 +48,7 @@ if has('nvim')
4848

4949
function! s:set_matches_count() abort
5050
let matches_count = s:loaded_size + len(g:clap.display.cache)
51-
call clap#state#refresh_matches_count(matches_count)
51+
call clap#legacy#state#refresh_matches_count(matches_count)
5252
endfunction
5353
endif
5454

@@ -163,7 +163,7 @@ else
163163
let matches_count = g:clap.display.line_count()
164164
endif
165165

166-
call clap#state#refresh_matches_count(matches_count)
166+
call clap#legacy#state#refresh_matches_count(matches_count)
167167
endfunction
168168

169169
function! s:post_check() abort

autoload/clap/legacy/filter.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ function! clap#legacy#filter#on_typed(FilterFn, query, candidates) abort
137137
let l:lines = [g:clap_no_matches_msg]
138138
let g:__clap_has_no_matches = v:true
139139
call g:clap.display.set_lines_lazy(lines)
140-
" In clap#state#refresh_matches_count() we reset the sign to the first line,
140+
" In clap#legacy#state#refresh_matches_count() we reset the sign to the first line,
141141
" But the signs are seemingly removed when setting the lines, so we should
142142
" postpone the sign update.
143-
call clap#state#refresh_matches_count(0)
143+
call clap#legacy#state#refresh_matches_count(0)
144144
if exists('g:__clap_lines_truncated_map')
145145
unlet g:__clap_lines_truncated_map
146146
endif
@@ -151,7 +151,7 @@ function! clap#legacy#filter#on_typed(FilterFn, query, candidates) abort
151151
else
152152
let g:__clap_has_no_matches = v:false
153153
call g:clap.display.set_lines_lazy(lines)
154-
call clap#state#refresh_matches_count(len(l:lines))
154+
call clap#legacy#state#refresh_matches_count(len(l:lines))
155155
endif
156156

157157
call g:clap#display_win.shrink_if_undersize()

0 commit comments

Comments
 (0)