fortrangoingonforty/sniffly / f0f1463

Browse files

create empty tabs with no path to prevent accidental scans

Authored by espadonne
SHA
f0f1463d3a540d3cfdac6114ecce0fe61a583a4a
Parents
dcced97
Tree
b008e30

2 changed files

StatusFile+-
M src/gui/tab_manager.f90 6 0
M src/gui/tab_widget.f90 4 11
src/gui/tab_manager.f90modified
@@ -256,6 +256,12 @@ contains
256256
     character(len=256) :: basename
257257
     integer :: last_slash
258258
 
259
+    ! Special case: empty path (new empty tabs)
260
+    if (len_trim(path) == 0) then
261
+      basename = "Empty"
262
+      return
263
+    end if
264
+
259265
     ! Find last slash
260266
     last_slash = index(trim(path), "/", back=.true.)
261267
 
src/gui/tab_widget.f90modified
@@ -195,18 +195,11 @@ contains
195195
 
196196
     print *, "Plus button clicked - creating new tab"
197197
 
198
-    ! Get the current tab's path and use that for the new tab
199
-    ! TODO: Add directory picker to let user choose path
200
-    current_tab => get_tab(active_tab_index)
201
-    if (associated(current_tab)) then
202
-      new_tab_path = current_tab%scan_path
203
-    else
204
-      ! Fallback to home directory using environment variable
205
-      call get_environment_variable("HOME", new_tab_path)
206
-    end if
198
+    ! New tabs start completely empty - no path to avoid accidental scans
199
+    new_tab_path = ""
207200
 
208
-    ! Create a new tab with the same path as current tab
209
-    new_tab_index = create_tab(trim(new_tab_path))
201
+    ! Create a new empty tab
202
+    new_tab_index = create_tab(new_tab_path)
210203
 
211204
     if (new_tab_index < 0) then
212205
       print *, "ERROR: Failed to create new tab (max tabs reached?)"