-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Describe the bug
When waiting a task by hitting 'w' and then trying to autocomplete e.g. 'tom' to 'tomorrow' by hitting TAB the following error is thrown:
Traceback (most recent call last):
File "/home/poberdie/.local/bin/vit", line 8, in <module>
sys.exit(main())
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/command_line.py", line 5, in main
Application(options, filters)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/application.py", line 75, in __init__
self.loop.run()
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 287, in run
self._run()
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 385, in _run
self.event_loop.run()
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 790, in run
self._loop()
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 827, in _loop
self._watch_files[fd]()
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/raw_display.py", line 416, in <lambda>
wrapper = lambda: self.parse_input(
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/raw_display.py", line 515, in parse_input
callback(processed, processed_codes)
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 412, in _update
self.process_input(keys)
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/main_loop.py", line 513, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/wimp.py", line 651, in keypress
return self._current_widget.keypress(size, key)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/application.py", line 65, in keypress
return super().keypress(size, key)
File "/home/poberdie/.local/lib/python3.8/site-packages/urwid/container.py", line 1123, in keypress
return self.footer.keypress((maxcol,),key)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/multi_widget.py", line 59, in keypress
return self.current_widget.keypress(size, key)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/command_bar.py", line 42, in keypress
self.autocomplete.activate(text, self.edit_pos, **kwargs)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/autocomplete.py", line 133, in activate
self.generate_tab_options(text, edit_pos)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/autocomplete.py", line 157, in generate_tab_options
self.parse_text(text, edit_pos)
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/autocomplete.py", line 192, in parse_text
self.prefix_parts = list(map(self.add_space_escaping, util.string_to_args(full_prefix)))
File "/home/poberdie/.local/lib/python3.8/site-packages/vit/autocomplete.py", line 182, in add_space_escaping
if self.space_escape_regex.match(text):
AttributeError: 'AutoComplete' object has no attribute 'space_escape_regex'
python version: 3.8
vit version: 2.1.0
taskwarrior version: 2.5.1
To Reproduce
As described above: The error occurs when trying to autocomplete something within the 'wait' command.
I suspect the setup_autocomplete method in application.py:
When called with the 'wait' operation, none of the if conditions apply and thus no autocomplete.setup is called for the wait command. This then results in space_escape_regex not initialized and thus results in the above AttributeError.
Expected behavior
I am expecting to either autocomplete during the wait command or do nothing if autocomplete is not available.