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

Break up main.c #34

Open
japanoise opened this issue Jul 22, 2024 · 3 comments
Open

Break up main.c #34

japanoise opened this issue Jul 22, 2024 · 3 comments
Labels
code quality Non-user-facing refactors, code QoL, etc. documentation Improvements or additions to documentation

Comments

@japanoise
Copy link
Owner

If I'm gonna work on emsys more I need to make it easier to work on, because life is short and I have other hobbies and spend an awful lot of time programming other things (day job).

One idea is to break up main.c. Currently it has kind of a mixed reason to exist, and is 2000 lines long which is painful to work with (a legacy of being based on kilo). Ideally, it would just have int main in it, but I think that's unrealistic. Here's some quick ideas as to how I could break it up:

  • Move the terminal code as much as possible into a separate file (term.{c,h}?)
  • Move the key handling code (keys.{c,h})
  • Move the code to do with initializing the editor struct
  • Move the code that handles buffers

Might have to put more shit in headers if I do this, though, argh.

@japanoise japanoise added enhancement New feature or request documentation Improvements or additions to documentation labels Jul 22, 2024
@japanoise
Copy link
Owner Author

Would also like to document all the files in HACKING.md. Doing that always makes me feel like I've lowered the bus factor a little bit. emsys is not a complicated piece of code, but it is sloppily organized.

@nicholascarroll
Copy link
Contributor

nicholascarroll commented Jul 22, 2024

totally!
Let me get a couple PRs through first because they are nearly ready

  1. Independent window Scrolling #32 window scrolling.
  2. zmacs regions #19 visual mark
    also Why uthash? #33 which will be quick
    i might not have time until the weekend

@nicholascarroll
Copy link
Contributor

Would also like to document all the files in HACKING.md. Doing that always makes me feel like I've lowered the bus factor a little bit. emsys is not a complicated piece of code, but it is sloppily organized.

yes please!

@japanoise japanoise mentioned this issue Jul 24, 2024
@japanoise japanoise added code quality Non-user-facing refactors, code QoL, etc. and removed enhancement New feature or request labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Non-user-facing refactors, code QoL, etc. documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants