Skip to content
Snippets Groups Projects
Commit b6736939 authored by hjk's avatar hjk
Browse files

fakevim: synchronize with master

In theory this should have been a backport of the search-related commits
7e8c345a and 46fa3aa7, but they are buried in the middle of the Big
Commandline Reorganization. Just taking everything has lower risk and
is faster.
parent 878462f7
No related branches found
No related tags found
No related merge requests found
...@@ -209,10 +209,13 @@ FakeVimSettings *theFakeVimSettings() ...@@ -209,10 +209,13 @@ FakeVimSettings *theFakeVimSettings()
item->setSettingsKey(group, _("IsKeyword")); item->setSettingsKey(group, _("IsKeyword"));
instance->insertItem(ConfigIsKeyword, item, _("iskeyword"), _("isk")); instance->insertItem(ConfigIsKeyword, item, _("iskeyword"), _("isk"));
// Invented here.
item = new SavedAction(instance); item = new SavedAction(instance);
item->setText(QCoreApplication::translate("FakeVim::Internal", item->setDefaultValue(false);
"FakeVim properties...")); item->setValue(false);
instance->insertItem(SettingsDialog, item); item->setSettingsKey(group, _("ShowMarks"));
item->setCheckable(true);
instance->insertItem(ConfigShowMarks, item, _("showmarks"), _("sm"));
return instance; return instance;
} }
......
...@@ -64,7 +64,7 @@ enum FakeVimSettingsCode ...@@ -64,7 +64,7 @@ enum FakeVimSettingsCode
ConfigIsKeyword, ConfigIsKeyword,
// other actions // other actions
SettingsDialog, ConfigShowMarks,
}; };
class FakeVimSettings : public QObject class FakeVimSettings : public QObject
......
This diff is collapsed.
...@@ -38,6 +38,38 @@ ...@@ -38,6 +38,38 @@
namespace FakeVim { namespace FakeVim {
namespace Internal { namespace Internal {
enum RangeMode
{
RangeCharMode, // v
RangeLineMode, // V
RangeLineModeExclusive,
RangeBlockMode, // Ctrl-v
RangeBlockAndTailMode, // Ctrl-v for D and X
};
struct Range
{
Range();
Range(int b, int e, RangeMode m = RangeCharMode);
QString toString() const;
int beginPos;
int endPos;
RangeMode rangemode;
};
struct ExCommand
{
ExCommand() : hasBang(false) {}
ExCommand(const QString &cmd, const QString &args = QString(),
const Range &range = Range());
QString cmd;
bool hasBang;
QString args;
Range range;
};
class FakeVimHandler : public QObject class FakeVimHandler : public QObject
{ {
Q_OBJECT Q_OBJECT
...@@ -53,6 +85,8 @@ public: ...@@ -53,6 +85,8 @@ public:
public slots: public slots:
void setCurrentFileName(const QString &fileName); void setCurrentFileName(const QString &fileName);
QString currentFileName() const;
void showBlackMessage(const QString &msg); void showBlackMessage(const QString &msg);
void showRedMessage(const QString &msg); void showRedMessage(const QString &msg);
...@@ -76,8 +110,6 @@ signals: ...@@ -76,8 +110,6 @@ signals:
void statusDataChanged(const QString &msg); void statusDataChanged(const QString &msg);
void extraInformationChanged(const QString &msg); void extraInformationChanged(const QString &msg);
void selectionChanged(const QList<QTextEdit::ExtraSelection> &selection); void selectionChanged(const QList<QTextEdit::ExtraSelection> &selection);
void writeFileRequested(bool *handled,
const QString &fileName, const QString &contents);
void writeAllRequested(QString *error); void writeAllRequested(QString *error);
void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor);
void checkForElectricCharacter(bool *result, QChar c); void checkForElectricCharacter(bool *result, QChar c);
...@@ -86,8 +118,7 @@ signals: ...@@ -86,8 +118,7 @@ signals:
void windowCommandRequested(int key); void windowCommandRequested(int key);
void findRequested(bool reverse); void findRequested(bool reverse);
void findNextRequested(bool reverse); void findNextRequested(bool reverse);
void handleExCommandRequested(const QString &cmd); void handleExCommandRequested(bool *handled, const ExCommand &cmd);
void handleSetCommandRequested(bool *handled, const QString &cmd);
public: public:
class Private; class Private;
...@@ -101,4 +132,7 @@ private: ...@@ -101,4 +132,7 @@ private:
} // namespace Internal } // namespace Internal
} // namespace FakeVim } // namespace FakeVim
Q_DECLARE_METATYPE(FakeVim::Internal::ExCommand);
#endif // FAKEVIM_HANDLER_H #endif // FAKEVIM_HANDLER_H
...@@ -66,6 +66,13 @@ ...@@ -66,6 +66,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2">
<widget class="QCheckBox" name="checkBoxShowMarks">
<property name="text">
<string>Show position of text marks</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSmartTab"> <widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text"> <property name="text">
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment