diff options
Diffstat (limited to 'vis-operators.c')
| -rw-r--r-- | vis-operators.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vis-operators.c b/vis-operators.c index 6e61d46..0f3ae19 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -57,6 +57,9 @@ static size_t op_put(Vis *vis, Text *txt, OperatorContext *c) { const char *data = register_get(vis, c->reg, &len); for (int i = 0; i < c->count; i++) { + char nl; + if (c->reg->linewise && pos > 0 && text_byte_get(txt, pos-1, &nl) && nl != '\n') + pos += text_insert_newline(txt, pos); text_insert(txt, pos, data, len); pos += len; } |
