Implemented use of the order of url.open_categories_shown in the :open dialogue.
Reworded the description of this option to match.
This commit is contained in:
parent
a62aeb4abe
commit
a2b1e041d6
@ -62,20 +62,25 @@ def url(*, info):
|
||||
bookmarks = objreg.get('bookmark-manager').marks.items()
|
||||
searchengines = config.val.url.searchengines.items()
|
||||
categories = config.val.url.open_categories_shown
|
||||
models = {}
|
||||
|
||||
if searchengines and "searchengines" in categories:
|
||||
model.add_category(listcategory.ListCategory(
|
||||
'Search engines', searchengines, sort=False))
|
||||
models["searchengines"] = listcategory.ListCategory(
|
||||
'Search engines', searchengines, sort=False)
|
||||
|
||||
if quickmarks and "quickmarks" in categories:
|
||||
model.add_category(listcategory.ListCategory(
|
||||
models["quickmarks"] = listcategory.ListCategory(
|
||||
'Quickmarks', quickmarks, delete_func=_delete_quickmark,
|
||||
sort=False))
|
||||
sort=False)
|
||||
if bookmarks and "bookmarks" in categories:
|
||||
model.add_category(listcategory.ListCategory(
|
||||
'Bookmarks', bookmarks, delete_func=_delete_bookmark, sort=False))
|
||||
models["bookmarks"] = listcategory.ListCategory(
|
||||
'Bookmarks', bookmarks, delete_func=_delete_bookmark, sort=False)
|
||||
|
||||
if info.config.get('completion.web_history_max_items') != 0 and "history" in categories:
|
||||
hist_cat = histcategory.HistoryCategory(delete_func=_delete_history)
|
||||
model.add_category(hist_cat)
|
||||
models["history"] = hist_cat
|
||||
|
||||
for category in categories:
|
||||
model.add_category(models[category])
|
||||
|
||||
return model
|
||||
|
@ -1575,7 +1575,7 @@ url.open_categories_shown:
|
||||
- quickmarks
|
||||
- bookmarks
|
||||
- history
|
||||
desc: Which categories should be shown in the :open dialogue.
|
||||
desc: Which categories to show in the :open dialogue. The order of this list is used for ordering the categories.
|
||||
|
||||
|
||||
url.searchengines:
|
||||
|
Loading…
Reference in New Issue
Block a user