wex v24.10.0
|
Offers a class that adds ex editor to wex::syntax::stc. More...
#include <wex/ex/ex.h>
Public Types | |
enum class | mode_t { OFF , EX , VISUAL } |
The visual modes. More... | |
Public Member Functions | |
ex (syntax::stc *stc, mode_t mode=mode_t::VISUAL) | |
Constructor. | |
virtual | ~ex () |
Destructor. | |
virtual bool | command (const std::string &command) |
Executes ex: command that was entered on the command line, or present as modeline command inside a file. | |
std::optional< 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 | ex_stream () |
The ex stream (used if in ex mode). | |
auto * | frame () |
Returns the frame. | |
const auto & | get_command () const |
Returns command. | |
const auto & | get_print_text () const |
Returns last printed text. | |
syntax::stc * | get_stc () const |
Returns stc component. | |
void | info_message (const std::string &text, info_message_t type) const |
Shows info message. | |
auto | is_active () const |
Returns whether ex is active. | |
bool | is_address (const std::string &text) |
Returns whether text specifies an address. | |
const auto & | line_data () const |
Returns line data. | |
bool | marker_add (char marker, int line=-1) |
Adds marker at the specified line. | |
bool | marker_delete (char marker) |
Deletes specified marker. | |
bool | marker_goto (char marker) |
Goes to specified marker. | |
int | marker_line (char marker) const |
Returns line for specified marker. | |
bool | print (const addressrange &ar, const std::string &flags=std::string(), bool separator=false) |
Prints address range. | |
void | print (const std::string &text) |
Prints text in the dialog. | |
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, to what is available in config. | |
auto | search_flags () const |
Returns search flags. | |
void | search_whole_word () |
Sets the whole word flag in search flags. | |
void | set_line_data (const wex::line_data &data) |
Sets data. | |
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. | |
Protected Member Functions | |
bool | auto_write () |
If autowrite is on and document is modified, save the document. | |
auto | register_name () const |
Returns current register name. | |
void | set_register (char name) |
Sets register name. | |
Offers a class that adds ex editor to wex::syntax::stc.
|
strong |
|
explicit |
Constructor.
Provide stc cpomponent and ex mode.
|
virtual |
Executes ex: command that was entered on the command line, or present as modeline command inside a file.
Returns true if the command was executed.
Reimplemented in wex::vi.
bool wex::ex::marker_add | ( | char | marker, |
int | line = -1 ) |
Adds marker at the specified line.
Returns true if marker could be added.
marker | marker |
line | line to add marker, default current line |
bool wex::ex::marker_delete | ( | char | marker | ) |
Deletes specified marker.
Returns true if marker was deleted.
bool wex::ex::marker_goto | ( | char | marker | ) |
Goes to specified marker.
Returns true if marker exists.
int wex::ex::marker_line | ( | char | marker | ) | const |
Returns line for specified marker.
Returns LINE_NUMBER_UNKNOWN if marker does not exist.
|
inlineprotected |
Sets register name.
Setting register 0 results in disabling current register.
bool wex::ex::yank | ( | char | name = '0' | ) | const |
Yanks selected text to yank register, default to yank register.
Returns false if no text was selected.