Closed bodograumann closed 3 years ago
Yes, somehow idx
is undefined at
" autoload/ctrlspace/files.vim (line 23)
function! s:get_selected_file_or_buff(mod) abort
@jyscao Probably just missing an initial line
let idx = ctrlspace#window#SelectedIndex()
@bodograumann sorry, just noticed this now. And yes, this is definitely a goof caused by the new feature I added. I'll fix this asap
@bodograumann just pushed the fix, should be good now
@Konfekt that indeed was the problem. However while doing the initial debugging I stumbled upon a related bug, hence my not immediately applying your suggested fix. What happens is that the files list held by the s:Cache
object was not being populated when the editor and plugin are first loaded, thus even with idx
defined, Vim throws an index out of bounds error. This is also fixed now.
I now get different errors. When using i
:
Error detected while processing function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#file#GoToDirectory[1]..ctrlspace#files#GoToDirectory[12]..
119_get_selected_file_or_buff[2].. 119_get_selected_file[7]..function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#file#GoToDirectory[1]..ctrlspace#files#GoToDirect ory[12].. 119_get_selected_file_or_buff[2].. 119_get_selected_file: line 6: E684: list index out of range: 23 Error detected while processing function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#file#GoToDirectory[1]..ctrlspace#files#GoToDirectory: line 12: E171: Missing :endif
When pressing e
or y
:
Error detected while processing function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#file#EditFile[1]..ctrlspace#files#EditFile[1]..
119_get_selected_file_or_buff[2].. 119_get_selected_file[7]..function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#file#EditFile[1]..ctrlspace#files#EditFile[1].. 119get selected_file_or_buff[2].. 119_get_selected_file: line 6: E684: list index out of range: 23
I tried to reproduce in a new editor session, press <ctrl>
+<space>
then one of e
, y
and i
, and all are working normally for me.
Can you provide more detailed steps to reproduce?
@bodograumann I have a hunch of what the problem might be for you. Try refreshing your file cache first, then invoke one of those keys.
I will try to implement a better fix to this.
@bodograumann I pushed a better fix for this issue. Please test and let me know.
Yes! Now it is working perfectly again. Thank you for the fix. :heart:
Describe the bug When using
e
ory
in the buffer list I get the following error:To Reproduce Steps to reproduce the behavior:
e
Version(s) (please complete the following information):
Additional context Maybe you accidentally pushed a broken WIP to the master branch?