Vonr / align.nvim

A minimal plugin for NeoVim for aligning lines
GNU General Public License v3.0
147 stars 4 forks source link

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

Open nyngwang opened 1 year ago

nyngwang commented 1 year ago

As title, see:

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

Vonr commented 1 year ago

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?

nyngwang commented 1 year ago

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', ...)