teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Functions
teditor::cursor::ops Namespace Reference

Functions

 DEF_CMD (CursorDown, "cursor-down", "cursor_ops", DEF_OP() { ed.getBuff().down();})
 
 DEF_CMD (CursorUp, "cursor-up", "cursor_ops", DEF_OP() { ed.getBuff().up();})
 
 DEF_CMD (CursorRight, "cursor-right", "cursor_ops", DEF_OP() { ed.getBuff().right();})
 
 DEF_CMD (CursorLeft, "cursor-left", "cursor_ops", DEF_OP() { ed.getBuff().left();})
 
 DEF_CMD (CursorReset, "cursor-reset", "cursor_ops", DEF_OP() { ed.getBuff().begin();})
 
 DEF_CMD (CursorEnd, "cursor-end", "cursor_ops", DEF_OP() { auto &buf=ed.getBuff();const auto &w=ed.getWindow();buf.end();buf.lineEnd(w.start(), w.dim());})
 
 DEF_CMD (CursorHome, "cursor-home", "cursor_ops", DEF_OP() { ed.getBuff().startOfLine();})
 
 DEF_CMD (CursorLineEnd, "cursor-line-end", "cursor_ops", DEF_OP() { ed.getBuff().endOfLine();})
 
 DEF_CMD (PageDown, "page-down", "cursor_ops", DEF_OP() { auto jump=Option::get("pageScrollJump").getReal();auto &buf=ed.getBuff();buf.pageDown(int(jump *ed.getWindow().dim().y));})
 
 DEF_CMD (PageUp, "page-up", "cursor_ops", DEF_OP() { auto jump=Option::get("pageScrollJump").getReal();auto &buf=ed.getBuff();buf.pageUp(int(jump *ed.getWindow().dim().y));})
 
 DEF_CMD (NextPara, "next-para", "cursor_ops", DEF_OP() { ed.getBuff().nextPara();})
 
 DEF_CMD (PreviousPara, "previous-para", "cursor_ops", DEF_OP() { ed.getBuff().previousPara();})
 
 DEF_CMD (NextWord, "next-word", "cursor_ops", DEF_OP() { ed.getBuff().nextWord();})
 
 DEF_CMD (PreviousWord, "previous-word", "cursor_ops", DEF_OP() { ed.getBuff().previousWord();})
 
 DEF_CMD (MatchParen, "match-paren", "cursor_ops", DEF_OP() { auto &buff=ed.getBuff();auto &win=ed.getWindow();bool isOpen=buff.matchCurrentParen();isOpen? buff.lineUp(win.dim()) :buff.lineDown();})
 
 DEF_CMD (GotoLine, "goto-line", "cursor_ops", DEF_OP() { auto line=ed.prompt("Goto: ");int lineNum=str2num(line);ed.getBuff().gotoLine(lineNum, ed.getWindow().dim());})
 

Function Documentation

◆ DEF_CMD() [1/16]

teditor::cursor::ops::DEF_CMD ( CursorDown  ,
"cursor-down"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().down();}   
)

◆ DEF_CMD() [2/16]

teditor::cursor::ops::DEF_CMD ( CursorEnd  ,
"cursor-end"  ,
"cursor_ops"  ,
DEF_OP() { auto &buf=ed.getBuff();const auto &w=ed.getWindow();buf.end();buf.lineEnd(w.start(), w.dim());}   
)

◆ DEF_CMD() [3/16]

teditor::cursor::ops::DEF_CMD ( CursorHome  ,
"cursor-home"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().startOfLine();}   
)

◆ DEF_CMD() [4/16]

teditor::cursor::ops::DEF_CMD ( CursorLeft  ,
"cursor-left"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().left();}   
)

◆ DEF_CMD() [5/16]

teditor::cursor::ops::DEF_CMD ( CursorLineEnd  ,
"cursor-line-end"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().endOfLine();}   
)

◆ DEF_CMD() [6/16]

teditor::cursor::ops::DEF_CMD ( CursorReset  ,
"cursor-reset"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().begin();}   
)

◆ DEF_CMD() [7/16]

teditor::cursor::ops::DEF_CMD ( CursorRight  ,
"cursor-right"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().right();}   
)

◆ DEF_CMD() [8/16]

teditor::cursor::ops::DEF_CMD ( CursorUp  ,
"cursor-up"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().up();}   
)

◆ DEF_CMD() [9/16]

teditor::cursor::ops::DEF_CMD ( GotoLine  ,
"goto-line"  ,
"cursor_ops"  ,
DEF_OP() { auto line=ed.prompt("Goto: ");int lineNum=str2num(line);ed.getBuff().gotoLine(lineNum, ed.getWindow().dim());}   
)

◆ DEF_CMD() [10/16]

teditor::cursor::ops::DEF_CMD ( MatchParen  ,
"match-paren"  ,
"cursor_ops"  ,
DEF_OP() { auto &buff=ed.getBuff();auto &win=ed.getWindow();bool isOpen=buff.matchCurrentParen();isOpen? buff.lineUp(win.dim()) :buff.lineDown();}   
)

◆ DEF_CMD() [11/16]

teditor::cursor::ops::DEF_CMD ( NextPara  ,
"next-para"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().nextPara();}   
)

◆ DEF_CMD() [12/16]

teditor::cursor::ops::DEF_CMD ( NextWord  ,
"next-word"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().nextWord();}   
)

◆ DEF_CMD() [13/16]

teditor::cursor::ops::DEF_CMD ( PageDown  ,
"page-down"  ,
"cursor_ops"  ,
DEF_OP() { auto jump=Option::get("pageScrollJump").getReal();auto &buf=ed.getBuff();buf.pageDown(int(jump *ed.getWindow().dim().y));}   
)

◆ DEF_CMD() [14/16]

teditor::cursor::ops::DEF_CMD ( PageUp  ,
"page-up"  ,
"cursor_ops"  ,
DEF_OP() { auto jump=Option::get("pageScrollJump").getReal();auto &buf=ed.getBuff();buf.pageUp(int(jump *ed.getWindow().dim().y));}   
)

◆ DEF_CMD() [15/16]

teditor::cursor::ops::DEF_CMD ( PreviousPara  ,
"previous-para"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().previousPara();}   
)

◆ DEF_CMD() [16/16]

teditor::cursor::ops::DEF_CMD ( PreviousWord  ,
"previous-word"  ,
"cursor_ops"  ,
DEF_OP() { ed.getBuff().previousWord();}   
)