internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Setting  QT_SCREEN_SCALE_FACTORS is not working as expected
https://github.com/spyder-ide/spyder/issues/4316#issuecomment-318641751


Discussion:
I think the solution is to use `QT_SCALE_FACTOR` when users only pass one value to `high_dpi_custom_scale_factors` and `QT_SCREEN_SCALE_FACTORS` when there are several of them.

@rlaverde, please open a PR with that and ask the last user that reported the problem on issue #4316 to test it.

Resolving patch:
diff --git a/spyder/app/restart.py b/spyder/app/restart.py
--- a/spyder/app/restart.py
+++ b/spyder/app/restart.py
@@ -160,8 +160,13 @@ def main():
     #==========================================================================
     if CONF.get('main', 'high_dpi_custom_scale_factor'):
         factors = str(CONF.get('main', 'high_dpi_custom_scale_factors'))
-        os.environ['QT_SCREEN_SCALE_FACTORS'] = factors
+        f = list(filter(None, factors.split(';')))
+        if len(f) == 1:
+            os.environ['QT_SCALE_FACTOR'] = f[0]
+        else:
+            os.environ['QT_SCREEN_SCALE_FACTORS'] = factors
     else:
+        os.environ['QT_SCALE_FACTOR'] = ''
         os.environ['QT_SCREEN_SCALE_FACTORS'] = ''
 
     # Splash screen
diff --git a/spyder/app/start.py b/spyder/app/start.py
--- a/spyder/app/start.py
+++ b/spyder/app/start.py
@@ -72,8 +72,13 @@ def main():
     #==========================================================================
     if CONF.get('main', 'high_dpi_custom_scale_factor'):
         factors = str(CONF.get('main', 'high_dpi_custom_scale_factors'))
-        os.environ['QT_SCREEN_SCALE_FACTORS'] = factors
+        f = list(filter(None, factors.split(';')))
+        if len(f) == 1:
+            os.environ['QT_SCALE_FACTOR'] = f[0]
+        else:
+            os.environ['QT_SCREEN_SCALE_FACTORS'] = factors
     else:
+        os.environ['QT_SCALE_FACTOR'] = ''
         os.environ['QT_SCREEN_SCALE_FACTORS'] = ''
 
     # Prevent Spyder from crashing in macOS if locale is not defined


Test patch:
Repository: spyder-ide/spyder

Issue:
Error when rearranging tabs and multiple Editors
https://github.com/spyder-ide/spyder/issues/564#issuecomment-318436787

## Description of your problem

When I have two editors open with Spyder 3.2 (MacOS X version), I can rearrange the tabs in either window. When I do this with say editor 1, the filename tab order will update on both editors, but editor 2 will not update the actual file in that location. So in editor 1 I will change the order to File2, File1, File3, then editor 2 will show the tab order as File2, File1, File3--but the contents of editor 2 are still File1, File2, File3. Also, if I am editing the contents of File2 in editor 2 (labeled File1), File2 will not save until I switch to the tab labeled File2 in either editor--regardless of the file contents shown. However, the file does save correctly. A restart of Spyder fixes the labeling problem, but any rearrangement of the tabs has the same effect.


Discussion:
@rlaverde, thanks for opening this issue.
Having the same issue. Even if you close a file, you may still have a mislabeled tab open with that file's contents.

This should be marked critical and fixed in 3.2.1 rather than 3.2.2

Resolving patch:
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -2681,6 +2681,7 @@ def set_create_new_file_if_empty(self, value):
         for editorstack in self.editorstacks:
             editorstack.create_new_file_if_empty = value
 
+    @Slot(int, int)
     def move_editorstack_data(self, start, end):
         """Move editorstack.data to be synchronized when tabs are moved."""
         if start < 0 or end < 0:
@@ -2689,12 +2690,13 @@ def move_editorstack_data(self, start, end):
             steps = abs(end - start)
             direction = (end-start) // steps  # +1 for right, -1 for left
 
