tomlin7 / biscuit

Aesthetic, lightweight code editor with extension support
https://tomlin7.github.io/biscuit
MIT License
189 stars 27 forks source link

Recent folders/files: Remove non-existing directories on attempt to open #375

Closed tomlin7 closed 2 weeks ago

tomlin7 commented 4 months ago

Feature

The recently opened list may contain directories that no longer exist. On attempt to open such directories from recent links, remove them from database.

The recently opened files/folders are shown as a list in welcome page and through the palette. These leverage the list method here to generate lambda functions for each recent path.

image

Modify the lambda to call a custom function that will check if the path still exists. If it exists, proceed to open, otherwise, delete the path from db and return.

Jawwad011 commented 1 month ago

To resolve the issue of opening non-existent directories from the recent list:

  1. Retrieve recently opened directories from the database.
  2. Check if each directory still exists using os.path.exists().
  3. Remove non-existent directories from the database.
  4. Commit the changes to keep the list updated.
tomlin7 commented 1 month ago

@Jawwad011 thanks for the steps, as this is a rough issue outline opened months ago, I didn't document it properly, I'll add more details above.