forked from qt-creator/qt-creator
fakevim: split 'IncSearch' into 'IncSearch' and 'UseCoreDialog'
This commit is contained in:
@@ -112,12 +112,14 @@ FakeVimSettings *theFakeVimSettings()
|
|||||||
|
|
||||||
instance = new FakeVimSettings;
|
instance = new FakeVimSettings;
|
||||||
|
|
||||||
|
typedef QLatin1String _;
|
||||||
SavedAction *item = 0;
|
SavedAction *item = 0;
|
||||||
|
|
||||||
const QString group = QLatin1String("FakeVim");
|
const QString group = _("FakeVim");
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QCoreApplication::translate("FakeVim::Internal", "Use vim-style editing"));
|
item->setText(QCoreApplication::translate("FakeVim::Internal",
|
||||||
item->setSettingsKey(group, QLatin1String("UseFakeVim"));
|
"Use vim-style editing"));
|
||||||
|
item->setSettingsKey(group, _("UseFakeVim"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
instance->insertItem(ConfigUseFakeVim, item);
|
instance->insertItem(ConfigUseFakeVim, item);
|
||||||
@@ -125,70 +127,78 @@ FakeVimSettings *theFakeVimSettings()
|
|||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setValue(true);
|
item->setValue(true);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
item->setSettingsKey(group, QLatin1String("StartOfLine"));
|
item->setSettingsKey(group, _("StartOfLine"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigStartOfLine, item, QLatin1String("startofline"), QLatin1String("sol"));
|
instance->insertItem(ConfigStartOfLine, item, _("startofline"), _("sol"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(8);
|
item->setDefaultValue(8);
|
||||||
item->setSettingsKey(group, QLatin1String("TabStop"));
|
item->setSettingsKey(group, _("TabStop"));
|
||||||
instance->insertItem(ConfigTabStop, item, QLatin1String("tabstop"), QLatin1String("ts"));
|
instance->insertItem(ConfigTabStop, item, _("tabstop"), _("ts"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setSettingsKey(group, QLatin1String("SmartTab"));
|
item->setSettingsKey(group, _("SmartTab"));
|
||||||
instance->insertItem(ConfigSmartTab, item, QLatin1String("smarttab"), QLatin1String("sta"));
|
instance->insertItem(ConfigSmartTab, item, _("smarttab"), _("sta"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
item->setValue(true);
|
item->setValue(true);
|
||||||
item->setSettingsKey(group, QLatin1String("HlSearch"));
|
item->setSettingsKey(group, _("HlSearch"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigHlSearch, item, QLatin1String("hlsearch"), QLatin1String("hls"));
|
instance->insertItem(ConfigHlSearch, item, _("hlsearch"), _("hls"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(8);
|
item->setDefaultValue(8);
|
||||||
item->setSettingsKey(group, QLatin1String("ShiftWidth"));
|
item->setSettingsKey(group, _("ShiftWidth"));
|
||||||
instance->insertItem(ConfigShiftWidth, item, QLatin1String("shiftwidth"), QLatin1String("sw"));
|
instance->insertItem(ConfigShiftWidth, item, _("shiftwidth"), _("sw"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setSettingsKey(group, QLatin1String("ExpandTab"));
|
item->setSettingsKey(group, _("ExpandTab"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigExpandTab, item, QLatin1String("expandtab"), QLatin1String("et"));
|
instance->insertItem(ConfigExpandTab, item, _("expandtab"), _("et"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setSettingsKey(group, QLatin1String("AutoIndent"));
|
item->setSettingsKey(group, _("AutoIndent"));
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigAutoIndent, item, QLatin1String("autoindent"), QLatin1String("ai"));
|
instance->insertItem(ConfigAutoIndent, item, _("autoindent"), _("ai"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setSettingsKey(group, QLatin1String("SmartIndent"));
|
item->setSettingsKey(group, _("SmartIndent"));
|
||||||
item->setValue(false);
|
item->setValue(false);
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigSmartIndent, item, QLatin1String("smartindent"), QLatin1String("si"));
|
instance->insertItem(ConfigSmartIndent, item, _("smartindent"), _("si"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
item->setValue(true);
|
item->setValue(true);
|
||||||
item->setSettingsKey(group, QLatin1String("IncSearch"));
|
item->setSettingsKey(group, _("IncSearch"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ConfigIncSearch, item, QLatin1String("incsearch"), QLatin1String("is"));
|
instance->insertItem(ConfigIncSearch, item, _("incsearch"), _("is"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setDefaultValue(QLatin1String("indent,eol,start"));
|
item->setDefaultValue(false);
|
||||||
item->setSettingsKey(group, QLatin1String("Backspace"));
|
item->setValue(false);
|
||||||
instance->insertItem(ConfigBackspace, item, QLatin1String("backspace"), QLatin1String("bs"));
|
item->setSettingsKey(group, _("UseCoreSearch")); item->setCheckable(true);
|
||||||
|
instance->insertItem(ConfigUseCoreSearch, item,
|
||||||
|
_("usecoresearch"), _("ucs"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QCoreApplication::translate("FakeVim::Internal", "FakeVim properties..."));
|
item->setDefaultValue(_("indent,eol,start"));
|
||||||
|
item->setSettingsKey(group, _("Backspace"));
|
||||||
|
instance->insertItem(ConfigBackspace, item, _("backspace"), _("bs"));
|
||||||
|
|
||||||
|
item = new SavedAction(instance);
|
||||||
|
item->setText(QCoreApplication::translate("FakeVim::Internal",
|
||||||
|
"FakeVim properties..."));
|
||||||
instance->insertItem(SettingsDialog, item);
|
instance->insertItem(SettingsDialog, item);
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ enum FakeVimSettingsCode
|
|||||||
ConfigAutoIndent,
|
ConfigAutoIndent,
|
||||||
ConfigSmartIndent,
|
ConfigSmartIndent,
|
||||||
ConfigIncSearch,
|
ConfigIncSearch,
|
||||||
|
ConfigUseCoreSearch,
|
||||||
|
|
||||||
// indent allow backspacing over autoindent
|
// indent allow backspacing over autoindent
|
||||||
// eol allow backspacing over line breaks (join lines)
|
// eol allow backspacing over line breaks (join lines)
|
||||||
|
|||||||
@@ -1534,7 +1534,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
|
|||||||
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
||||||
updateMiniBuffer();
|
updateMiniBuffer();
|
||||||
} else if (key == '/' || key == '?') {
|
} else if (key == '/' || key == '?') {
|
||||||
if (hasConfig(ConfigIncSearch)) {
|
if (hasConfig(ConfigUseCoreSearch)) {
|
||||||
// re-use the core dialog.
|
// re-use the core dialog.
|
||||||
m_findPending = true;
|
m_findPending = true;
|
||||||
m_lastSearchForward = (key == '/');
|
m_lastSearchForward = (key == '/');
|
||||||
@@ -1910,8 +1910,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
|
|||||||
}
|
}
|
||||||
m_tc = EDITOR(textCursor());
|
m_tc = EDITOR(textCursor());
|
||||||
m_tc.setPosition(m_tc.selectionStart());
|
m_tc.setPosition(m_tc.selectionStart());
|
||||||
} else
|
} else {
|
||||||
search(lastSearchString(), m_lastSearchForward);
|
search(lastSearchString(), m_lastSearchForward);
|
||||||
|
}
|
||||||
recordJump();
|
recordJump();
|
||||||
} else if (isVisualMode() && (key == 'o' || key == 'O')) {
|
} else if (isVisualMode() && (key == 'o' || key == 'O')) {
|
||||||
int pos = position();
|
int pos = position();
|
||||||
|
|||||||
@@ -159,6 +159,20 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QCheckBox" name="checkBoxSmartIndent"/>
|
<widget class="QCheckBox" name="checkBoxSmartIndent"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="labelUseCoreSearch">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use search dialog:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QCheckBox" name="checkBoxUseCoreSearch">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
|
|||||||
m_ui.checkBoxSmartIndent);
|
m_ui.checkBoxSmartIndent);
|
||||||
m_group.insert(theFakeVimSetting(ConfigIncSearch),
|
m_group.insert(theFakeVimSetting(ConfigIncSearch),
|
||||||
m_ui.checkBoxIncSearch);
|
m_ui.checkBoxIncSearch);
|
||||||
|
m_group.insert(theFakeVimSetting(ConfigUseCoreSearch),
|
||||||
|
m_ui.checkBoxUseCoreSearch);
|
||||||
|
|
||||||
connect(m_ui.pushButtonCopyTextEditorSettings, SIGNAL(clicked()),
|
connect(m_ui.pushButtonCopyTextEditorSettings, SIGNAL(clicked()),
|
||||||
this, SLOT(copyTextEditorSettings()));
|
this, SLOT(copyTextEditorSettings()));
|
||||||
|
|||||||
Reference in New Issue
Block a user