-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large files performance #71
Comments
Just an idea: Checking buffer size in --- a/autoload/spelunker.vim
+++ b/autoload/spelunker.vim
@@ -220,6 +220,21 @@ function s:is_runnable()
return 0
endif
+ if exists('g:spelunker_buffer_size_threshold') && g:spelunker_buffer_size_threshold > 0
+ if exists('g:enable_spelunker_vim') && g:enable_spelunker_vim && !exists('b:enable_spelunker_vim')
+ let l:buf_size = line2byte('$') + len(getline('$'))
+ if l:buf_size > g:spelunker_buffer_size_threshold
+ let l:buf_name = bufname('%')
+ echom 'Spelunker.vim skipped this too long buffer. Do `Zt` instead:'
+ \ . ( len(l:buf_name) == 0 ? '' : ( ' buf = ''' . l:buf_name . ''',' ) )
+ \ . ' size = ' . l:buf_size . ' / ' . g:spelunker_buffer_size_threshold
+
+ let b:enable_spelunker_vim = 0
+ return 0
+ endif
+ endif
+ endif
+
return 1
endfunction
--- a/autoload/spelunker/toggle.vim
+++ b/autoload/spelunker/toggle.vim
@@ -65,13 +65,9 @@ endfunction
function! spelunker#toggle#toggle()
let g:enable_spelunker_vim = g:enable_spelunker_vim == 1 ? 0 : 1
- " 今開いているbufferも連動させる
+ " Clear the buffer-specific setting, and follow the global setting
if exists('b:enable_spelunker_vim')
- if g:enable_spelunker_vim == 1
- let b:enable_spelunker_vim = 1
- else
- let b:enable_spelunker_vim = 0
- endif
+ unlet b:enable_spelunker_vim
endif
call spelunker#toggle#init_buffer(1, g:enable_spelunker_vim) This works:
|
Anyway posted the patch. |
I have the same issue. And this line is my temporary solution util there's something nice builtin.
|
Installed this plugin 15 minutes ago, ran |
I know this plugin means to keep compatibility with vim, but I think a LSP version of this plugin would be cool. In the same vein as this VSCode plugin and its CoC counterpart |
Spelunker is very slow if used for large files O(10MiB).
I feel like I prefer to use
g:spelunker_check_type = 1
for most small-ish files.Only huge logs cause issues.
Please note that either disabling spelunker or setting
g:spelunker_check_type = 2
solves this problem for large files, but it also means thatg:spelunker_check_type = 2
is set for small files.It would be nice to have one of the following:
g:spelunker_check_type = 2
behaviourThe text was updated successfully, but these errors were encountered: