command-t icon indicating copy to clipboard operation
command-t copied to clipboard

Barfs if interrupted during scanning

Open wincent opened this issue 9 years ago • 2 comments

Open Command-T for the first time and hit Control-C before it has finished scanning and you will see:

Error detected while processing function commandt#FileFinder:
line    2:
E21: Cannot make changes, 'modifiable' is off
E21: Cannot make changes, 'modifiable' is off
IndexError: line number 2 out of range

This is a regression, I believe. My hunch is that it probably came in with bfabb96351176c76d, but I haven't verified that yet.

wincent avatar Jan 19 '16 21:01 wincent

I was wrong about my hunch.

Did some digging (via vim -V20logfile). This line is the one that is causing the "out of range" error (truncated):

Error detected while processing function commandt#FileFinder:
line    2:
E21: Cannot make changes, 'modifiable' is off
E21: Cannot make changes, 'modifiable' is off
line 2: echo '/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `append''^@/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `block in print_matches''^@/Users/g
line 2: echo '/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `append''^@/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `block in print_matches''^@/Users/g
line 2: echo '/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `append''^@/Users/glh/.vim/bundle/command-t/ruby/command-t/match_window.rb:428:in `block in print_matches''^@/Users/g
IndexError: line number 2 out of range
function commandt#FileFinder aborted

If I wrap that in begin/rescue I still see the E21 errors. Going to look into :h catch-interrupt and see if it offers and words of wisdom.

wincent avatar Jan 19 '16 22:01 wincent

Here's another potential avenue, turned up by Googling.

wincent avatar Jan 19 '16 23:01 wincent

Given the big rewrite for v6.0.x, I'm closing all older issues as there is unlikely to be anything significant happening on the 5-x-devel branch from here on[^patches]. Feedback issue for 6.0.x is here:

  • https://github.com/wincent/command-t/issues/393

[^patches]: Patches and PRs would be welcome, but my personal efforts are going to be directed towards main.

wincent avatar Aug 26 '22 21:08 wincent