aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-28 10:47:25 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-28 10:47:58 -0400
commit3dddceedceebb73b93d399f2c56b0f1b5394c645 (patch)
treeed1d11dcde7c7eb64f9474ae1c8ef891757fd554 /src/nvim/mbyte.c
parente4fe2dbd777a59a9a9b386d960eb9dddc459e84e (diff)
parent7e3681c32e4fd1e19c01ffe7286ea29aafb2efc4 (diff)
downloadrneovim-3dddceedceebb73b93d399f2c56b0f1b5394c645.tar.gz
rneovim-3dddceedceebb73b93d399f2c56b0f1b5394c645.tar.bz2
rneovim-3dddceedceebb73b93d399f2c56b0f1b5394c645.zip
Merge #674 'Extract cursor.h from misc{1,2}.h and memline.h'
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 10e94d7ced..ec1997657b 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -82,6 +82,7 @@
#include "nvim/vim.h"
#include "nvim/mbyte.h"
#include "nvim/charset.h"
+#include "nvim/cursor.h"
#include "nvim/fileio.h"
#include "nvim/memline.h"
#include "nvim/message.h"
@@ -2859,7 +2860,7 @@ void show_utf8()
/* Get the byte length of the char under the cursor, including composing
* characters. */
- line = ml_get_cursor();
+ line = get_cursor_pos_ptr();
len = utfc_ptr2len(line);
if (len == 0) {
MSG("NUL");
@@ -3096,7 +3097,7 @@ void utf_find_illegal()
curwin->w_cursor.coladd = 0;
for (;; ) {
- p = ml_get_cursor();
+ p = get_cursor_pos_ptr();
if (vimconv.vc_type != CONV_NONE) {
free(tofree);
tofree = string_convert(&vimconv, p, NULL);
@@ -3112,12 +3113,12 @@ void utf_find_illegal()
if (*p >= 0x80 && (len == 1
|| utf_char2len(utf_ptr2char(p)) != len)) {
if (vimconv.vc_type == CONV_NONE)
- curwin->w_cursor.col += (colnr_T)(p - ml_get_cursor());
+ curwin->w_cursor.col += (colnr_T)(p - get_cursor_pos_ptr());
else {
int l;
len = (int)(p - tofree);
- for (p = ml_get_cursor(); *p != NUL && len-- > 0; p += l) {
+ for (p = get_cursor_pos_ptr(); *p != NUL && len-- > 0; p += l) {
l = utf_ptr2len(p);
curwin->w_cursor.col += l;
}