forked from qt-creator/qt-creator
fakevim: creator auto indent is more like vim's smartindent
Merge-request: 98 Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -167,6 +167,14 @@ FakeVimSettings *theFakeVimSettings()
|
||||
item->setCheckable(true);
|
||||
instance->insertItem(ConfigAutoIndent, item, QLatin1String("autoindent"), QLatin1String("ai"));
|
||||
|
||||
item = new SavedAction(instance);
|
||||
item->setDefaultValue(false);
|
||||
item->setValue(false);
|
||||
item->setSettingsKey(group, QLatin1String("SmartIndent"));
|
||||
item->setValue(false);
|
||||
item->setCheckable(true);
|
||||
instance->insertItem(ConfigSmartIndent, item, QLatin1String("smartindent"), QLatin1String("si"));
|
||||
|
||||
item = new SavedAction(instance);
|
||||
item->setDefaultValue(true);
|
||||
item->setValue(true);
|
||||
|
||||
@@ -49,6 +49,7 @@ enum FakeVimSettingsCode
|
||||
ConfigShiftWidth,
|
||||
ConfigExpandTab,
|
||||
ConfigAutoIndent,
|
||||
ConfigSmartIndent,
|
||||
ConfigIncSearch,
|
||||
|
||||
// indent allow backspacing over autoindent
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelAutoIndent">
|
||||
<property name="toolTip">
|
||||
<string>VIM's "autoindent" option</string>
|
||||
@@ -32,14 +32,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxAutoIndent">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelExpandTab">
|
||||
<property name="toolTip">
|
||||
<string>vim's "expandtab" option</string>
|
||||
@@ -49,80 +49,80 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxExpandTab">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelHlSearch">
|
||||
<property name="text">
|
||||
<string>Highlight search results:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxHlSearch">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="labelIncSearch">
|
||||
<property name="text">
|
||||
<string>Incremental search:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxIncSearch">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="labelShiftWidth">
|
||||
<property name="text">
|
||||
<string>Shift width:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineEditShiftWidth"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="labelSmartTab">
|
||||
<property name="text">
|
||||
<string>Smart tabulators:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxSmartTab">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="labelStartOfLine">
|
||||
<property name="text">
|
||||
<string>Start of line:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxStartOfLine">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="tabulatorLabel">
|
||||
<property name="toolTip">
|
||||
<string>vim's "tabstop" option</string>
|
||||
@@ -132,19 +132,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="lineEditTabStop"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="labelBackspace">
|
||||
<property name="text">
|
||||
<string>Backspace:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="lineEditBackspace"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelSmartIndent">
|
||||
<property name="text">
|
||||
<string>Smart indentation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxSmartIndent"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -162,6 +162,8 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
|
||||
|
||||
m_group.insert(theFakeVimSetting(ConfigAutoIndent),
|
||||
m_ui.checkBoxAutoIndent);
|
||||
m_group.insert(theFakeVimSetting(ConfigSmartIndent),
|
||||
m_ui.checkBoxSmartIndent);
|
||||
m_group.insert(theFakeVimSetting(ConfigIncSearch),
|
||||
m_ui.checkBoxIncSearch);
|
||||
|
||||
@@ -174,6 +176,7 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
|
||||
if (m_searchKeywords.isEmpty()) {
|
||||
QTextStream(&m_searchKeywords)
|
||||
<< ' ' << m_ui.labelAutoIndent->text() << ' ' << m_ui.labelExpandTab->text()
|
||||
<< ' ' << m_ui.labelSmartIndent->text() << ' ' << m_ui.labelExpandTab->text()
|
||||
<< ' ' << m_ui.labelHlSearch->text() << ' ' << m_ui.labelIncSearch->text()
|
||||
<< ' ' << m_ui.labelShiftWidth->text() << ' ' << m_ui.labelSmartTab->text()
|
||||
<< ' ' << m_ui.labelStartOfLine->text() << ' ' << m_ui.tabulatorLabel->text()
|
||||
@@ -192,7 +195,8 @@ void FakeVimOptionPage::copyTextEditorSettings()
|
||||
m_ui.lineEditTabStop->setText(QString::number(ts.m_tabSize));
|
||||
m_ui.lineEditShiftWidth->setText(QString::number(ts.m_indentSize));
|
||||
m_ui.checkBoxSmartTab->setChecked(ts.m_smartBackspace);
|
||||
m_ui.checkBoxAutoIndent->setChecked(ts.m_autoIndent);
|
||||
m_ui.checkBoxAutoIndent->setChecked(true);
|
||||
m_ui.checkBoxSmartIndent->setChecked(ts.m_autoIndent);
|
||||
// FIXME: Not present in core
|
||||
//m_ui.checkBoxIncSearch->setChecked(ts.m_incSearch);
|
||||
}
|
||||
@@ -205,6 +209,7 @@ void FakeVimOptionPage::setQtStyle()
|
||||
m_ui.lineEditShiftWidth->setText(four);
|
||||
m_ui.checkBoxSmartTab->setChecked(true);
|
||||
m_ui.checkBoxAutoIndent->setChecked(true);
|
||||
m_ui.checkBoxSmartIndent->setChecked(true);
|
||||
m_ui.checkBoxIncSearch->setChecked(true);
|
||||
m_ui.lineEditBackspace->setText(QLatin1String("indent,eol,start"));
|
||||
}
|
||||
@@ -217,6 +222,7 @@ void FakeVimOptionPage::setPlainStyle()
|
||||
m_ui.lineEditShiftWidth->setText(eight);
|
||||
m_ui.checkBoxSmartTab->setChecked(false);
|
||||
m_ui.checkBoxAutoIndent->setChecked(false);
|
||||
m_ui.checkBoxSmartIndent->setChecked(false);
|
||||
m_ui.checkBoxIncSearch->setChecked(false);
|
||||
m_ui.lineEditBackspace->setText(QString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user