echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.74k stars 179 forks source link

Trying to add a newline surrounding adds carriage return (^M) instead of line feed #836

Closed ElectrifyPro closed 4 months ago

ElectrifyPro commented 4 months ago

Contributing guidelines

Module(s)

mini.surround

Description

When trying to add a newline surrounding, i.e. by typing:

sai(<CR>

(where <CR> represents actually pressing the enter key)

The result is that carriage return bytes (^M, 0x0d) are added as the surrounding character, instead of line feed (0x0a). See example images below.

I am running Neovim on WSL 2.

Neovim version

NVIM v0.9.4

Steps to reproduce

  1. nvim (open blank file)
  2. 30aa<Esc> (add 30 lowercase As as test content)
  3. sav0<CR> (add newline surrounding on entire line assuming mini.surround is installed, and cursor is at the last a)

Expected behavior

Buffer that looks like: image

Actual behavior

image

echasnovski commented 4 months ago

Thanks for the issue!

This was already discussed in #321. The resolution was that it is not (easily) possible under current design. The alternatives are:

Closing as not planned.