File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,16 @@ def action_parent_dir(self) -> None:
116
116
directory_tree_open = self .code_browser .has_class ("-show-tree" )
117
117
if not directory_tree_open :
118
118
return
119
- new_path = self .config_object .path .parent .resolve ()
120
- if new_path != self .config_object .path :
121
- self .config_object .file_path = str (new_path )
122
- self .code_browser .directory_tree .path = new_path
119
+ if (
120
+ self .code_browser .directory_tree .path
121
+ != self .code_browser .directory_tree .path .parent
122
+ ):
123
+ self .code_browser .directory_tree .path = (
124
+ self .code_browser .directory_tree .path .parent
125
+ )
123
126
self .notify (
124
127
title = "Directory Changed" ,
125
- message = str (new_path ),
128
+ message = str (self . code_browser . directory_tree . path ),
126
129
severity = "information" ,
127
130
timeout = 1 ,
128
131
)
@@ -152,9 +155,9 @@ def action_reload(self) -> None:
152
155
message_lines = []
153
156
if reload_directory :
154
157
self .code_browser .directory_tree .reload ()
158
+ directory_name = self .code_browser .directory_tree .path .name or "/"
155
159
message_lines .append (
156
- "[bold]Directory:[/bold] "
157
- f"[italic]{ self .config_object .path .name } [/italic]"
160
+ "[bold]Directory:[/bold] " f"[italic]{ directory_name } [/italic]"
158
161
)
159
162
if reload_file :
160
163
selected_file_path = cast (UPath , self .code_browser .selected_file_path )
Original file line number Diff line number Diff line change @@ -200,7 +200,6 @@ def handle_directory_double_click(
200
200
Called when the user double clicks a directory in the directory tree.
201
201
"""
202
202
self .directory_tree .path = message .path
203
- self .config_object .file_path = str (message .path )
204
203
self .notify (
205
204
title = "Directory Changed" ,
206
205
message = str (message .path ),
Original file line number Diff line number Diff line change @@ -13,9 +13,7 @@ async def test_debug_app() -> None:
13
13
"""
14
14
Test the actual browsr app
15
15
"""
16
- config = TextualAppContext (
17
- file_path = "github://juftin:textual-universal-directorytree@main" , debug = True
18
- )
16
+ config = TextualAppContext (file_path = "." , debug = True )
19
17
app = Browsr (config_object = config )
20
18
async with app .run_test () as pilot :
21
19
_ = pilot .app
You can’t perform that action at this time.
0 commit comments