Commit 1bea9b98 authored by hluk's avatar hluk Committed by hjk

FakeVim: Option 'passcharacters' (not in Vim)

Option to pass some key presses in insert mode to editor widget
(replaces 'passnewline'). This allows to rename symbols in insert mode,
complete parenthesis blocks, expand comments etc.

Macro expansion and code-completion works with dot command.

Task-number:QTCREATORBUG-4828
Change-Id: I5ff43818d4f7f183cd6f4ed8cc3a4586469ab65d
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 90c5f424
......@@ -274,6 +274,7 @@ void FakeVimPlugin::setup(TestData *data)
{
setupTest(&data->title, &data->handler, &data->edit);
data->reset();
data->doCommand("set nopasskeys | set nopasscontrolkey");
}
......
......@@ -180,7 +180,7 @@ FakeVimSettings *theFakeVimSettings()
#endif
createAction(s, ConfigShowMarks, false, _("ShowMarks"), _("sm"));
createAction(s, ConfigPassControlKey, false, _("PassControlKey"), _("pck"));
createAction(s, ConfigPassNewLine, false, _("PassNewLine"), _("pnl"));
createAction(s, ConfigPassKeys, true, _("PassKeys"), _("pk"));
// Emulated Vim setting
createAction(s, ConfigStartOfLine, true, _("StartOfLine"), _("sol"));
......
......@@ -93,7 +93,7 @@ enum FakeVimSettingsCode
// other actions
ConfigShowMarks,
ConfigPassControlKey,
ConfigPassNewLine,
ConfigPassKeys,
ConfigClipboard,
ConfigShowCmd,
ConfigScrollOff
......
This diff is collapsed.
......@@ -2,6 +2,14 @@
<ui version="4.0">
<class>FakeVim::Internal::FakeVimOptionPage</class>
<widget class="QWidget" name="FakeVim::Internal::FakeVimOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>580</width>
<height>479</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBoxUseFakeVim">
......@@ -113,12 +121,12 @@
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="checkBoxPassNewLine">
<widget class="QCheckBox" name="checkBoxPassKeys">
<property name="toolTip">
<string>Let Qt Creator handle new lines so that comments or code blocks can be properly completed and expanded.</string>
<string>Let Qt Creator handle some key presses in insert mode so that code can be properly completed and expanded.</string>
</property>
<property name="text">
<string>Pass new line</string>
<string>Pass keys in insert mode</string>
</property>
</widget>
</item>
......@@ -363,7 +371,7 @@
<tabstop>checkBoxHlSearch</tabstop>
<tabstop>checkBoxShowCmd</tabstop>
<tabstop>checkBoxStartOfLine</tabstop>
<tabstop>checkBoxPassNewLine</tabstop>
<tabstop>checkBoxPassKeys</tabstop>
<tabstop>checkBoxIncSearch</tabstop>
<tabstop>checkBoxUseCoreSearch</tabstop>
<tabstop>checkBoxIgnoreCase</tabstop>
......
......@@ -292,8 +292,8 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
m_ui.checkBoxSmartTab);
m_group.insert(theFakeVimSetting(ConfigStartOfLine),
m_ui.checkBoxStartOfLine);
m_group.insert(theFakeVimSetting(ConfigPassNewLine),
m_ui.checkBoxPassNewLine);
m_group.insert(theFakeVimSetting(ConfigPassKeys),
m_ui.checkBoxPassKeys);
m_group.insert(theFakeVimSetting(ConfigTabStop),
m_ui.spinBoxTabStop);
m_group.insert(theFakeVimSetting(ConfigScrollOff),
......@@ -352,7 +352,7 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
<< sep << m_ui.checkBoxSmartCase->text()
<< sep << m_ui.checkBoxShowMarks->text()
<< sep << m_ui.checkBoxPassControlKey->text()
<< sep << m_ui.checkBoxPassNewLine->text()
<< sep << m_ui.checkBoxPassKeys->text()
<< sep << m_ui.checkBoxIgnoreCase->text()
<< sep << m_ui.checkBoxWrapScan->text()
<< sep << m_ui.checkBoxShowCmd->text()
......@@ -391,7 +391,7 @@ void FakeVimOptionPage::setQtStyle()
m_ui.checkBoxSmartIndent->setChecked(true);
m_ui.checkBoxIncSearch->setChecked(true);
m_ui.lineEditBackspace->setText(_("indent,eol,start"));
m_ui.checkBoxPassNewLine->setChecked(true);
m_ui.checkBoxPassKeys->setChecked(true);
}
void FakeVimOptionPage::setPlainStyle()
......@@ -404,7 +404,7 @@ void FakeVimOptionPage::setPlainStyle()
m_ui.checkBoxSmartIndent->setChecked(false);
m_ui.checkBoxIncSearch->setChecked(false);
m_ui.lineEditBackspace->setText(QString());
m_ui.checkBoxPassNewLine->setChecked(false);
m_ui.checkBoxPassKeys->setChecked(false);
}
void FakeVimOptionPage::openVimRc()
......
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