-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Petr Laštovička
committed
May 11, 2022
1 parent
cae6f0b
commit 090d48d
Showing
15 changed files
with
115 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Semestralni_prace/src/cz/lastaapps/vimxel/vim/errorParser.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "errorParser.hpp" | ||
|
||
using namespace std; | ||
namespace cz::lastaapps::vimxel::vim { | ||
|
||
ErrorParser::ErrorParser(VimState* state) | ||
: mState(state) {} | ||
|
||
Res ErrorParser::handleKey(Mode& outMode) { | ||
int ch = getch(); | ||
if (ch == ERR) return Res::NOPE; | ||
|
||
outMode = mState->mReturnMode; | ||
return Res::UPDATE; | ||
} | ||
pair<string, size_t> ErrorParser::getTextAndPosition() { | ||
return make_pair(mState->mErrorMsg, -1); | ||
} | ||
|
||
} // namespace cz::lastaapps::vimxel::vim |
23 changes: 23 additions & 0 deletions
23
Semestralni_prace/src/cz/lastaapps/vimxel/vim/errorParser.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef H_ERROR_PARSER | ||
#define H_ERROR_PARSER | ||
#include "absParser.hpp" | ||
#include "vimState.hpp" | ||
#include "parserResult.hpp" | ||
#include "../table/coordinate.hpp" | ||
|
||
#include <ncurses.h> | ||
|
||
using namespace std; | ||
namespace cz::lastaapps::vimxel::vim { | ||
using Res = ParserResult; | ||
class ErrorParser final : public AbsParser { | ||
private: | ||
VimState* mState; | ||
public: | ||
ErrorParser(VimState* state); | ||
Res handleKey(Mode & outMode) override; | ||
pair<string, size_t> getTextAndPosition() override; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ enum class Mode { | |
NORMAL, | ||
INSERT, | ||
COMMAND, | ||
ERROR, | ||
}; | ||
string to_string(Mode m); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters