Conversation
…but add it to `loadfile` environment when loading the init file.
|
I would like to apply the first commit (Separate locating and loading of init file. but I'm afraid I don't know how to merge only this commit without the rest of the PR. Google told me how to do it with Github Desktop, but I don't have it installed (and don't want to install it). Can I do it from the github web interface? Of course I could pickup the diff and apply it manually but I'd rather merge your commit to keep attribution. |
|
I think you can take just that commit with If it doesn't work, I'll make a new branch with only this commit next week when I am back at my computer. |
Thanks. Will look into git cherry-pick and how to import a branch from another repo -- at the moment, my git experience is very limited :) |
|
Your comments about unused variables and turning globals into locals made me think about the code structure and the extension API (to write code in ple_init.lua). I think that the editor object is too large and gives access to all internals which is also dangerous. Also ple_init functions should not have direct access to buffers. The buffer parameter 'b' passed to all 'editor.actions' functions is often unused and is (or could be) always the current buffer. So I have split the 'editor' table in two:
All the editor "actions" (that are bound to keys) are stored in 'eapi'. They all apply to the current buffer, so the 'b' parameter (used or not) is removed for all of them. |
|
I'll go through the diff of your commits in more details, but my understanding is that you basically addressed the main purpose this pull request by a refactor? Regarding the exposed api, if you think it is prettier, or perhaps for the potential of backwards compatibility, you could change naming (in two steps):
Thus keeping the |
Yes. It was also an opportunity to reduce the amount of editor internals exposed in the extension API. I have wanted to do that for a long time because the internals (buffer management, undo machinery) are not so simple, and could be involuntarily broken by some extension code. Regarding renaming Edit: Hum... thinking about it, the refactoring will be much easier if |
|
Great. Before I close this pull request, what do you think about 933b2b3? |
|
I think this one could basically be closed, but was wondering if you considered 933b2b3. A benefit of making
|
Refer to discussion in pull request philanc#10.
|
Superseded by #14. |
Ref #8 (comment)
Not expecting you to pull this urgently since you mentioned you need to review your init files, but here is a draft for when you are ready (may well need to be updated for merge conflicts).
Note that the first commit 8280237 isn't strictly necessary, but doing loading in one place makes the second commit cleaner. Maybe considering this one regardless of the second two?