feat: toggle hidden directories in cd-browser with . key
This commit is contained in:
@@ -145,7 +145,8 @@ class TerminalUI:
|
||||
stdscr.refresh()
|
||||
return
|
||||
|
||||
path_text = str(navigator.current_path)
|
||||
hidden_status = "on" if navigator.show_hidden else "off"
|
||||
path_text = f"{navigator.current_path} [hidden: {hidden_status}]"
|
||||
stdscr.addnstr(0, 0, path_text, width - 1)
|
||||
|
||||
lines = build_render_lines(navigator)
|
||||
@@ -282,6 +283,11 @@ class TerminalUI:
|
||||
self._tree_scroll_offset = 0
|
||||
return None
|
||||
|
||||
if key == ord("."):
|
||||
navigator.toggle_hidden()
|
||||
self._tree_scroll_offset = 0
|
||||
return None
|
||||
|
||||
if key in (curses.KEY_ENTER, 10, 13):
|
||||
return navigator.selected_entry.path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user