Repository: spyder-ide/spyder

Issue:
Debugger panel is not updated correctly in latest 4.x
After merging PR #13327, the debugger panel is not updated with the blue arrow that signals where the debugger is placed in the editor:

![Selección_015](https://user-images.githubusercontent.com/365293/95005070-22734380-05b9-11eb-9d83-52ba56badaba.png)

@impact27, could you take a look at this one?


Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/plugin.py b/spyder/plugins/ipythonconsole/plugin.py
--- a/spyder/plugins/ipythonconsole/plugin.py
+++ b/spyder/plugins/ipythonconsole/plugin.py
@@ -280,7 +280,8 @@ def refresh_plugin(self):
             self.main.variableexplorer.set_shellwidget_from_id(id(sw))
             self.main.plots.set_shellwidget_from_id(id(sw))
             self.main.help.set_shell(sw)
-            self.sig_pdb_state.emit(sw.is_debugging(), sw.get_pdb_last_step())
+            self.sig_pdb_state.emit(
+                sw.is_waiting_pdb_input(), sw.get_pdb_last_step())
         self.update_tabs_text()
         self.sig_update_plugin_title.emit()
 
@@ -638,7 +639,7 @@ def get_pdb_state(self):
         """Get debugging state of the current console."""
         sw = self.get_current_shellwidget()
         if sw is not None:
-            return sw.is_debugging()
+            return sw.is_waiting_pdb_input()
         return False
 
     def get_pdb_last_step(self):
diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py
--- a/spyder/plugins/ipythonconsole/widgets/debugging.py
+++ b/spyder/plugins/ipythonconsole/widgets/debugging.py
@@ -205,8 +205,6 @@ def set_debug_state(self, is_debugging):
         else:
             self.end_history_session()
 
-        self.sig_pdb_state.emit(self.is_debugging(), self.get_pdb_last_step())
-
     def pdb_execute(self, line, hidden=False, echo_stack_entry=True,
                     add_history=True):
         """
@@ -267,6 +265,8 @@ def pdb_execute(self, line, hidden=False, echo_stack_entry=True,
 
             # Emit executing
             self.executing.emit(line)
+            self.sig_pdb_state.emit(
+                False, self.get_pdb_last_step())
 
         if self._pdb_input_ready:
             # Print the string to the console
@@ -318,12 +318,13 @@ def refresh_from_pdb(self, pdb_state):
             fname = pdb_state['step']['fname']
             lineno = pdb_state['step']['lineno']
 
+            last_pdb_loc = self._pdb_frame_loc
+            self._pdb_frame_loc = (fname, lineno)
+
             # Only step if the location changed
-            if (fname, lineno) != self._pdb_frame_loc:
+            if (fname, lineno) != last_pdb_loc:
                 self.sig_pdb_step.emit(fname, lineno)
 
-            self._pdb_frame_loc = (fname, lineno)
-
         if 'namespace_view' in pdb_state:
             self.set_namespace_view(pdb_state['namespace_view'])
 
@@ -479,6 +480,8 @@ def pdb_input(self, prompt, password=None):
             self._highlighter.highlighting_on = True
             # The previous code finished executing
             self.executed.emit(self._pdb_prompt)
+            self.sig_pdb_state.emit(
+                True, self.get_pdb_last_step())
 
         self._pdb_input_ready = True
 


Test patch: