aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vis.c b/vis.c
index d65b45b..c075dc5 100644
--- a/vis.c
+++ b/vis.c
@@ -848,8 +848,8 @@ static void insert_tab(const Arg *arg) {
}
static void insert_newline(const Arg *arg) {
- // TODO determine file type to insert \r\n or \n
- insert(&(const Arg){ .s = "\n" });
+ insert(&(const Arg){ .s =
+ text_newlines_crnl(vis->win->text) ? "\r\n" : "\n" });
}
static void openline(const Arg *arg) {