shun / ddu-source-rg

MIT License
31 stars 16 forks source link

Make gathering cancelable using abortable #14

Closed matsui54 closed 2 years ago

matsui54 commented 2 years ago

Like ddu-source-file_external, by this PR, gathering is stopped properly when quit action is executed while gathering. Also, live grep is now working well.

live_grep

Shougo commented 2 years ago

Also, live grep is now working well.

I think live grep way should be documented.

Shougo commented 2 years ago

It should be:

diff --git a/doc/ddu-source-rg.txt b/doc/ddu-source-rg.txt
index 69629e7..4bbcc3e 100644
--- a/doc/ddu-source-rg.txt
+++ b/doc/ddu-source-rg.txt
@@ -43,20 +43,20 @@ EXAMPLES                    *ddu-source-rg-examples*
     call ddu#start({'sources': [{'name': 'rg'}, 'params': {'input': word}]})

     " live grep
-    " You need to make volatile option v:true
-    " Note that matchers should be empty for performance
+    " You need to make "volatile" option v:true.
+    " Note: the matchers should be empty for performance
     command! DduRgLive call <SID>ddu_rg_live()
     function! s:ddu_rg_live() abort
       call ddu#start({
-            \ 'volatile': v:true,
-            \ 'sources': [{
-            \   'name': 'rg',
-            \   'options': {'matchers': []},
-            \ }],
-            \ 'uiParams': {'ff': {
-            \   'ignoreEmpty': v:false,
-       \   'autoResize': v:false,
-            \ }},
+            \   'volatile': v:true,
+            \   'sources': [{
+            \     'name': 'rg',
+            \     'options': {'matchers': []},
+            \   }],
+            \   'uiParams': {'ff': {
+            \     'ignoreEmpty': v:false,
+            \     'autoResize': v:false,
+            \   }},
             \ })
     endfunction
 <
matsui54 commented 2 years ago

Thanks. Fixed.

shun commented 2 years ago

Thanks for your good PR !