From 0153931534bea60a529470a6b96f80f46ffb4af7 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 9 Sep 2021 16:15:11 +0200
Subject: [PATCH] MISC: Place the FakeVim thing in the Vivy namespace

---
 src/UI/FakeVim/FakeVimActions.cc  |  4 ++--
 src/UI/FakeVim/FakeVimActions.hh  |  4 ++--
 src/UI/FakeVim/FakeVimHandler.cc  |  6 +++---
 src/UI/FakeVim/FakeVimHandler.hh  | 12 +++++++++---
 src/UI/FakeVim/FakeVimTr.hh       |  4 ++--
 src/UI/ScriptDocumentView.hh      |  2 --
 src/UI/ScriptViews/EditorProxy.cc |  3 +--
 src/UI/ScriptViews/EditorProxy.hh | 10 ++--------
 8 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/src/UI/FakeVim/FakeVimActions.cc b/src/UI/FakeVim/FakeVimActions.cc
index 7042af07..045fd3a2 100644
--- a/src/UI/FakeVim/FakeVimActions.cc
+++ b/src/UI/FakeVim/FakeVimActions.cc
@@ -3,7 +3,7 @@
 
 #include "../../Lib/Utils.hh"
 
-namespace FakeVim::Internal
+namespace Vivy
 {
 #ifdef FAKEVIM_STANDALONE
 FvBaseAspect::FvBaseAspect() {}
@@ -181,4 +181,4 @@ fakeVimSettings()
     return &s;
 }
 
-} // namespace FakeVim::Internal
+}
diff --git a/src/UI/FakeVim/FakeVimActions.hh b/src/UI/FakeVim/FakeVimActions.hh
index 13895c39..69a9a01e 100644
--- a/src/UI/FakeVim/FakeVimActions.hh
+++ b/src/UI/FakeVim/FakeVimActions.hh
@@ -2,7 +2,7 @@
 
 #define FAKEVIM_STANDALONE
 
-namespace FakeVim::Internal
+namespace Vivy
 {
 class FvBaseAspect {
 public:
@@ -118,4 +118,4 @@ private:
 };
 
 FakeVimSettings *fakeVimSettings();
-} // namespace FakeVim::Internal
+}
diff --git a/src/UI/FakeVim/FakeVimHandler.cc b/src/UI/FakeVim/FakeVimHandler.cc
index c1f327d9..bac3cf83 100644
--- a/src/UI/FakeVim/FakeVimHandler.cc
+++ b/src/UI/FakeVim/FakeVimHandler.cc
@@ -47,7 +47,7 @@
 #define UNDO_DEBUG(s)
 #endif
 
-namespace FakeVim::Internal
+namespace Vivy
 {
 ///////////////////////////////////////////////////////////////////////
 //
@@ -9730,6 +9730,6 @@ FakeVimHandler::jumpToLocalMark(QChar mark, bool backTickMode)
     return d->jumpToMark(mark, backTickMode);
 }
 
-} // namespace FakeVim::Internal
+}
 
-Q_DECLARE_METATYPE(FakeVim::Internal::FakeVimHandler::Private::BufferDataPtr)
+Q_DECLARE_METATYPE(Vivy::FakeVimHandler::Private::BufferDataPtr)
diff --git a/src/UI/FakeVim/FakeVimHandler.hh b/src/UI/FakeVim/FakeVimHandler.hh
index a84a97ee..2839fbc7 100644
--- a/src/UI/FakeVim/FakeVimHandler.hh
+++ b/src/UI/FakeVim/FakeVimHandler.hh
@@ -1,8 +1,12 @@
 #pragma once
 
+// #include "../../VivyApplication.hh"
+// #include "../../Lib/Log.hh"
+// #include "../../Lib/Utils.hh"
+
 #define FAKEVIM_STANDALONE
 
