This repository was archived by the owner on Jun 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -252,18 +252,22 @@ void Window::set_menu_actions() {
252252 notebook.configure (c);
253253 }
254254 }
255- if (file_path>Config::get ().python .plugin_directory ){
256- auto stem=file_path.stem ().string ();
257- auto module =Python::get_loaded_module (stem);
258- module =module ? Python::reload (module ) : Python::import (stem);
259- if (module )
260- Terminal::get ().print (" Plugin `" +stem+" ` was reloaded\n " );
261- else {
262- if (Python::thrown_exception_matches (Python::Error::Type::Syntax))
263- Terminal::get ().print (Python::SyntaxError ());
264- else
265- Terminal::get ().print (Python::Error ());
255+ while (file_path.has_parent_path ()){
256+ if (file_path == Config::get ().python .plugin_directory ){
257+ auto stem=file_path.stem ().string ();
258+ auto module =Python::get_loaded_module (stem);
259+ module =module ? Python::reload (module ) : Python::import (stem);
260+ if (module )
261+ Terminal::get ().print (" Plugin `" +stem+" ` was reloaded\n " );
262+ else {
263+ if (Python::thrown_exception_matches (Python::Error::Type::Syntax))
264+ Terminal::get ().print (Python::SyntaxError ());
265+ else
266+ Terminal::get ().print (Python::Error ());
267+ }
268+ break ;
266269 }
270+ file_path=file_path.parent_path ();
267271 }
268272 }
269273 }
You can’t perform that action at this time.
0 commit comments