-            for editorstack in self.editorstacks :
-                data = editorstack.data
-                editorstack.blockSignals(True)
+            for editorstack in self.editorstacks:
+                if editorstack.isAncestorOf(self.sender()):
+                    data = editorstack.data
+                    editorstack.blockSignals(True)
 
-                for i in range(start, end, direction):
-                    data[i], data[i+direction] = data[i+direction], data[i]
+                    for i in range(start, end, direction):
+                        data[i], data[i+direction] = data[i+direction], data[i]
 
-                editorstack.blockSignals(False)
-                editorstack.refresh()
+                    editorstack.blockSignals(False)
+                    editorstack.refresh()


Test patch:
Repository: spyder-ide/spyder

Issue:
Error when trying to show indentation guidelines
## Description

**What steps will reproduce the problem?**

1. 
2. 
3. 

**What is the expected output? What do you see instead?**


**Please provide any additional information below**

  File "C:\Python\spyder-master\spyder\plugins\editor.py", line 2188, in toggle_show_indent_guides
    for editorstack in self.editorstacks:
TypeError: 'NoneType' object is not iterable


## Version and main components

* Spyder Version: 4.0.0.dev0 
* Python Version: 3.6.1
* Qt Versions: 5.9.1, PyQt5 5.9 on Windows

## Dependencies
```
pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.2 (OK)
numpy >=1.7      :  1.13.0 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  None (NOK)
qtconsole >=4.2.0:  4.3.0 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.1 (OK)

```



Discussion:
Thanks for reporting.

@rlaverde, I think this probably happens at startup.

Resolving patch:
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -2191,8 +2191,9 @@ def toggle_show_blanks(self, checked):
 
     @Slot(bool)
     def toggle_show_indent_guides(self, checked):
