diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-11-27 13:57:01 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-11-27 13:57:01 +0100 |
| commit | 1954d5ef9219b5c3c8ba757b0936118fe265d13b (patch) | |
| tree | 0d159fb6db99707524a5f9629b272afd003d9fa3 /view.c | |
| parent | 28481439c06780e2c56d3c2b47711785bcaa25a6 (diff) | |
| download | vis-1954d5ef9219b5c3c8ba757b0936118fe265d13b.tar.gz vis-1954d5ef9219b5c3c8ba757b0936118fe265d13b.tar.xz | |
vis: improve cursor alignment command <C-a>
Diffstat (limited to 'view.c')
| -rw-r--r-- | view.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1091,6 +1091,17 @@ size_t view_cursors_pos(Cursor *c) { return text_mark_get(c->view->text, c->mark); } +int view_cursors_cell_get(Cursor *c) { + return c->line ? c->col : -1; +} + +int view_cursors_cell_set(Cursor *c, int cell) { + if (!c->line || cell < 0) + return -1; + cursor_set(c, c->line, cell); + return c->col; +} + Register *view_cursors_register(Cursor *c) { return &c->reg; } |
