supermaven-inc / supermaven-nvim

The official Neovim plugin for Supermaven
https://supermaven.com/
MIT License
278 stars 16 forks source link

feat(#48): `accept_line` keymap option #54

Open AlejandroSuero opened 3 weeks ago

AlejandroSuero commented 3 weeks ago

With this PR accept_line keymap is introduced with <C-l> as default because l -> line.

Accepts the next suggested line by looking for end of line.


https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/88efc25f-2626-4fed-a1dd-73d8b96f5e1d

Closes #48.

pedro757 commented 3 weeks ago

Awesome! there's only one thing, when the suggestion is indented and you accept_line it will only accept the indetation space but not the whole line.

Look at this video when the indentation is deep, you have to press accept_line multiple times to actually accept the line.

Every time I press accept_line it accepts one indentation level.

recording_20240607-081513.webm

AlejandroSuero commented 3 weeks ago

@pedro757 I made the changes so it gets the following line as a whole:

https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/4778e7a8-4022-44e5-ad4b-41357c12de5d

[!NOTE] If you insert a new line by yourself and needs indentation, it will have the same effect as in your video, for that line.

I am trying find a way that doesn't accept the whole suggestion as sometimes it gets the full suggestion in this case. It the same behaviour with accept_word and accept_suggestion. So this is following the current behaviour for the other keymaps.

pedro757 commented 3 weeks ago

LGTM, it feels much better now, thank you!

AlejandroSuero commented 3 weeks ago

@pedro757 I leave here the videos for accept_word and accept_suggestion current behaviour with indentation.

https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/6c839cdd-4a2c-4576-82d7-e639484d2034

https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/6b71e6ef-b964-4957-bd42-5901342aa398

AlejandroSuero commented 3 weeks ago

LGTM, it feels much better now, thank you!

Glad to hear 😁