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

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

#include <wex/vi.h>

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

Public Member Functions

 vi (wex::stc *stc)
 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 (stc *stc)
 Constructor. More...
 
virtual ~ex ()
 Destructor.
 
int calculator (const std::string &text)
 Returns calculated value of text.
 
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 * frame ()
 Returns the frame.
 
const auto & get_command () const
 Returns command.
 
auto * get_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.
 
const std::string register_insert () const
 Returns text to be inserted.
 
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 set_registers_delete (const std::string &value) const
 Sets delete registers 1 - 9 (if value not empty).
 
void set_register_insert (const std::string &value) const
 Sets insert register (if value not empty).
 
void set_register_yank (const std::string &value) const
 Sets yank register (if value not empty).
 
void use (bool mode)
 Set using ex mode.
 
bool yank (char name='0') const
 Yanks selected text to yank register, default to yank register. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from wex::ex
static void on_init ()
 Initializes static data.
 
static auto & get_macros ()
 Returns the macros.
 
- 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 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.