mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[pyqgis-console] avoids IndexError when attempts to run unselected code by keybinding Ctrl+E
This commit is contained in:
parent
4db6396938
commit
b99d51d7cd
@ -514,16 +514,17 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
|
||||
|
||||
def insertFromDropPaste(self, textDP):
|
||||
pasteList = unicode(textDP).splitlines()
|
||||
for line in pasteList[:-1]:
|
||||
cleanLine = line.replace(">>> ", "").replace("... ", "")
|
||||
self.insert(unicode(cleanLine))
|
||||
self.move_cursor_to_end()
|
||||
self.runCommand(unicode(self.currentCommand()))
|
||||
if pasteList[-1] != "":
|
||||
line = pasteList[-1]
|
||||
cleanLine = line.replace(">>> ", "").replace("... ", "")
|
||||
self.insert(unicode(cleanLine))
|
||||
self.move_cursor_to_end()
|
||||
if pasteList:
|
||||
for line in pasteList[:-1]:
|
||||
cleanLine = line.replace(">>> ", "").replace("... ", "")
|
||||
self.insert(unicode(cleanLine))
|
||||
self.move_cursor_to_end()
|
||||
self.runCommand(unicode(self.currentCommand()))
|
||||
if pasteList[-1] != "":
|
||||
line = pasteList[-1]
|
||||
cleanLine = line.replace(">>> ", "").replace("... ", "")
|
||||
self.insert(unicode(cleanLine))
|
||||
self.move_cursor_to_end()
|
||||
|
||||
def insertTextFromFile(self, listOpenFile):
|
||||
for line in listOpenFile[:-1]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user