Matt's Blog

Homepage | GitHub
« Back to index

Hello Again, World

I finally took the time to put the rewrite of mash online.

It’s still not ready to replace the main homepage, but I’ve made pretty decent progress, and also managed to support composition of commands.

Progress

Since last, I’ve pulled the following off the todo list:

Still outstanding is:

And I’ve added:

Challenges

Buffers

Multiline buffers ended up taking quite a bit of time to get right. Ultimately I went with a doubly linked list representing characters, and also had to have the buffer be in charge of hard wraps (as otherwise the cursor position becomes inaccurate).

The doubly linked list helped with the “insertion of text” problem, as now it is as simple as adding some links. My first stab had some 2 dimensional arrays and was generally a pain, as you’d have to reindex after each insert.

I think I could still simplify this quite a bit, but decided to ship something usable in the meanwhile.

HTML and Hard Wrapping

Hard wrapping and HTML are a little bit at odds. Consider the following link:

<a href="https://blog.con.rs">Blog</a>

When you render the HTML, only 4 characters show up. But let’s say our buffer wraps at 10 characters wide - well now everything goes out the window. Your cursor will have adjusted for the hard wrap, but then when you actually render the text, two things might happen:

For now, the simplest fix was just to remove links (lol).

Next up

The plan is to keep iterating and add the remaining outstanding functionality. I will probably not spend too much time supporting HTML yet, as it is not the most pressing problem, so first up will likely be better mobile support, followed by analytics support.

There is also a decent amount of cleanup needed, starting with decomposition of some of the beast commands.

I’d also like to take the time to document things right, as well as capture some of the nuance better, which will likely feed into another blog post here. In the meantime, feel free to follow my progress on the repository!

Thanks for reading!

If you enjoyed this content, please consider sharing it with your network.
This post is 2 out of 2 in the mash series.