zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.39k stars 1.16k forks source link

Weird pasting multiline text behavior #3272

Closed versacodes closed 2 months ago

versacodes commented 2 months ago

Description of the problem or steps to reproduce

Why does copy pasting leads to this behavior? I selected the text as shown in the first image then, pasted in a new line aligned from the previous text. But the copied second line now has 2 tabs. instead of 1. I expected the pasted text to be the same as the first image also. It should be aligned.

Copied text: m1

Pasted text m2

Specifications

Micro Version: 2.0.11

Commit hash: OS: Debian GNU/Linux 12 (bookworm) Terminal: kitty

dmaluka commented 2 months ago

It is a feature. To disable it, disable the smartpaste option.

* `smartpaste`: add leading whitespace when pasting multiple lines.
   This will attempt to preserve the current indentation level when pasting an
   unindented block.

    default value: `true`
versacodes commented 2 months ago

Thanks! This solved it.