-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds GetArg and GetWord methods to Buffer #3112
Conversation
Idk it seems to me other functions in the Is it really not imported? Idk where it is done but maybe it would more convenient to export it to lua (if it is still not exported). |
I can add it to the buffer module to be used with local buffer = import('micro/buffer')
function complete(buf)
local input, argstart = buffer.GetArg(buf)
end The main idea would be to make the GetArg function available so that lua plugins can build their own complete commands. |
@dustdfg I added GetArg to the micro/buffer import |
Exporting |
I would actually prefer the first version, i.e. making Also, if export |
@dmaluka I also thought about exporting |
I also exported GetWord so it could be used to build plugins |
My vote is still for exporting GetArg and GetWord as buffer methods... |
Ok maybe it is better. The functions are used only by buffer itself and is pretended to be used by |
Hm, most probably I wasn't attentive enough in the moment I suggested to just export
So @taconi I've to excuse, changed my mind and support your first and @dmaluka approach. Hopefully we will get to the point at which these changes don't rot at private branches/PRs any longer. |
For me, the buffer itself should know how to fetch this information. It makes more semantic sense to ask the buffer to get the last word over the cursor ( |
I returned the PR to use via |
Turns the GetArg function into a buffer object method to be used by lua plugins.
Example:
Closes #3111