Merge pull request #19 from barrett-ruth/feat/video

fix snippets
This commit is contained in:
Barrett Ruth 2025-09-13 09:11:13 +02:00 committed by GitHub
commit bc8d029e38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View file

@ -70,12 +70,23 @@ int main() {{
),
}
local user_snippets = {}
for _, snippet in pairs(config.snippets or {}) do
table.insert(user_snippets, snippet)
local default_map = {}
for _, snippet in pairs(default_snippets) do
default_map[snippet.trigger] = snippet
end
local user_map = {}
for _, snippet in pairs(config.snippets or {}) do
user_map[snippet.trigger] = snippet
end
local merged_map = vim.tbl_extend("force", default_map, user_map)
local all_snippets = {}
for _, snippet in pairs(merged_map) do
table.insert(all_snippets, snippet)
end
local all_snippets = vim.list_extend(default_snippets, user_snippets)
ls.add_snippets("cpp", all_snippets)
end

View file

@ -28,6 +28,7 @@ https://private-user-images.githubusercontent.com/62671086/489116291-391976d1-c2
## TODO
- finer-tuned problem limits (i.e. per-problem codeforces time, memory)
- better highlighting
- test case management
- USACO support