Skip to content

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

@savemejeff

Description

@savemejeff

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions