aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-05-03 17:51:52 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-05-03 17:51:52 +0200
commit3c6a6c4c342e2b5cca62cda849acc6d476dafa30 (patch)
tree029880665f1436e4a6e325e1c4761d04b7c8127c /vis-lua.c
parent1c8990a329fabf3cf4ab790a61ee86c35391c042 (diff)
downloadvis-3c6a6c4c342e2b5cca62cda849acc6d476dafa30.tar.gz
vis-3c6a6c4c342e2b5cca62cda849acc6d476dafa30.tar.xz
text: remove text_insert_newline function
This is no longer needed because we always insert \n never \r\n.
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vis-lua.c b/vis-lua.c
index ed7ac38..58403d4 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2129,7 +2129,7 @@ static int file_lines_newindex(lua_State *L) {
const char *data = luaL_checklstring(L, 3, &size);
if (line == 0) {
text_insert(txt, 0, data, size);
- text_insert_newline(txt, size);
+ text_insert(txt, size, "\n", 1);
return 0;
}
size_t start = text_pos_by_lineno(txt, line);
@@ -2138,7 +2138,7 @@ static int file_lines_newindex(lua_State *L) {
text_delete(txt, start, end - start);
text_insert(txt, start, data, size);
if (text_size(txt) == start + size)
- text_insert_newline(txt, text_size(txt));
+ text_insert(txt, text_size(txt), "\n", 1);
}
return 0;
}