setCursorColumn sets the current target cursor column (cursorColumn) to that of the given position
(pos lexer.Pos)
| 96 | // setCursorColumn sets the current target cursor column (cursorColumn) to that |
| 97 | // of the given position |
| 98 | func (ed *Editor) setCursorColumn(pos lexer.Pos) { |
| 99 | if wln := ed.wrappedLines(pos.Ln); wln > 1 { |
| 100 | si, ri, ok := ed.wrappedLineNumber(pos) |
| 101 | if ok && si > 0 { |
| 102 | ed.cursorColumn = ri |
| 103 | } else { |
| 104 | ed.cursorColumn = pos.Ch |
| 105 | } |
| 106 | } else { |
| 107 | ed.cursorColumn = pos.Ch |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | // savePosHistory saves the cursor position in history stack of cursor positions |
| 112 | func (ed *Editor) savePosHistory(pos lexer.Pos) { |
no test coverage detected