aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/misc1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r--src/nvim/misc1.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index d83c03c9fd..e63ca008bc 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -16,6 +16,7 @@
#include "nvim/version_defs.h"
#include "nvim/misc1.h"
#include "nvim/charset.h"
+#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
@@ -119,7 +120,7 @@ open_line (
/*
* make a copy of the current line so we can mess with it
*/
- saved_line = vim_strsave(ml_get_curline());
+ saved_line = vim_strsave(get_cursor_line_ptr());
if (State & VREPLACE_FLAG) {
/*
@@ -285,7 +286,7 @@ open_line (
if ((pos = findmatch(NULL, '(')) != NULL) {
curwin->w_cursor.lnum = pos->lnum;
newindent = get_indent();
- ptr = ml_get_curline();
+ ptr = get_cursor_line_ptr();
}
}
/*
@@ -886,7 +887,7 @@ open_line (
&& curbuf->b_p_lisp
&& curbuf->b_p_ai) {
fixthisline(get_lisp_indent);
- p = ml_get_curline();
+ p = get_cursor_line_ptr();
ai_col = (colnr_T)(skipwhite(p) - p);
}
/*
@@ -900,7 +901,7 @@ open_line (
? KEY_OPEN_FORW
: KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum))) {
do_c_expr_indent();
- p = ml_get_curline();
+ p = get_cursor_line_ptr();
ai_col = (colnr_T)(skipwhite(p) - p);
}
if (vreplace_mode != 0)
@@ -913,7 +914,7 @@ open_line (
*/
if (State & VREPLACE_FLAG) {
/* Put new line in p_extra */
- p_extra = vim_strsave(ml_get_curline());
+ p_extra = vim_strsave(get_cursor_line_ptr());
/* Put back original line */
ml_replace(curwin->w_cursor.lnum, next_line, FALSE);
@@ -1594,7 +1595,7 @@ int del_char(int fixpos)
if (has_mbyte) {
/* Make sure the cursor is at the start of a character. */
mb_adjust_cursor();
- if (*ml_get_cursor() == NUL)
+ if (*get_cursor_pos_ptr() == NUL)
return FAIL;
return del_chars(1L, fixpos);
}
@@ -1611,7 +1612,7 @@ int del_chars(long count, int fixpos)
char_u *p;
int l;
- p = ml_get_cursor();
+ p = get_cursor_pos_ptr();
for (i = 0; i < count && *p != NUL; ++i) {
l = (*mb_ptr2len)(p);
bytes += l;
@@ -1795,23 +1796,6 @@ int gchar_pos(pos_T *pos)
return (int)*ptr;
}
-int gchar_cursor(void)
-{
- if (has_mbyte)
- return (*mb_ptr2char)(ml_get_cursor());
- return (int)*ml_get_cursor();
-}
-
-/*
- * Write a character at the current cursor position.
- * It is directly written into the block.
- */
-void pchar_cursor(int c)
-{
- *(ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE)
- + curwin->w_cursor.col) = c;
-}
-
/*
* Skip to next part of an option argument: Skip space and comma.
*/