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

Need guidence for implementing "soft-wrap lines" #62

Open
savemejeff opened this issue Dec 13, 2024 · 0 comments
Open

Need guidence for implementing "soft-wrap lines" #62

savemejeff opened this issue Dec 13, 2024 · 0 comments

Comments

@savemejeff
Copy link

First of all, thank you so much for creating this amazing tutorial. I went through the tutorial, built my own kilo, and now I'm trying to implement all the functions listed in the Appendix. However, I'm stuck on "soft-wrap lines."

What I came up with is making render an array of strings. Then, every time I update a row, I split the characters into an array. But when doing so, it gets complicated very quickly. The hl array also needs to change to an array type since it syncs with render. I end up dealing with a lot of malloc and realloc calls, and I need to introduce a new state, ry, to track the cursor's vertical coordinate.

So, I wonder if there is any simpler way to implement this?

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

No branches or pull requests

1 participant