mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Check for capability before attempting to reformat
This commit is contained in:
parent
8556136869
commit
b2c97ad175
@ -215,7 +215,8 @@ void QgsCodeEditor::keyPressEvent( QKeyEvent *event )
|
||||
const bool altModifier = event->modifiers() & Qt::AltModifier;
|
||||
|
||||
// Ctrl+Alt+F: reformat code
|
||||
if ( ctrlModifier && altModifier && event->key() == Qt::Key_F )
|
||||
const bool canReformat = languageCapabilities() & Qgis::ScriptLanguageCapability::Reformat;
|
||||
if ( canReformat && ctrlModifier && altModifier && event->key() == Qt::Key_F )
|
||||
{
|
||||
event->accept();
|
||||
reformatCode();
|
||||
|
Loading…
x
Reference in New Issue
Block a user