Commit 0a93ca92 authored by hjk's avatar hjk
Browse files

fakevim: split 'IncSearch' into 'IncSearch' and 'UseCoreDialog'

parent 06130fea
......@@ -112,12 +112,14 @@ FakeVimSettings *theFakeVimSettings()
instance = new FakeVimSettings;
typedef QLatin1String _;
SavedAction *item = 0;
const QString group = QLatin1String("FakeVim");
const QString group = _("FakeVim");
item = new SavedAction(instance);
item->setText(QCoreApplication::translate("FakeVim::Internal", "Use vim-style editing"));
item->setSettingsKey(group, QLatin1String("UseFakeVim"));
item->setText(QCoreApplication::translate("FakeVim::Internal",
"Use vim-style editing"));
item->setSettingsKey(group, _("UseFakeVim"));
item->setCheckable(true);
item->setValue(false);
instance->insertItem(ConfigUseFakeVim, item);
......@@ -125,70 +127,78 @@ FakeVimSettings *theFakeVimSettings()
item = new SavedAction(instance);
item->setValue(true);
item->setDefaultValue(true);
item->setSettingsKey(group, QLatin1String("StartOfLine"));
item->setSettingsKey(group, _("StartOfLine"));
item->setCheckable(true);
instance->insertItem(ConfigStartOfLine, item, QLatin1String("startofline"), QLatin1String("sol"));
instance->insertItem(ConfigStartOfLine, item, _("startofline"), _("sol"));
item = new SavedAction(instance);
item->setDefaultValue(8);
item->setSettingsKey(group, QLatin1String("TabStop"));
instance->insertItem(ConfigTabStop, item, QLatin1String("tabstop"), QLatin1String("ts"));
item->setSettingsKey(group, _("TabStop"));
instance->insertItem(ConfigTabStop, item, _("tabstop"), _("ts"));
item = new SavedAction(instance);
item->setDefaultValue(false);
item->setValue(false);
item->setSettingsKey(group, QLatin1String("SmartTab"));
instance->insertItem(ConfigSmartTab, item, QLatin1String("smarttab"), QLatin1String("sta"));
item->setSettingsKey(group, _("SmartTab"));
instance->insertItem(ConfigSmartTab, item, _("smarttab"), _("sta"));
item = new SavedAction(instance);
item->setDefaultValue(true);
item->setValue(true);
item->setSettingsKey(group, QLatin1String("HlSearch"));
item->setSettingsKey(group, _("HlSearch"));
item->setCheckable(true);
instance->insertItem(ConfigHlSearch, item, QLatin1String("hlsearch"), QLatin1String("hls"));
instance->insertItem(ConfigHlSearch, item, _("hlsearch"), _("hls"));
item = new SavedAction(instance);
item->setDefaultValue(8);
item->setSettingsKey(group, QLatin1String("ShiftWidth"));
instance->insertItem(ConfigShiftWidth, item, QLatin1String("shiftwidth"), QLatin1String("sw"));
item->setSettingsKey(group, _("ShiftWidth"));
instance->insertItem(ConfigShiftWidth, item, _("shiftwidth"), _("sw"));
item = new SavedAction(instance);
item->setDefaultValue(false);
item->setValue(false);
item->setSettingsKey(group, QLatin1String("ExpandTab"));
item->setSettingsKey(group, _("ExpandTab"));
item->setCheckable(true);
instance->insertItem(ConfigExpandTab, item, QLatin1String("expandtab"), QLatin1String("et"));
instance->insertItem(ConfigExpandTab, item, _("expandtab"), _("et"));
item = new SavedAction(instance);
item->setDefaultValue(false);
item->setValue(false);
item->setSettingsKey(group, QLatin1String("AutoIndent"));
item->setSettingsKey(group, _("AutoIndent"));
item->setValue(false);
item->setCheckable(true);
instance->insertItem(ConfigAutoIndent, item, QLatin1String("autoindent"), QLatin1String("ai"));
instance->insertItem(ConfigAutoIndent, item, _("autoindent"), _("ai"));
item = new SavedAction(instance);
item->setDefaultValue(false);
item->setValue(false);
item->setSettingsKey(group, QLatin1String("SmartIndent"));
item->setSettingsKey(group, _("SmartIndent"));
item->setValue(false);
item->setCheckable(true);
instance->insertItem(ConfigSmartIndent, item, QLatin1String("smartindent"), QLatin1String("si"));
instance->insertItem(ConfigSmartIndent, item, _("smartindent"), _("si"));
item = new SavedAction(instance);
item->setDefaultValue(true);
item->setValue(true);
item->setSettingsKey(group, QLatin1String("IncSearch"));
item->setSettingsKey(group, _("IncSearch"));
item->setCheckable(true);
instance->insertItem(ConfigIncSearch, item, QLatin1String("incsearch"), QLatin1String("is"));
instance->insertItem(ConfigIncSearch, item, _("incsearch"), _("is"));
item = new SavedAction(instance);
item->setDefaultValue(QLatin1String("indent,eol,start"));
item->setSettingsKey(group, QLatin1String("Backspace"));
instance->insertItem(ConfigBackspace, item, QLatin1String("backspace"), QLatin1String("bs"));
item->setDefaultValue(false);
item->setValue(false);
item->setSettingsKey(group, _("UseCoreSearch")); item->setCheckable(true);
instance->insertItem(ConfigUseCoreSearch, item,
_("usecoresearch"), _("ucs"));
item = new SavedAction(instance);
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..."));
item->setText(QCoreApplication::translate("FakeVim::Internal",
"FakeVim properties..."));
instance->insertItem(SettingsDialog, item);
return instance;
......
......@@ -51,6 +51,7 @@ enum FakeVimSettingsCode
ConfigAutoIndent,
ConfigSmartIndent,
ConfigIncSearch,
ConfigUseCoreSearch,
// indent allow backspacing over autoindent
// 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;
updateMiniBuffer();
} else if (key == '/' || key == '?') {
if (hasConfig(ConfigIncSearch)) {
if (hasConfig(ConfigUseCoreSearch)) {
// re-use the core dialog.
m_findPending = true;
m_lastSearchForward = (key == '/');
......@@ -1910,8 +1910,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
}
m_tc = EDITOR(textCursor());
m_tc.setPosition(m_tc.selectionStart());
} else
} else {
search(lastSearchString(), m_lastSearchForward);
}
recordJump();
} else if (isVisualMode() && (key == 'o' || key == 'O')) {
int pos = position();
......
......@@ -159,6 +159,20 @@
<item row="0" column="1">
<widget class="QCheckBox" name="checkBoxSmartIndent"/>
</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>
</item>
<item>
......
......@@ -180,6 +180,8 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
m_ui.checkBoxSmartIndent);
m_group.insert(theFakeVimSetting(ConfigIncSearch),
m_ui.checkBoxIncSearch);
m_group.insert(theFakeVimSetting(ConfigUseCoreSearch),
m_ui.checkBoxUseCoreSearch);
connect(m_ui.pushButtonCopyTextEditorSettings, SIGNAL(clicked()),
this, SLOT(copyTextEditorSettings()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment