RishabhRD / popfix

Neovim lua API for highly extensible popup window
83 stars 3 forks source link

Idea for UI popup element #15

Open IndianBoy42 opened 3 years ago

IndianBoy42 commented 3 years ago

This is something I have implemented myself for LSP Rename:

A popup window with no border, that shows up over an existing region of text (for lsp rename it starts at the beginning of the word we are on). It initially contains the same text as the region it is covering (maybe highlighted differently), and doesn't covering anything else. The user starts in normal mode (so that we can use cw to replace the whole word), but can edit the text inside the popup as they want. If the new text becomes bigger than the original then the window should expand, but it shouldn't shrink below the original size

Essentially a very unintrusive UI for changing some region of text and having a callback that can do something with the new region, perfect for LSP rename but possibly usable for other things

RishabhRD commented 3 years ago

Yeah can you refer the code here... We can work on it

IndianBoy42 commented 3 years ago

https://github.com/IndianBoy42/LunarVim/blob/dbda70623a701d2a441713a39bde627bc1c2728c/lua/lsp/functions.lua#L228

https://github.com/IndianBoy42/LunarVim/blob/e6feda5222d773e188de1552932f1d4a506db7a9/lua/lv-utils/init.lua#L171