forked from qt-creator/qt-creator
FakeVim: Assume UTF-8 for source also on Windows by default
... but make it configurable. Fixes: QTCREATORBUG-29320 Change-Id: Ib377c78e51afb7d06167c66306250a281aa9279c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -94,6 +94,7 @@ FakeVimSettings::FakeVimSettings()
|
||||
setup(&showCmd, true, "ShowCmd", "sc", Tr::tr("Show partial command"));
|
||||
setup(&relativeNumber, false, "RelativeNumber", "rnu", Tr::tr("Show line numbers relative to cursor"));
|
||||
setup(&blinkingCursor, false, "BlinkingCursor", "bc", Tr::tr("Blinking cursor"));
|
||||
setup(&systemEncoding, false, "SystemEncoding", {}, Tr::tr("Use system encoding for :source"));
|
||||
setup(&scrollOff, 0, "ScrollOff", "so", Tr::tr("Scroll offset:"));
|
||||
setup(&backspace, "indent,eol,start",
|
||||
"Backspace", "bs", Tr::tr("Backspace:"));
|
||||
@@ -149,7 +150,8 @@ FakeVimSettings::FakeVimSettings()
|
||||
showCmd,
|
||||
startOfLine,
|
||||
passKeys,
|
||||
blinkingCursor
|
||||
blinkingCursor,
|
||||
HostOsInfo::isWindowsHost() ? LayoutItem(systemEncoding) : empty
|
||||
},
|
||||
Column {
|
||||
incSearch,
|
||||
|
@@ -151,6 +151,7 @@ public:
|
||||
FvBoolAspect emulateSurround;
|
||||
|
||||
FvBoolAspect blinkingCursor;
|
||||
FvBoolAspect systemEncoding;
|
||||
|
||||
private:
|
||||
void setup(FvBaseAspect *aspect, const QVariant &value,
|
||||
|
@@ -6625,7 +6625,8 @@ bool FakeVimHandler::Private::handleExSourceCommand(const ExCommand &cmd)
|
||||
} else if (!line.isEmpty() && !inFunction) {
|
||||
//qDebug() << "EXECUTING: " << line;
|
||||
ExCommand cmd;
|
||||
QString commandLine = QString::fromLocal8Bit(line);
|
||||
QString commandLine = s.systemEncoding() ? QString::fromLocal8Bit(line)
|
||||
: QString::fromUtf8(line);
|
||||
while (parseExCommand(&commandLine, &cmd)) {
|
||||
if (!handleExCommandHelper(cmd))
|
||||
break;
|
||||
|
Reference in New Issue
Block a user