diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-04-24 21:04:44 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-04-24 21:04:44 +0200 |
| commit | 610cb4094fb1cf7fb7e4c6857c0bad813e18a17a (patch) | |
| tree | e4e0d41f1c47e741c4124cddbf527823a5c6213e /vis.c | |
| parent | 90184397cba235b212c0e230db0dbb6dfc8d0aba (diff) | |
| download | vis-610cb4094fb1cf7fb7e4c6857c0bad813e18a17a.tar.gz vis-610cb4094fb1cf7fb7e4c6857c0bad813e18a17a.tar.xz | |
vis: fix newline insertion at end of file
With enabled auto indentation and tab expansion in an empty buffer,
the following would insert one newline too many:
i<Tab><Enter>
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1596,7 +1596,7 @@ size_t vis_text_insert_nl(Vis *vis, Text *txt, size_t pos) { text_insert(txt, pos, "\n", 1); if (eof) { if (nl2) - text_insert(txt, pos, "\n", 1); + text_insert(txt, text_size(txt), "\n", 1); else pos--; /* place cursor before, not after nl */ } |
