kakoune

Fork of kakoune, an acceptable text editor
git clone git://git.laack.co/kakoune.git
Log | Files | Refs

normal.hh (1002B)


      1 #ifndef normal_hh_INCLUDED
      2 #define normal_hh_INCLUDED
      3 
      4 #include "optional.hh"
      5 #include "keys.hh"
      6 #include "string.hh"
      7 #include "exception.hh"
      8 
      9 namespace Kakoune
     10 {
     11 
     12 class Buffer;
     13 class Context;
     14 enum class KeymapMode : char;
     15 
     16 struct no_selections_remaining : runtime_error
     17 {
     18     no_selections_remaining() : runtime_error("no selections remaining") {}
     19 };
     20 
     21 struct NormalParams
     22 {
     23     int count;
     24     char reg;
     25 };
     26 
     27 struct NormalCmd
     28 {
     29     StringView docstring = {};
     30     void (*func)(Context& context, NormalParams params) = nullptr;
     31 };
     32 
     33 Optional<NormalCmd> get_normal_command(Key key);
     34 
     35 struct KeyInfo
     36 {
     37     ConstArrayView<Key> keys;
     38     StringView docstring;
     39 };
     40 
     41 String build_autoinfo_for_mapping(const Context& context, KeymapMode mode,
     42                                   ConstArrayView<KeyInfo> built_ins);
     43 
     44 enum class PasteMode
     45 {
     46     Append,
     47     Insert,
     48     Replace
     49 };
     50 
     51 BufferCoord paste_pos(Buffer& buffer, BufferCoord min, BufferCoord max, PasteMode mode, bool linewise);
     52 
     53 }
     54 
     55 #endif // normal_hh_INCLUDED