Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

refactor list creation functionality #3

Merged
merged 3 commits into from
Jul 1, 2022
Merged

refactor list creation functionality #3

merged 3 commits into from
Jul 1, 2022

Conversation

mcauley-penney
Copy link
Contributor

 By formatting all of the icon lists, it
 becomes possible to remove a good deal of
 repetition in the list-building code and
 automate a great deal. For example, by
 making all icon tables formatted the same
 way, instead of having many functions to
 build lists, we can have one function that
 does the same work. We can also automate
 the user command creation because of how
 similar all of the user command creation
 calls are

     By formatting all of the icon lists, it
     becomes possible to remove a good deal of
     repetition in the list-building code and
     automate a great deal. For example, by
     making all icon tables formatted the same
     way, instead of having many functions to
     build lists, we can have one function that
     does the same work. We can also automate
     the user command creation because of how
     similar all of the user command creation
     calls are
@mcauley-penney
Copy link
Contributor Author

Hey, how's it going! So, I formatted the icon sets and that allowed for a dramatic refactoring, eliminating a lot of repetition. This code is more extensible, I think, because new lists can be created without the addition of new functions. It is arguably less readable, though, and I think that the variable names could be improved a lot. I think it is WIP but I submitted it so that you could take a look and see if you 1. liked the changes and 2. if you did like them, what you would like to change.

    • unroll nested loop in command Initialization
        • eliminates `callback_tbl`
        • makes "Insert" command creation more explicit

    • remove dynamic cmd name creation
        • move "Pick" substring into `list_types` keys
        • makes the command creation process easier to
          follow because the command names are more
          complete and explicit in the source

    • alphabetize tables
    • reformat with default stylua settings
    • delete a few empty lines
@mcauley-penney mcauley-penney changed the title chore, refactor: format icons, refactor list creation functionality refactor list creation functionality Jun 25, 2022
@ziontee113
Copy link
Owner

Oh wow, I'm sorry I've taken this long to reply. I'll take a look at this :)

@ziontee113
Copy link
Owner

This is my first time receiving a complex PR. I'll look into how to handle PRs & test things properly :)

@mcauley-penney
Copy link
Contributor Author

This is my first time receiving a complex PR. I'll look into how to handle PRs & test things properly :)

No worries, I totally understand! I usually try and start with smaller PRs when I'm working with someone I've never worked with before but, after I started on this, I kind of just kept going because it was fun and its a neat project. I tested it out as best I could but I would be happy to correct any problems that you find.

Importantly, you obviously don't need to accept all of the changes I've made. I wrote and submitted this knowing that it was a lot of changes and I expect that at least some of them won't appeal to you, so I totally understand not wanting to accept all of them into the main branch.

@ziontee113
Copy link
Owner

Yeah I'm currently busy adding features to color-picker.nvim. I'll do this PR properly when I'm finished with it (soon™).

@ziontee113
Copy link
Owner

I really appreciate your PR 👍. Unfortunately I will need to consult my dear friend who has much more experience than me, which will make the process take a bit longer.
Thank you for making the PR 😃 , I think I'll take think slow for now. I hope you understand. 🙏

@mcauley-penney
Copy link
Contributor Author

There's no reason to apologize! It sounds like a good plan to me 👍🏻

@ziontee113
Copy link
Owner

ziontee113 commented Jul 1, 2022

Hi man, I managed to pull down your code locally with github cli. And your changes are amazing! I'm merging this soon 👍 .

@ziontee113 ziontee113 merged commit d625216 into ziontee113:master Jul 1, 2022
@ziontee113
Copy link
Owner

I've learned so much from your PR. Thank you so much ❤️ !

@mcauley-penney
Copy link
Contributor Author

I've learned so much from your PR. Thank you so much ❤️ !

That's awesome, I'm really glad to hear that! If there are any bugs that crop up or issues that are opened that concern this PR, I'd be more than happy to be assigned to them. Again, I'm really glad that this worked out and that you liked it!

@ziontee113
Copy link
Owner

Cheers man :) Take care.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants