Browse Source

Open Dialog now defaults to the current view's folder if the view is outside of the opened folder

merge-requests/365/head
eidheim 9 years ago
parent
commit
a17a54e549
  1. 7
      src/window.cc

7
src/window.cc

@ -306,7 +306,12 @@ void Window::set_menu_actions() {
});
menu.add_action("open_file", [this]() {
auto path=Dialog::open_file(Notebook::get().get_current_folder());
auto folder_path=Notebook::get().get_current_folder();
if(auto view=Notebook::get().get_current_view()) {
if(!Directories::get().path.empty() && !filesystem::file_in_path(view->file_path, Directories::get().path))
folder_path=view->file_path.parent_path();
}
auto path=Dialog::open_file(folder_path);
if(path!="")
Notebook::get().open(path);
});

Loading…
Cancel
Save