-        for editorstack in self.editorstacks:
-            editorstack.set_indent_guides(checked)
+        if self.editorstacks:
+            for editorstack in self.editorstacks:
+                editorstack.set_indent_guides(checked)
 
     @Slot()
     def remove_trailing_spaces(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
Static code analysis produces error when running with empty filename
## Description

**What steps will reproduce the problem?**

1. open spyder
2. open the static code analysis panel
3. click on "Analyze"

**What is the expected output? What do you see instead?**
I see an error message pop open (see image attached, could not copy/paste text) and nothing happens.

The beginning of the error message is as follows:

`Problem importing module variables.py: No module named functools_lru_cache`

**Please provide any additional information below**

KeyError: None



## Version and main components

* Spyder Version: 3.2.0 
* Python Version: 2.7.12
* Qt Versions: 5.6.2, PyQt5 5.6 on Windows

## Dependencies
```
pyflakes >=0.5.0  :  1.5.0 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pygments >=2.0    :  2.2.0 (OK)
pandas >=0.13.1   :  0.19.2 (OK)
numpy >=1.7       :  1.12.1 (OK)
sphinx >=0.6.6    :  1.5.4 (OK)
rope >=0.9.4      :  0.9.4 (OK)
jedi >=0.9.0      :  0.9.0 (OK)
nbconvert >=4.0   :  5.1.1 (OK)
sympy >=0.7.3     :  1.0 (OK)
cython >=0.21     :  0.25.2 (OK)
qtconsole >=4.2.0 :  4.3.0 (OK)
IPython >=4.0;<6.0:  5.3.0 (OK)
pylint >=0.25     :  1.6.4 (OK)

```
![image](https://user-images.githubusercontent.com/15459064/29097037-995ca5a8-7c4c-11e7-9918-1e8bf25ddc3f.png)



Discussion:
nevermind... F8 or manually typing the location of the file works as described in this SOF post: https://stackoverflow.com/questions/31054287/pylint-not-working-within-spyder



Resolving patch:
diff --git a/spyder/widgets/comboboxes.py b/spyder/widgets/comboboxes.py
--- a/spyder/widgets/comboboxes.py
+++ b/spyder/widgets/comboboxes.py
@@ -173,7 +173,7 @@ def selected(self):
 
     def validate(self, qstr, editing=True):
         """Validate entered path"""
-        if self.selected_text == qstr:
+        if self.selected_text == qstr and qstr != '':
             self.valid.emit(True, True)
             return
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Console slow to close when debugging
## Description of your problem

**What steps will reproduce the problem?**

1.  Start the debugger
2. Try to close the console
3. watch as spyder freezes for 5s

* Spyder Version: 4.0.0.dev0
* Python Version: 3.6.2
* Qt Version: 5.9.1
* PyQt Version: 5.9
* Operating system:macOS 10.12.6




Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py
--- a/spyder/plugins/ipythonconsole.py
+++ b/spyder/plugins/ipythonconsole.py
@@ -1212,6 +1212,9 @@ def close_client(self, index=None, client=None, force=False):
         if index is not None:
             client = self.tabwidget.widget(index)
 
+        # Close client
+        client.stop_button_click_handler()
+
         # Check if related clients or kernels are opened
         # and eventually ask before closing them
         if not self.mainwindow_close and not force:


Test patch:
Repository: spyder-ide/spyder

Issue:
Unable to start Array builder using keyboard shortcut
When I use Ctrl+M to start array builder in Spyder, I get the following error message. What is the issue?
  File "C:\Users\Gautham\Anaconda3\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", line 244, in <lambda>
    array_table = config_shortcut(lambda: self.enter_array_table(),
AttributeError: 'ShellWidget' object has no attribute 'enter_array_table'


## Version and main components

* Spyder Version: 3.2.0 
* Python Version: 3.6.0
* Qt Versions: 5.6.2, PyQt5 5.6 on Windows

## Dependencies
```
pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.1.3 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
numpy >=1.7      :  1.11.3 (OK)
sphinx >=0.6.6   :  1.5.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.9.0 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
IPython >=4.0    :  5.1.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

```



Discussion:
@ccordoba12 is this related to the ipyconsole restructure?
I get the same error if I try to open the array builder on the console but not on the editor

**Versions**
Spyder Version: 3.2.1
Python Version: 3.6.2
Qt 5.6.2, PyQt 5.6.0
Windows 10 64bit
**Dependencies:**
IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.26 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
numpy >=1.7      :  1.13.1 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.6.2 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
@andfoy, please take a look at this one.

Resolving patch:
diff --git a/spyder/widgets/ipythonconsole/shell.py b/spyder/widgets/ipythonconsole/shell.py
--- a/spyder/widgets/ipythonconsole/shell.py
+++ b/spyder/widgets/ipythonconsole/shell.py
@@ -257,10 +257,10 @@ def create_shortcuts(self):
         reset_namespace = config_shortcut(lambda: self.reset_namespace(),
                                           context='ipython_console',
                                           name='reset namespace', parent=self)
-        array_inline = config_shortcut(lambda: self.enter_array_inline(),
+        array_inline = config_shortcut(self._control.enter_array_inline,
                                        context='array_builder',
                                        name='enter array inline', parent=self)
-        array_table = config_shortcut(lambda: self.enter_array_table(),
+        array_table = config_shortcut(self._control.enter_array_table,
                                       context='array_builder',
                                       name='enter array table', parent=self)
 


Test patch:
Repository: spyder-ide/spyder

Issue:
"unblockcomment" incompatible with "automatically remove trailing spaces"
## Description of your problem

**What steps will reproduce the problem?**
For example, there are codes:
"""
import numpy as np

def test():
    return 1

test()
"""
1. Enable the feature "Automatically remove trailing spaces when saving files"
2. blockcomment (ctl+4) the piece of codes above
2. save the file (ctl+s)
3. unblockcomment (ctl+5)

**What is the expected output? What do you see instead?**
The expected output is
"""
import numpy as np

def test():
    return 1

test()
"""
However, we see
“”“
import numpy as np
\# def test():
    return 1
\# test()
”“”
**Please provide any additional information below**
It seems like the enabled feature (removing trailing spaces) removes the newline character when saving the file.

## Versions and main components

* Spyder Version: 3.1.3
* Python Version: 2.7.12
* Qt Version:
* PyQt Version:
* Operating system: Ubuntu 16.04


## Dependencies

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:
jedi =0.9.0      :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.3 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
psutil >=0.3     :  4.3.1 (OK)
pyflakes >=0.5.0 :  1.3.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.5.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4 (OK)
sphinx >=0.6.6   :  1.4.6 (OK)
sympy >=0.7.3    :  1.0 (OK)



Discussion:
Thanks for reporting. We'll take a look at it in a future release.

Resolving patch:
diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py
--- a/spyder/widgets/sourcecode/codeeditor.py
+++ b/spyder/widgets/sourcecode/codeeditor.py
@@ -2366,7 +2366,13 @@ def __in_block_comment(cursor):
         cursor3.setPosition(cursor1.position())
         cursor3.movePosition(QTextCursor.NextBlock)
         while cursor3.position() < cursor2.position():
-            cursor3.setPosition(cursor3.position()+2, QTextCursor.KeepAnchor)
+            cursor3.movePosition(QTextCursor.NextCharacter,
+                                 QTextCursor.KeepAnchor)
+            if not cursor3.atBlockEnd():
+                # standard commenting inserts '# ' but a trailing space on an
+                # empty line might be stripped.
+                cursor3.movePosition(QTextCursor.NextCharacter,
+                                     QTextCursor.KeepAnchor)
             cursor3.removeSelectedText()
             cursor3.movePosition(QTextCursor.NextBlock)
         for cursor in (cursor2, cursor1):


Test patch:
Repository: spyder-ide/spyder

Issue:
Word operators do not have a color style in the IPython console
## Description of your problem

**What steps will reproduce the problem?**

1. write in the IPython console: `for operator in [or, and, is, in]`:

![word_operator_not colored](https://user-images.githubusercontent.com/10170372/29630274-a20467c2-8809-11e7-9433-ddbec22be964.png)

**What is the expected output? What do you see instead?**
The word operators `in`, `and`, `is`, `or` should have the same style as `for` to match the behaviour of the Spyder editor.

![word_operator_colored](https://user-images.githubusercontent.com/10170372/29630267-9a8505f6-8809-11e7-89c0-a1d6c1387fb3.png)
 in]`

**Please provide any additional information below**


## Versions and main components

* Spyder Version: branch 3.x and master
* Python Version: 3.6.1
* Qt Version: 5.9.1
* PyQt Version: 5.9
* Operating system: Windows 7 64 bits

## Dependencies

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
numpy >=1.7      :  1.13.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.1 (OK)
qtconsole >=4.2.0:  4.4.0.dev (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.6.2 (OK)
sympy >=0.7.3    :  None (NOK)


Discussion:
@jnsebgosselin Is it possible to highlight self as well? Or is it already highlighted?

Resolving patch:
diff --git a/spyder/utils/ipython/style.py b/spyder/utils/ipython/style.py
--- a/spyder/utils/ipython/style.py
+++ b/spyder/utils/ipython/style.py
@@ -13,7 +13,8 @@
 
 # Third party imports
 from pygments.style import Style
-from pygments.token import Name, Keyword, Comment, String, Number, Punctuation
+from pygments.token import (Name, Keyword, Comment, String, Number,
+                            Punctuation, Operator)
 
 from qtconsole.styles import dark_color
 
@@ -158,7 +159,8 @@ def give_font_style(is_italic):
                         Comment: comment_token.strip(),
                         String: string_token.strip(),
                         Number: number_token.strip(),
-                        Punctuation: font_token.strip()}
+                        Punctuation: font_token.strip(),
+                        Operator.Word: keyword_token.strip()}
 
     return syntax_style_dic
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Run Configuration per file: Working Directory not remembered
## Description of your problem

**What steps will reproduce the problem?**

1. Open the `Run > Configuration per file...` dialog.
2. Check `Working Directory settings > The following directory:`.
3. Select a path.
4. `Run` the file.
5. Open the `Run > Configuration per file...` dialog again.


**What is the expected output? What do you see instead?**

I would expect to still see the path selected in step 3. in the directory box, but this box is empty.

**Please provide any additional information below**

`Run > Run` the file directly still honours the path selected in step 3.

## Versions and main components

* Spyder Version: 3.2.0
* Python Version: Python 3.5.2 64bits
* Qt Version: Qt 5.5.1
* PyQt Version: PyQt5 5.5.1
* Operating system: Linux


## Dependencies

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  None (NOK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
numpy >=1.7      :  1.12.0 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
psutil >=0.3     :  5.2.2 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.2 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
rope >=0.9.4     :  0.10.5 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
sympy >=0.7.3    :  1.0 (OK)



Discussion:
Thanks for reporting. We'll fix it after we release 3.2.1

Resolving patch:
diff --git a/spyder/plugins/runconfig.py b/spyder/plugins/runconfig.py
--- a/spyder/plugins/runconfig.py
+++ b/spyder/plugins/runconfig.py
@@ -289,6 +289,7 @@ def set(self, options):
         self.cwd_radio.setChecked(self.runconf.cw_dir)
         self.fixed_dir_radio.setChecked(self.runconf.fixed_dir)
         self.dir = self.runconf.dir
+        self.wd_edit.setText(self.dir)
 
     def get(self):
         self.runconf.args_enabled = self.clo_cb.isChecked()
@@ -303,7 +304,7 @@ def get(self):
         self.runconf.file_dir = self.file_dir_radio.isChecked()
         self.runconf.cw_dir = self.cwd_radio.isChecked()
         self.runconf.fixed_dir = self.fixed_dir_radio.isChecked()
-        self.runconf.dir = self.dir
+        self.runconf.dir = self.wd_edit.text()
         return self.runconf.get()
 
     def is_valid(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
Debug: If a breakpoint is on the first line of a script the whole script runs
## Description of your problem
This is also not going to happen too often. 

If a breakpoint is on the first line of a script and there are no other breakpoints, the whole script runs

If a breakpoint is on the first line of a script and there is another breakpoint, the first breakpoint is ignored

**What steps will reproduce the problem?**

1. start debugging with this script:
```
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
x = 1 # <- put break point here
print('I ran')
print('Me too')
print('Me three')
```
2. start debug
3. I get:
```
In [1]: debugfile('/home/user/Documents/debug_test.py', wdir='/home/user/Documents')
> /home/user/Documents/debug_test.py(3)<module>()
      1 #!/usr/bin/env python3
      2 # -*- coding: utf-8 -*-
1---> 3 x = 1 # <- put break point here
      4 print('I ran')
      5 print('Me too')

I ran
Me too
Me three

ipdb> 

In [2]: 
```

**What is the expected output? What do you see instead?**
It should stop at the break point

## Versions and main components

* Spyder Version: 3.x branch
* Python Version: 3.6
* Qt Version: 5.6
* PyQt Version: 5.6
* Operating system:


## Dependencies

cython >=0.21    :  0.25.2 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.3 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
psutil >=0.3     :  5.0.1 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.5.1 (OK)
sympy >=0.7.3    :  1.0 (OK)


Discussion:
> This is also not going to happen too often.

Leaving for 3.2.1 then. Thanks for helping us to test our debugger thoroughly.
@rlaverde, please take a look at this one. The code that tries to move automatically to the first breakpoint is here:

https://github.com/spyder-ide/spyder/blob/3.x/spyder/plugins/editor.py#L2406-L2408

We need to check if a breakpoint is placed in the first line that is not a comment or part of a docstring to apply it.

Resolving patch:
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -2403,8 +2403,13 @@ def debug_file(self):
         self.run_file(debug=True)
         # Fixes 2034
         editor = self.get_current_editor()
-        if editor.get_breakpoints():
+        breakpoints = editor.get_breakpoints()
+        if breakpoints:
             time.sleep(0.5)
+            if editor.get_cursor_line_number() == breakpoints[0][0]:
+                # Not need to execute any code because the first breakpoint
+                # is set in the first line with code
+                return
             self.debug_command('continue')
 
     @Slot()


Test patch: