align.nvim icon indicating copy to clipboard operation
align.nvim copied to clipboard

Enter pattern `'` causes adding an extra space between `(` and `'`

Open nyngwang opened this issue 3 years ago • 2 comments

As title, see:

https://user-images.githubusercontent.com/24765272/195490566-7528f3fd-fd0e-41bd-8b4f-3ef929ba568f.mov

nyngwang avatar Oct 13 '22 03:10 nyngwang

This is unfortunate behavious as usually you want to leave a space for what youre aligning (think '=', 'end', 'function')

Maybe it would be sufficient to add an option to disable adding that space?

Vonr avatar Oct 13 '22 13:10 Vonr

is it possible to change the algorithm (I haven't read your code carefully) so that "don't add a space if any starting-char is not the leading-char of a given word"? So aligning these lines:

foo('s', ...)
foo( 'd', ...)
foo('f', ...)

will result in: (since only the second line where ' is the leading-char of word 'd',)

foo('s', ...)
foo('d', ...)
foo('f', ...)

not (this is the current behavior):

foo( 's', ...)
foo( 'd', ...)
foo( 'f', ...)

nyngwang avatar Oct 17 '22 15:10 nyngwang