Hi again! The past three hours have been a manic frenzy of adding features. I’m starting to get the hang of Go. I’m not used to working so quickly, but working on this project is surprisingly exciting.
New features:
- backspace! If you press backspace, it’ll either delete the character immediately before your cursor, or if you’re at the beginning of a line, it’ll merge current line with the previous one and then shift all other lines upwards.
- enter! If you press enter, it’ll bifurcate the current line and split the right half onto a new line.
- the cursor will now stop going out of bounds. It automatically clamps the mouse X position to the max length of the current line.
- the top row is now reserved for a
nano-style header that currently saysdeci 0.0.1on the left andby @ethmarkson the right. - the cursor now highlights the character under it rather than replacing it with a solid white square.
- plus lots of bugfixes, mainly fixing bugs that I added while adding the other features mentioned in this list.
Features I want to add next:
- highlighting the active line by lightening the background color
- a status bar
- line numbers
- a keybind info bar
Oh, and I’ve decided that deci is ASCII-only. Go is weird about counting characters if they occupy more than one byte, so it would be a huge pain to add support for Unicode and would probably lead to a bajillion bugs.
To make sure you understand what I mean about the ASCII thing, I’ll provide an example: the hamster emoji is 1 character, it occupies 2 columns in the terminal, and it’s made of 4 bytes. Because of the last part, len("🐹") returns 4 in Go, so any string with a hamster emoji in it will appear to have 3 more characters and occupy 2 more columns than it actually does.
Making sure that the code reliably distinguishes between those three very similar concepts would be really challenging, and the only benefit would be that you could use emojis and non-Latin characters in deci. I don’t really think that it’s worth it.
deci is shaping up shockingly quickly. I almost could have written this devlog in deci, though the lack of horizontal or vertical scrolling would probably prevent me from actually writing the full thing.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.