Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coalesce some list updates #1348

Merged
merged 6 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions core/snippets/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ def update_snippets():
insertions_phrase_map.update(insertions_phrase)
wrapper_map.update(wrappers)

ctx.lists["user.snippet"] = insertion_map
ctx.lists["user.snippet_with_phrase"] = insertions_phrase_map
ctx.lists["user.snippet_wrapper"] = wrapper_map
ctx.lists.update(
{
"user.snippet": insertion_map,
"user.snippet_with_phrase": insertions_phrase_map,
"user.snippet_wrapper": wrapper_map,
}
)


def get_snippets() -> list[Snippet]:
Expand Down
16 changes: 12 additions & 4 deletions tags/file_manager/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,12 @@ def clear_lists():
or len(ctx.lists["self.file_manager_files"]) > 0
):
current_folder_page = current_file_page = 1
ctx.lists["self.file_manager_directories"] = []
ctx.lists["self.file_manager_files"] = []
ctx.lists.update(
{
"self.file_manager_directories": [],
"self.file_manager_files": [],
}
)
folder_selections = []
file_selections = []

Expand Down Expand Up @@ -371,8 +375,12 @@ def update_lists(path=None):
files = {}

current_folder_page = current_file_page = 1
ctx.lists["self.file_manager_directories"] = directories
ctx.lists["self.file_manager_files"] = files
ctx.lists.update(
{
"self.file_manager_directories": directories,
"self.file_manager_files": files,
}
)

folder_selections = list(set(directories.values()))
folder_selections.sort(key=str.casefold)
Expand Down