Skip to content
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

Split script into logically seperated multiple files #34

Closed
BlueDrink9 opened this issue Mar 10, 2019 · 8 comments
Closed

Split script into logically seperated multiple files #34

BlueDrink9 opened this issue Mar 10, 2019 · 8 comments

Comments

@BlueDrink9
Copy link
Contributor

Would you consider accepting a PR that refactors out things like UI and settings into different scripts? Folds are ok but it is still unruly trying to jump between different parts of the script or find something you need to check or change, which leads to bugs and forgotten implementations.

Having multiple files #included makes things much clearer to read the project.

For an idea of how this might work, see my fork.

@rcmdnk
Copy link
Owner

rcmdnk commented Mar 11, 2019

Thank you for the suggestion.

I agree that sometimes dividing into parts makes things clear,
especially for the testing.

On the other hand, I don't plan to split files for now,
as one file mode has more portability and I think it is better for users who just use the script.

@BlueDrink9
Copy link
Contributor Author

BlueDrink9 commented Mar 11, 2019

Understandable about users that just use the script. However I imagine that most people would run the script from the cloned repo, so they can update it easier and track any changes. (If they have ahk installed, they are probably developers who write other scripts too, right?)
Otherwise they would just use the exe.
If they have the whole folder anyway, then they can still run one script and the others will automatically get called.

Would this be solved if the exe was kept up to date? (ie through ci)?

It seems to me that the script is never going to be super portable because you need to have a portable ahk install anyway, meaning the additional complexity of this being multiple scripts instead of one is relatively smaller.
I think that, for a portable version, we should focus on the exe, which is truly portable.

@BlueDrink9
Copy link
Contributor Author

Would you consider this some more now that the exe is being kept up to date? (Which solves the portability issue, to a large extent?)

@rcmdnk
Copy link
Owner

rcmdnk commented Sep 25, 2019

Yes.
I could not find the good practice to make a structure for AHK scripts,
but maybe we can start with vim.ahk at top and lib/xxx.ahk?

@BlueDrink9
Copy link
Contributor Author

I concur. Feel free to check out my fork to see how I did it, and I believe one of the other contributors split it a different way.

For example, mappings should be separate from settings code.

Possibly separate out code for the model as well, like what the current mode is? May not have enough stored state for this to be worth it though

@rcmdnk
Copy link
Owner

rcmdnk commented Sep 25, 2019

ok, I'll employ the policy for development.
As you mentioned, separated into each mode may not only make the code seems better
but also give some futures available.

@BlueDrink9
Copy link
Contributor Author

Can I do this and open a PR? Or are you happy to? (I really want this done, especially after the work I just did)

@rcmdnk
Copy link
Owner

rcmdnk commented Feb 26, 2020

Closed as #40 was closed.

@rcmdnk rcmdnk closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants