Closed eblis closed 6 months ago
I attempted to return from function dir_generator:generate(line_state, builder)
if nothing is entered, but it's still filling out the command prompt with something (i was expecting it to do nothing), so the change is more complex it seems.
local word = get_cursor_word(line_state)
if not word or word == "" then
--rl_buffer:ding()
return
end
Thanks for reporting this.
word
wasn't nil, word
was an empty string (see get_cursor_word
, which always returns a string).
The issue was path.getdirectory(word)
can return nil if there's no directory (an empty string can't be a directory), and so the :sub()
call was being used against nil instead of against a string.
I get an exception when I press
Ctrl + \
combination without any text entered in the command prompt.