teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
Go to the documentation of this file.
19 virtual const std::string&
at(
int idx)
const = 0;
20 virtual int size()
const = 0;
22 virtual std::string
getFinalStr(
int idx,
const std::string& str)
const = 0;
25 bool match(
const std::string& line,
const std::string& str)
const;
26 bool match(
int idx,
const std::string& str)
const;
41 const std::string&
at(
int idx)
const {
return options[idx]; }
42 std::string
getFinalStr(
int idx,
const std::string& str)
const;
53 void insert(
char c)
override;
54 void insert(
const std::string& str)
override;
56 int drawLine(
int y,
const std::string& line,
Editor& ed,
int lineNum,
57 const Window& win)
override;
58 void load(
const std::string& file,
int line=0)
override {}
59 bool save(
const std::string& fName=
"")
override {
return false; }
60 void clear()
override;
67 std::string
getStr()
const {
return lines[0].get().substr(minLoc); }
86 int linesNeeded(
const std::string& str,
int wid)
const;
void setChoiceIdx(int idx)
Definition: cmd_msg_bar.h:27
int getOptLoc() const
Definition: cmd_msg_bar.h:72
Options & options()
Definition: option.cpp:35
void load(const std::string &file, int line=0) override
Definition: cmd_msg_bar.h:58
Definition: cmd_msg_bar.h:38
void down()
Definition: cmd_msg_bar.cpp:146
int drawLine(int y, const std::string &line, Editor &ed, int lineNum, const Window &win) override
Definition: cmd_msg_bar.cpp:53
CmBarMode()
Definition: cmbar.cpp:13
CmdMsgBar()
Definition: cmd_msg_bar.cpp:33
KeyCmdMap & getKeyCmdMap()
Definition: cmbar.cpp:24
ColorMap & getColorMap()
Definition: cmbar.cpp:25
bool strFind(const std::string &line, const std::string &str)
Definition: utils.cpp:237
void setOptLoc(int loc)
Definition: cmd_msg_bar.h:73
int size() const
Definition: cmd_msg_bar.h:43
void setStartLine(int line)
Definition: cmd_msg_bar.h:76
StringChoices(const Strings &arr, ChoicesFilter cf=strFind)
Definition: cmd_msg_bar.cpp:24
const Pos2di & start() const
Definition: window.h:58
Definition: key_cmd_map.h:19
bool(* ChoicesFilter)(const std::string &, const std::string &)
Definition: cmd_msg_bar.h:10
Definition: cmd_msg_bar.h:50
void clearChoices()
Definition: cmd_msg_bar.cpp:141
T y
Definition: pos2d.h:16
void lineDown() override
Definition: cmd_msg_bar.cpp:176
void resetTraversal()
Definition: key_cmd_map.h:26
Definition: cmd_msg_bar.h:15
Line & at(int idx)
Definition: buffer.h:98
std::vector< std::string > Strings
Definition: utils.h:42
int numLinesNeeded(int wid) const
Definition: line.cpp:49
static bool modeCheck(const std::string &file)
Definition: cmbar.cpp:34
int sendChar(int x, int y, const AttrColor &fg, const AttrColor &bg, char c)
Definition: editor.cpp:295
Strings options
Definition: cmd_msg_bar.h:46
#define DEF_OP()
Definition: command.h:55
void up()
Definition: cmd_msg_bar.cpp:159
virtual void updateMainBuffer(CmdMsgBar &cmBar)
Definition: cmd_msg_bar.h:23
std::vector< Line > lines
Definition: buffer.h:271
virtual int size() const =0
void clear() override
Definition: cmd_msg_bar.cpp:134
void setMinLoc(int loc)
Definition: cmd_msg_bar.h:61
void insert(char c) override
Definition: cmd_msg_bar.cpp:108
bool usingChoices() const
Definition: cmd_msg_bar.h:66
int startLine
Definition: buffer.h:272
int totalLinesNeeded(const Point &dim) const override
Definition: cmd_msg_bar.cpp:93
int getMinStartLoc() const override
Definition: cmd_msg_bar.h:62
void updateChoices()
Definition: cmd_msg_bar.cpp:126
Point cu
Definition: buffer.h:280
Choices(ChoicesFilter cf)
Definition: cmd_msg_bar.h:17
DEF_CMD(Quit, "prompt-quit", "cmbar_ops", DEF_OP() { ed.requestQuitPromptLoop();})
virtual void resetLocations(CmdMsgBar &cmBar)
Definition: cmd_msg_bar.cpp:18
Definition: core/mode.h:27
int indent(Buffer &buf, int line)
Definition: cmbar.cpp:22
virtual bool updateChoices(const std::string &str)
Definition: cmd_msg_bar.h:21
std::string getFinalStr(int idx, const std::string &str) const
Definition: cmd_msg_bar.cpp:28
bool save(const std::string &fName="") override
Definition: cmd_msg_bar.h:59
std::string getFinalChoice() const
Definition: cmd_msg_bar.cpp:82
void lineUp(const Point &dim) override
Definition: cmd_msg_bar.cpp:172
void draw(Editor &ed, const Window &win) override
Definition: cmd_msg_bar.cpp:37
static ModePtr createMode(const std::string &mode)
Helper to create mode object of the named mode.
Definition: core/mode.cpp:48
const std::string & at(int idx) const
Definition: cmd_msg_bar.h:41
ModePtr mode
Definition: buffer.h:278
void setChoices(Choices *ch)
Definition: cmd_msg_bar.h:64
virtual std::string getFinalStr(int idx, const std::string &str) const =0
void lineReset()
Definition: buffer.h:197
void getColorFor(AttrColor &fg, AttrColor &bg, int lineNum, int pos, const Buffer &b, bool isHighlighted)
Definition: cmbar.cpp:26
#define ULTRA_DEBUG(fmt,...)
Definition: logger.h:74
REGISTER_MODE(CmBarMode, "cmbar")
const AttrColor & get(const std::string &name) const
Definition: colors.cpp:67
bool match(const std::string &line, const std::string &str) const
Definition: cmd_msg_bar.cpp:10
int getChoiceIdx() const
Definition: cmd_msg_bar.h:28
static Mode * create()
Definition: cmbar.cpp:32
T x
Definition: pos2d.h:16
virtual const std::string & at(int idx) const =0
std::string getStr() const
Definition: cmd_msg_bar.h:67
const Pos2di & dim() const
Definition: window.h:59
virtual ~Choices()
Definition: cmd_msg_bar.h:18