-namespace FakeVim::Internal
+namespace Vivy
 {
 enum RangeMode {
     // Reordering first three enum items here will break
@@ -76,6 +80,8 @@ private:
 
 class FakeVimHandler : public QObject {
     Q_OBJECT
+    // VIVY_UNMOVABLE_OBJECT(FakeVimHandler)
+    // VIVY_APP_LOGGABLE_OBJECT(FakeVimHandler, logger)
 
 public:
     explicit FakeVimHandler(QWidget *widget, QObject *parent = nullptr);
@@ -160,6 +166,6 @@ private:
     Private *d;
 };
 
-} // namespace FakeVim::Internal
+}
 
-Q_DECLARE_METATYPE(FakeVim::Internal::ExCommand)
+Q_DECLARE_METATYPE(Vivy::ExCommand)
diff --git a/src/UI/FakeVim/FakeVimTr.hh b/src/UI/FakeVim/FakeVimTr.hh
index d2cf884b..4f2b78e9 100644
--- a/src/UI/FakeVim/FakeVimTr.hh
+++ b/src/UI/FakeVim/FakeVimTr.hh
@@ -1,9 +1,9 @@
 #pragma once
 
-namespace FakeVim
+namespace Vivy
 {
 struct Tr {
     Q_DECLARE_TR_FUNCTIONS(FakeVim)
 };
 
-} // namespace FakeVim
+}
diff --git a/src/UI/ScriptDocumentView.hh b/src/UI/ScriptDocumentView.hh
index 26c240cd..0f790735 100644
--- a/src/UI/ScriptDocumentView.hh
+++ b/src/UI/ScriptDocumentView.hh
@@ -22,8 +22,6 @@ class ScriptDocumentView final : public AbstractDocumentView {
     VIVY_UNMOVABLE_OBJECT(ScriptDocumentView)
     VIVY_APP_LOGGABLE_OBJECT(ScriptDocumentView, logger)
 
-    using FakeVimHandler = FakeVim::Internal::FakeVimHandler;
-
 public:
     explicit ScriptDocumentView(std::shared_ptr<ScriptDocument>, QWidget *parent = nullptr);
     ~ScriptDocumentView() override;
diff --git a/src/UI/ScriptViews/EditorProxy.cc b/src/UI/ScriptViews/EditorProxy.cc
index 6cf6616d..f262c96e 100644
--- a/src/UI/ScriptViews/EditorProxy.cc
+++ b/src/UI/ScriptViews/EditorProxy.cc
@@ -237,8 +237,7 @@ EditorProxy::indentRegion(int beginBlock, int endBlock, QChar typedChar) noexcep
     QTextDocument *doc = widget->document();
     Q_ASSERT(doc);
 
-    const int indentSize =
-        static_cast<int>(FakeVim::Internal::fakeVimSettings()->shiftWidth.value());
+    const int indentSize  = static_cast<int>(fakeVimSettings()->shiftWidth.value());
     QTextBlock startBlock = doc->findBlockByNumber(beginBlock);
 
     // Record line lenghts for mark adjustments
diff --git a/src/UI/ScriptViews/EditorProxy.hh b/src/UI/ScriptViews/EditorProxy.hh
index 2abd8866..2db6da9e 100644
--- a/src/UI/ScriptViews/EditorProxy.hh
+++ b/src/UI/ScriptViews/EditorProxy.hh
@@ -4,15 +4,11 @@
 #include "../../Lib/Log.hh"
 #include "ScriptEditor.hh"
 
-namespace FakeVim::Internal
-{
-class FakeVimHandler;
-struct ExCommand;
-}
-
 namespace Vivy
 {
 class EditorProxy;
+class FakeVimHandler;
+struct ExCommand;
 
 class EditorProxy final : public QObject {
     Q_OBJECT
@@ -20,8 +16,6 @@ class EditorProxy final : public QObject {
     VIVY_APP_LOGGABLE_OBJECT(EditorProxy, logger)
 
     explicit EditorProxy(QPlainTextEdit *widget) noexcept;
-    using FakeVimHandler = FakeVim::Internal::FakeVimHandler;
-    using ExCommand      = FakeVim::Internal::ExCommand;
 
 public:
     ~EditorProxy() override;
-- 
GitLab