Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 1ebe75c

Browse files
committed
bugfix: modules are correctly reloaded on save
1 parent b019550 commit 1ebe75c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/window.cc

+18-18
Original file line numberDiff line numberDiff line change
@@ -329,26 +329,26 @@ void Window::set_menu_actions() {
329329
Notebook::get().get_view(c)->configure();
330330
Notebook::get().configure(c);
331331
}
332-
if(view->file_path.extension().string()==".py"){
333-
auto file_path=view->file_path;
334-
while(file_path.has_parent_path()){
335-
auto parent=file_path.parent_path();
336-
if(parent==Config::get().python.plugin_directory){
337-
auto stem=file_path.stem().string();
338-
auto module=Python::get_loaded_module(stem);
339-
module=module ? Python::reload(module) : Python::import(stem);
340-
if(module)
341-
Terminal::get().print("Plugin `"+stem+"` was reloaded\n");
342-
else {
343-
if(Python::thrown_exception_matches(PyExc_SyntaxError))
344-
Terminal::get().print(Python::SyntaxError());
345-
else
346-
Terminal::get().print(Python::Error());
347-
}
348-
break;
332+
}
333+
if(view->file_path.extension().string()==".py"){
334+
auto file_path=view->file_path;
335+
while(file_path.has_parent_path()){
336+
auto parent=file_path.parent_path();
337+
if(parent==Config::get().python.plugin_directory){
338+
auto stem=file_path.stem().string();
339+
auto module=Python::get_loaded_module(stem);
340+
module=module ? Python::reload(module) : Python::import(stem);
341+
if(module)
342+
Terminal::get().print("Plugin `"+stem+"` was reloaded\n");
343+
else {
344+
if(Python::thrown_exception_matches(PyExc_SyntaxError))
345+
Terminal::get().print(Python::SyntaxError());
346+
else
347+
Terminal::get().print(Python::Error());
349348
}
350-
file_path=parent;
349+
break;
351350
}
351+
file_path=parent;
352352
}
353353
}
354354
}

0 commit comments

Comments
 (0)