Fond memory of when I wrote an editor in the 90's because we didn't want to use "ms edit" for COBOL and asm files. Syntax coloring, fast buffering and even a screen saver. You could even call the compiler directly from it. All this running on a pentium 120 and it felt a thousands times faster than today's vscode. But vscode can edit multiple files at the same time...
> But vscode can edit multiple files at the same time borland turbo pascal and turbo c could also open multiple files at the same time.
Writing my own text editor, and daily-driving it
91–100 of 124 posts
Re: Writing my own text editor, and daily-driving it
#92Fond memory of when I wrote an editor in the 90's because we didn't want to use "ms edit" for COBOL and asm files. Syntax coloring, fast buffering and even a screen saver. You could even call the compiler directly from it. All this running on a pentium 120 and it felt a thousands times faster than today's vscode. But vscode can edit multiple files at the same time...
Yes, I remember writing a VB6 driven editor. I was so happy when I got find and replace to work. I still have the marketing page copy from 2002: Unlimited fully customizable template files Fully customizable syntax highlighting Very customizable user interface Color coded printing (optional) Column selection abilities Find / Replace by regular expressions Block indent / outdent Convert normal text to Ascii, Hex, and…
Re: Writing my own text editor, and daily-driving it
#93[flagged]
Author here. Off the top of my head: - Software is simpler than you think when you boil it down. There's a massive incentive to over-sell the complexity of the problem a solution is trying to solve, to pull in users. This is true both for proprietary products and, to a lesser degree, FOSS. You can probably replace most of the tools you use day-to-day in a weekend or two - provided you keep practising the art of just…
If notation is a tool of thought, and programming is theory-building, the way you're communicating your experience in words is a kind of knowledge transfer to an audience of indefinite scale, a public service that contributes to collective understanding.
Re: Writing my own text editor, and daily-driving it
#94Re: Writing my own text editor, and daily-driving it
#95Earlier quoted context omitted.
A thing that shocked me as I was working on the text editor was how capable modern terminal emulators are when you account for ANSI extensions. First-class clipboard access, mouse events, precise text styling, focus tracking, system notifications, key press/release events, etc. are all possible with a modern terminal emulator. There's not really anything else you need to build a very competent, ergonomic editor UI. Y…
I appreciate this, but I'm not concerned with the capabilities of the terminal or the GUI. What would be unhelpful, to me, would be to build a TUI because then if I wanted to send the actual app state to - for instance, a web browser which runs the library in WASM - the only way would be to pipe the terminal output across the shared buffer, instead of just blitting the app/editor state into it (or the relevant messag…
Re: Writing my own text editor, and daily-driving it
#96Re: Writing my own text editor, and daily-driving it
#97Earlier quoted context omitted.
Author here. Off the top of my head: - Software is simpler than you think when you boil it down. There's a massive incentive to over-sell the complexity of the problem a solution is trying to solve, to pull in users. This is true both for proprietary products and, to a lesser degree, FOSS. You can probably replace most of the tools you use day-to-day in a weekend or two - provided you keep practising the art of just…
Just wanted to thank you for sharing thoughts here and on your website. The article about making your own text editor, the one about how "toy software" is a joy, another about language models, and this comment.. I've been programming since I was a child, and have gone through ups and downs in the industry as well as personally, how I relate to computing - in the context of that experience, I've appreciated your insig…
Frankly, I spend a lot of time feeling similarly uncomfortable about my relationship with computers and the industry at large. I think, perhaps surprisingly, I'd call myself a 'technophobe' for this reason.
I think there's a parallel universe out there in which the arc of technology bends toward a future I actually want to live in, but I'm fairly sure we aren't in that universe today. But perhaps if we talk more about how to use the darned things in a manner that enhances the human experience rather than detracts, we can get closer to it.
Re: Writing my own text editor, and daily-driving it
#98Earlier quoted context omitted.
Yes, I remember writing a VB6 driven editor. I was so happy when I got find and replace to work. I still have the marketing page copy from 2002: Unlimited fully customizable template files Fully customizable syntax highlighting Very customizable user interface Color coded printing (optional) Column selection abilities Find / Replace by regular expressions Block indent / outdent Convert normal text to Ascii, Hex, and…
Windows XP theme support! That was advanced!
I went all-in developing that editor. It had a website and forums but it wasn't something I sold, you could download it for free. Funny how even back then I tolerated almost no BS for the tools I use. I couldn't find an editor that I liked so I spent a few weeks making one.
Fast forward 20 years and while I'm not using my own code editor the spirit of building and sharing tools hasn't slowed down. If anything I build more nowadays because as I get older the more I want to use nice things. My tolerance has gotten even stricter. It's how I ended up tuning my development environment over the years in https://github.com/nickjj/dotfiles.
Re: Writing my own text editor, and daily-driving it
#99So you are claiming to have tried dozens of editors, discarded them, only to land on nano as your daily driver?
If that's true, this person must be a character.
Re: Writing my own text editor, and daily-driving it
#100Any chance people in this thread have some recommendations for text-editing libraries? I would love to build my own text editor, to do some things in my own way that no one else seems to have an interest in doing, but one of the big things for me is that it must be a GUI. I won't bore people with the reasons, but that requirement forces me to bring along a lot of stuff, like a font renderer (at least one) and a graph…
The two notable functions are stb_text_locate_coord() and stb_textedit_find_charpos(), which connect the physical x,y coordinates with position in text buffer. They both iterate lines of text - accumulating y position; and the chars of last line - accumulating x position.
For windowing, drawing and OS integration, SDL with SDL_ttf is actually pretty good. SDL3_ttf API got an improvement and no longer requires zero-terminated strings so you don't need to relocate every chunk.