mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-18 00:06:00 -04:00
[pyqgis-console] small fix for autocompletion bracket, also sets to False the default setting
This commit is contained in:
parent
580b947498
commit
c2310fdbdb
@ -650,7 +650,7 @@ class Editor(QsciScintilla):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
def keyPressEvent(self, e):
|
||||||
if self.settings.value("pythonConsole/autoCloseBracketEditor", True, type=bool):
|
if self.settings.value("pythonConsole/autoCloseBracketEditor", False, type=bool):
|
||||||
startLine, _, endLine, endPos = self.getSelection()
|
startLine, _, endLine, endPos = self.getSelection()
|
||||||
t = unicode(e.text())
|
t = unicode(e.text())
|
||||||
## Close bracket automatically
|
## Close bracket automatically
|
||||||
@ -674,7 +674,7 @@ class Editor(QsciScintilla):
|
|||||||
self.insert(self.closing[i])
|
self.insert(self.closing[i])
|
||||||
## FIXES #8392 (automatically removes the redundant char
|
## FIXES #8392 (automatically removes the redundant char
|
||||||
## when autoclosing brackets option is enabled)
|
## when autoclosing brackets option is enabled)
|
||||||
if t in self.closing:
|
if t in [')', ']', '}']:
|
||||||
l, pos = self.getCursorPosition()
|
l, pos = self.getCursorPosition()
|
||||||
txt = self.text(l)
|
txt = self.text(l)
|
||||||
try:
|
try:
|
||||||
|
@ -410,7 +410,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
self.showNext()
|
self.showNext()
|
||||||
## TODO: press event for auto-completion file directory
|
## TODO: press event for auto-completion file directory
|
||||||
else:
|
else:
|
||||||
if self.settings.value("pythonConsole/autoCloseBracket", True, type=bool):
|
if self.settings.value("pythonConsole/autoCloseBracket", False, type=bool):
|
||||||
t = unicode(e.text())
|
t = unicode(e.text())
|
||||||
## Close bracket automatically
|
## Close bracket automatically
|
||||||
if t in self.opening:
|
if t in self.opening:
|
||||||
@ -425,7 +425,7 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
self.insert(self.closing[i])
|
self.insert(self.closing[i])
|
||||||
## FIXES #8392 (automatically removes the redundant char
|
## FIXES #8392 (automatically removes the redundant char
|
||||||
## when autoclosing brackets option is enabled)
|
## when autoclosing brackets option is enabled)
|
||||||
if t in self.closing:
|
if t in [')', ']', '}']:
|
||||||
l, pos = self.getCursorPosition()
|
l, pos = self.getCursorPosition()
|
||||||
txt = self.text(l)
|
txt = self.text(l)
|
||||||
try:
|
try:
|
||||||
|
@ -201,8 +201,8 @@ class optionsDialog(QDialog, Ui_SettingsDialogPythonConsole):
|
|||||||
self.autoCompThresholdEditor.setValue(settings.value("pythonConsole/autoCompThresholdEditor", 2, type=int))
|
self.autoCompThresholdEditor.setValue(settings.value("pythonConsole/autoCompThresholdEditor", 2, type=int))
|
||||||
|
|
||||||
self.enableObjectInspector.setChecked(settings.value("pythonConsole/enableObjectInsp", False, type=bool))
|
self.enableObjectInspector.setChecked(settings.value("pythonConsole/enableObjectInsp", False, type=bool))
|
||||||
self.autoCloseBracketEditor.setChecked(settings.value("pythonConsole/autoCloseBracketEditor", True, type=bool))
|
self.autoCloseBracketEditor.setChecked(settings.value("pythonConsole/autoCloseBracketEditor", False, type=bool))
|
||||||
self.autoCloseBracket.setChecked(settings.value("pythonConsole/autoCloseBracket", True, type=bool))
|
self.autoCloseBracket.setChecked(settings.value("pythonConsole/autoCloseBracket", False, type=bool))
|
||||||
|
|
||||||
if settings.value("pythonConsole/autoCompleteSource") == 'fromDoc':
|
if settings.value("pythonConsole/autoCompleteSource") == 'fromDoc':
|
||||||
self.autoCompFromDoc.setChecked(True)
|
self.autoCompFromDoc.setChecked(True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user