Skip to content

Commit

Permalink
view: change view_cursors_place to take 1 based column number
Browse files Browse the repository at this point in the history
This should fix inconsistency in the Lua API.
  • Loading branch information
martanne committed Apr 27, 2016
1 parent 4e6fad1 commit 0319b35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test
Submodule test updated 1 files
+2 −2 lua/basic_cursor.lua
2 changes: 1 addition & 1 deletion view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions view.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ int view_cursors_cell_set(Cursor*, int cell);
/* place cursor at `pos' which should be in the interval [0, text-size] */
void view_cursors_to(Cursor*, size_t pos);
void view_cursors_scroll_to(Cursor*, size_t pos);
/* place cursor on given (line, column) pair, both values are 1-based */
void view_cursors_place(Cursor*, size_t line, size_t col);
/* get register associated with this register */
Register *view_cursors_register(Cursor*);
Expand Down

0 comments on commit 0319b35

Please sign in to comment.