aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-27 09:55:21 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-27 10:41:53 +0200
commit0319b359acae515550a3ff68bf62aa2e476015fe (patch)
treec4a1138a5a8a86c994c94cdcc06bf56e3f0a59ca /view.c
parent4e6fad14700bdb4cf473d2fcd175a71600cd6000 (diff)
downloadvis-0319b359acae515550a3ff68bf62aa2e476015fe.tar.gz
vis-0319b359acae515550a3ff68bf62aa2e476015fe.tar.xz
view: change view_cursors_place to take 1 based column number
This should fix inconsistency in the Lua API.
Diffstat (limited to 'view.c')
-rw-r--r--view.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/view.c b/view.c
index 06f2365..47709ee 100644
--- a/view.c
+++ b/view.c
@@ -1336,7 +1336,7 @@ void view_cursors_to(Cursor *c, size_t pos) {
void view_cursors_place(Cursor *c, size_t line, size_t col) {
Text *txt = c->view->text;
size_t pos = text_pos_by_lineno(txt, line);
- pos = text_line_char_set(txt, pos, col);
+ pos = text_line_char_set(txt, pos, col > 0 ? col-1 : col);
view_cursors_to(c, pos);
}