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: Bump newly opened to top if exists in db #374

Closed tomlin7 closed 3 weeks ago

tomlin7 commented 4 months ago

Feature

The opened directories might exist in the recently opened list already. In such cases, bump them up to the top of list (to indicate they have been reopened). Make sure they are not copied every time opened. i.e. if the user opens a directory 5 times, the list shouldn't be filled with the same thing five times.

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 is in the db already. If it is, pop it and push it to the top of the stack. Otherwise normally push to top of stack.