wex  v21.10.0
Public Member Functions | List of all members
wex::vi Class Reference

Offers a class that extends factory::stc with vi behaviour. More...

#include <wex/vi.h>

Inheritance diagram for wex::vi:
Inheritance graph
[legend]

Public Member Functions

 vi (wex::factory::stc *stc, mode_t mode=VISUAL)
 Constructor.
 
void append_insert_command (const std::string &s)
 Appends string to executed insert command.
 
void append_insert_text (const std::string &s)
 Appends string to insert text.
 
bool command (const std::string &command) final
 Executes vi command. More...
 
const auto & inserted_text () const
 Returns inserted text.
 
const auto & last_command () const
 Returns last entered command.
 
const auto & mode () const
 Returns the mode we are in.
 
auto & mode ()
 Returns writeable mode.
 
const auto & motion_commands () const
 Returns motion commands.
 
bool on_char (const wxKeyEvent &event)
 Handles char events. More...
 
bool on_key_down (const wxKeyEvent &event)
 Handles keydown events. More...
 
const auto & other_commands () const
 Returns other commands.
 
void visual_extend (int start_pos, int end_pos) const
 Extend visual selection.
 
- Public Member Functions inherited from wex::ex
 ex (factory::stc *stc, mode_t mode=VISUAL)
 Constructor. More...
 
virtual ~ex ()
 Destructor.
 
int calculator (const std::string &text)
 Other methods. More...
 
void copy (const ex *ex)
 Copies data from other component.
 
auto & ctags ()
 Returns the ctags.
 
void cut ()
 Cuts selected text to yank register, and updates delete registers.
 
auto ex_stream ()
 The ex stream (used if in ex mode).
 
auto * frame ()
 Returns the frame.
 
const auto & get_command () const
 Returns command.
 
factory::stcget_stc () const
 Returns stc component.
 
auto is_active () const
 Returns whether ex is active.
 
bool marker_add (char marker, int line=-1)
 Adds marker at the specified line. More...
 
bool marker_delete (char marker)
 Deletes specified marker. More...
 
bool marker_goto (char marker)
 Goes to specified marker. More...
 
int marker_line (char marker) const
 Returns line for specified marker. More...
 
void print (const std::string &text)
 Prints text in the dialog.
 
auto register_name () const
 Returns current register name.
 
const std::string register_text () const
 Returns text from current register (or yank register if no register active).
 
void reset_search_flags ()
 Resets search flags.
 
auto search_flags () const
 Returns search flags.
 
void use (mode_t mode)
 Set mode.
 
mode_t visual () const
 Returns current visual mode.
 
bool yank (char name='0') const
 Yanks selected text to yank register, default to yank register. More...
 

Additional Inherited Members

- Public Types inherited from wex::ex
enum  mode_t
 Other methods. More...
 
- Static Public Member Functions inherited from wex::ex
static auto & get_macros ()
 Static interface. More...
 
static const std::string register_insert ()
 Returns text to be inserted.
 
static void set_registers_delete (const std::string &value)
 Sets delete registers 1 - 9.
 
static void set_register_insert (const std::string &value)
 Sets insert register.
 
static void set_register_yank (const std::string &value)
 Sets yank register.
 
- Protected Member Functions inherited from wex::ex
bool auto_write ()
 If autowrite is on and document is modified, save the document.
 
void set_register (char name)
 Sets register name. More...
 

Detailed Description

Offers a class that extends factory::stc with vi behaviour.

Member Function Documentation

◆ command()

bool wex::vi::command ( const std::string &  command)
finalvirtual

Executes vi command.

Returns true if the command was executed.

Reimplemented from wex::ex.

◆ on_char()

bool wex::vi::on_char ( const wxKeyEvent &  event)

Handles char events.

Returns true if event is allowed to be skipped. This means that the char is not handled by vi, e.g. vi mode is not active, or we are in insert mode, so the char should be handled by stc.

◆ on_key_down()

bool wex::vi::on_key_down ( const wxKeyEvent &  event)

Handles keydown events.

See on_char.