nikolassv / bartib

A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
GNU General Public License v3.0
636 stars 34 forks source link

Improve fish completions #23

Closed NijeboerFrank closed 1 year ago

NijeboerFrank commented 1 year ago

Hi, I've updated some of the completions from my last PR:

Screenshot from 2023-05-04 12-54-51

nikolassv commented 1 year ago

Thank you for these improvements. They sound like good ideas. Unfortunately they do not seem to work. I just tested them in fish. For the continue subcommand I do not get a completion at all and for the description the completion seems to be broken. After I selected one of the entries It contains all three columns: the number, the description and the project.

I am not really a fish expert so I am not sure what may the error here, but could it perhaps be a problem with the calculation of the string lengths?

NijeboerFrank commented 1 year ago

It indeed had something to do with the calculation of the lengths. I have tested it and also ran into issues if I created large descriptions. I pushed a fix for it.

With regards to the continue completions: You need to type bartib continue and after pressing TAB you should be getting some options.

example

nikolassv commented 1 year ago

The completion for the description works fine now.

The completion for continue still broke in case bartib last -n 100 yielded more than 10 results. The problem was in the regexes in line 39 which did not account for index numbers with several digits. I fixed that.