teditor  1.8.0@@fee5e94
Terminal based editor written in C++
text.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "readonly.h"
4 #include "core/key_cmd_map.h"
5 #include "core/colors.h"
6 
7 namespace teditor {
8 namespace text {
9 
12 public:
13  TextMode(const std::string& n="text",
14  const std::string& w="abcdefghijklmnopqrstuvwxyzABCDEGGHIJKLMNOPQRS"
15  "TUVWXYZ0123456789_");
16  int indent(Buffer& buf, int line);
17 
18  static Mode* create() { return new TextMode; }
19  static bool modeCheck(const std::string& file);
20 
21 private:
22  struct Keys { static std::vector<KeyCmdPair> All; };
23  struct Colors { static std::vector<NameColorPair> All; };
24 };
25 
26 }; // end namespace text
27 }; // end namespace teditor
teditor::Line::indentSize
int indentSize() const
Definition: line.cpp:68
teditor::text::TextMode::TextMode
TextMode(const std::string &n="text", const std::string &w="abcdefghijklmnopqrstuvwxyzABCDEGGHIJKLMNOPQRS" "TUVWXYZ0123456789_")
Definition: text.cpp:10
teditor::text::REGISTER_MODE
REGISTER_MODE(TextMode, "text")
teditor::text::TextMode::indent
int indent(Buffer &buf, int line)
Definition: text.cpp:16
key_cmd_map.h
teditor::Buffer::length
int length() const
Definition: buffer.h:92
nfa.h
teditor::text::TextMode::modeCheck
static bool modeCheck(const std::string &file)
Definition: text.cpp:25
teditor::Buffer::at
Line & at(int idx)
Definition: buffer.h:98
teditor::parser::NFA
Ken-Thompson NFA as described here: https://swtch.com/~rsc/regexp/regexp1.html but adjusted to work w...
Definition: nfa.h:23
teditor::parser::NFA::NoMatch
static const size_t NoMatch
Definition: nfa.h:93
text.h
teditor::text::TextMode
Definition: text.h:11
buffer.h
teditor::readonly::ReadOnlyMode::getKeyCmdMap
KeyCmdMap & getKeyCmdMap()
Definition: readonly.h:17
teditor::Mode
Definition: core/mode.h:27
colors.h
teditor::text::TextMode::create
static Mode * create()
Definition: text.h:18
teditor::parser::NFA::find
size_t find(const std::string &str, size_t start=0, size_t end=0)
String match function.
Definition: nfa.cpp:64
readonly.h
teditor::Buffer
Definition: buffer.h:25
teditor
Definition: any.hpp:10
teditor::readonly::ReadOnlyMode::getColorMap
ColorMap & getColorMap()
Definition: readonly.h:18
teditor::readonly::ReadOnlyMode
Definition: readonly.h:11