-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
[WIP] Refactor #40
[WIP] Refactor #40
Conversation
Leaves a stub for the old script in place, so that scripts which rely on starting it will still work. This isn't working perfectly, because a few things are/aren't in the auto-exec section that shouldn't be. This can be fixed by converting labels to functions where possible.
@rcmdnk can you tell me some of the functions/variables you call from other scripts? What you might consider most similar to a public API? I'll create wrappers so that they don't lose backwards-compatibility. |
Values of Anyway, I think we should start to make classes before splitting files. |
The reverse also applies: to know the classes, we have to spit the script anyway |
But sure, any settings will have an api left for them, same as current. |
I'm starting to implement classes https://github.com/rcmdnk/vim_ahk/blob/class/vim.ahk I think this kind of work makes the way to split files clearly, too, |
Ok, if I discard my changes and pull yours, then make edits, are you happy to cherry-pick my changes too? Or do you want to make a separate PR? I haven't done a collaborative PR before so I don't know how easy git makes it to add commits from two authors. Can you push directly to this PR branch?? |
If you agree with class branch structure, then it is easier to start from the branch. |
Sure. I'll reset this PR to your branch, and push changes. What is your timezone and working hours? I'm GMT+12, working 0900-2000. So long as we push frequently, I'll pull each morning and we shouldn't end up with conflicts. |
It would make the process much easier if you check out and add this pull request as a remote. That way we can both collaborate on it. You have push access to it. |
To avoid having to name things the redundant class Vim{
#Include %A_LineFile%\..\lib\vim_about.ahk
#Include %A_LineFile%\..\lib\vim_conf.ahk
#Include %A_LineFile%\..\lib\vim_debug.ahk
#Include %A_LineFile%\..\lib\vim_icon_mng.ahk
#Include %A_LineFile%\..\lib\vim_ini.ahk
#Include %A_LineFile%\..\lib\vim_menu.ahk
#Include %A_LineFile%\..\lib\vim_state.ahk
} That way, instead of being accessed as Also, for backwards compatibility, the main script can include an (optional?) api, like VimReadIni(){
Vim.Ini.ReadIni()
} For variables it gets a bit trickier, but I think you could do something like:
Dereferencing may be an issue though, I'll check it. EDIT: Nope, doesn't work. Variable references might have to be updated by hand. |
…l but set local for local variables (as control's variables must be global, but too many (and will be changed)
I'm at GMT+9, but I almost can't touch the script during the working hour. |
There are some limitations I have already found. Another thing that I could not implement is to implement the class method for SetTimer. Control variables used for the settings also must be global or static, and I just let them global, but there is no good way to specify in VimSetting.Menu function. |
Ok. If you push to this pull request branch, I will help work on it tomorrow. Otherwise I can only let you work on it yourself. Can you please explain: what do you mean by "use class variables as global variables"?
No good way to specify what? To set variables from outside the script, do you mean? |
Anyway, the changes made so far are a big improvement |
Are the timers only used to detect when the window changes? I have a function that registers for the Windows system event to notify it when the active window changes, so it's actually more efficient (and instant). Would it be helpful to replace the timers with that? |
For example,
then, it must be declared explicitly. |
I just wanted to replace all labels to functions, as it is more manageable. |
It is for tooltips, to delay and remove after some time. Line 64 in 58a3696
In |
I see. That would make wrapping the includes in a |
Ok. I decided to wrap the callback function I was talking about and release it anyway. https://github.com/BlueDrink9/ahk-detect_window_change |
TODO