wex v24.10.0
|
Offers vi mode. More...
#include <wex/vi/mode.h>
Public Types | |
enum class | state_t { COMMAND , INSERT , INSERT_BLOCK , VISUAL , VISUAL_BLOCK , VISUAL_LINE } |
The possible vi mode states. More... | |
Public Member Functions | |
vi_mode (vi *vi, const std::function< void(const std::string &command)> &insert=nullptr, const std::function< void()> &f=nullptr) | |
Constructor,. | |
~vi_mode () | |
Destructor. | |
void | command () |
Transitions to command mode. | |
bool | escape () |
Escapes current mode. | |
state_t | get () const |
Returns the state we are in. | |
bool | is_command () const |
Returns true if in command mode. | |
bool | is_insert () const |
Returns true if in insert mode. | |
bool | is_visual () const |
Returns true if in visual mode. | |
const auto & | insert_commands () const |
Returns insert commands. | |
const std::string | str () const |
Returns mode as a string. | |
bool | transition (std::string &command) |
Transitions to other mode depending on command. | |
void | visual () |
Transitions to visual mode. | |
Offers vi mode.
|
strong |
wex::vi_mode::vi_mode | ( | vi * | vi, |
const std::function< void(const std::string &command)> & | insert = nullptr, | ||
const std::function< void()> & | f = nullptr ) |
Constructor,.
vi | specify vi component |
insert | method to be called when going into insert mode |
f | method to be called when going back to command mode |
bool wex::vi_mode::transition | ( | std::string & | command | ) |
Transitions to other mode depending on command.
Returns true if command represents a mode change, otherwise false. If true is returned, it does not mean that mode was changed, in case of readonly doc.