fix: file menu not updating active item and other menu issues

- Preselecting previous folder wasn't working sometimes.
- `join_path()` didn't account for drive letters already having a separator.

Also refactors how `open_file_navigation_menu()` stores menu items value. As a side effect this is now a lot faster as we don't have to serialize each item's path into meta table, but instead we now store just a path string and handle it as needed.

closes #355
This commit is contained in:
tomasklaen
2022-10-31 11:10:25 +01:00
parent e8060c74ad
commit 5f5bf4b842
4 changed files with 59 additions and 58 deletions

View File

@@ -900,7 +900,7 @@ mp.add_key_binding(nil, 'open-file', function()
-- Update active file in directory navigation menu
local function handle_file_loaded()
if Menu:is_open('open-file') then
Elements.menu:activate_value(normalize_path(mp.get_property_native('path')))
Elements.menu:activate_one_value(normalize_path(mp.get_property_native('path')))
end
end