Skip to content
Permalink
Browse files

[pyqgis-console] allows comments and quotes folding in editor lexer

  • Loading branch information
slarosa committed Apr 29, 2013
1 parent 1959182 commit e755815ff0a7829e7624fc8f81500ddf9d8b8e23
Showing with 6 additions and 7 deletions.
  1. +5 −4 python/console/console_editor.py
  2. +1 −3 python/console/console_sci.py
@@ -82,9 +82,6 @@ def __init__(self, parent=None):
# Enable non-ascii chars for editor
self.setUtf8(True)

#self.insertInitText()
self.setLexers()

# Set the default font
font = QFont()
font.setFamily('Courier')
@@ -102,7 +99,7 @@ def __init__(self, parent=None):
self.setMarginsBackgroundColor(QColor("#f9f9f9"))
self.setCaretLineVisible(True)
self.setCaretLineBackgroundColor(QColor("#fcf3ed"))

# Clickable margin 1 for showing markers
# self.setMarginSensitivity(1, True)
# self.connect(self,
@@ -172,6 +169,7 @@ def __init__(self, parent=None):
self.uncommentScut.activated.connect(self.parent.pc.uncommentCode)

def settingsEditor(self):
# Set Python lexer
self.setLexers()
threshold = self.settings.value("pythonConsole/autoCompThresholdEditor", 2).toInt()[0]
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSourceEditor", 'fromAPI').toString()
@@ -209,6 +207,9 @@ def setLexers(self):
from qgis.core import QgsApplication

self.lexer = QsciLexerPython()
self.lexer.setIndentationWarning(QsciLexerPython.Inconsistent)
self.lexer.setFoldComments(True)
self.lexer.setFoldQuotes(True)

loadFont = self.settings.value("pythonConsole/fontfamilytextEditor", "Monospace").toString()
fontSize = self.settings.value("pythonConsole/fontsizeEditor", 10).toInt()[0]
@@ -73,9 +73,6 @@ def __init__(self, parent=None):
# Current line visible with special background color
self.setCaretWidth(2)

# Set Python lexer
self.setLexers()

self.settingsShell()

# Don't want to see the horizontal scrollbar at all
@@ -110,6 +107,7 @@ def __init__(self, parent=None):
self.completion_list_selected)

def settingsShell(self):
# Set Python lexer
self.setLexers()
threshold = self.settings.value("pythonConsole/autoCompThreshold", 2).toInt()[0]
self.setAutoCompletionThreshold(threshold)

0 comments on commit e755815

Please sign in to comment.
You can’t perform that action at this time.