jethrokuan / z

Pure-fish z directory jumping
MIT License
1.26k stars 44 forks source link

Use a function for generating directory completions #87

Closed sudormrfbin closed 4 years ago

sudormrfbin commented 4 years ago

The old implementation used a variable to store generated directory completions. Using a function to generate completions has many benefits:

  1. __z_complete doesn't have to be called every time an entry is added or removed to the data file.

  2. When using a variable, on each subsequesnt call to __z_complete, the completions are added to existing ones. So calling __z_complete on --clean is reduntant.

  3. Completions weren't updated on --delete; handled automatically now.