I decided to remake Notepad for this jam because I deleted the original one from the Settings menu but then couldn't install it back.

I haven't done much during the jam partly because I was lazy and disorganized and partly because I had a trip to ER, but this is what I ended up with:

Screenshot

Here's a video recording

The rendering is done inside OpenGL child window with memory-mapped array buffer.

For a font I used one from Sean Barret's prerendered font collection. God bless him.

When loading the file I simply map it into memory and find all line breaks which are then used inside file_get_line_span() function.

The project is written in ANSI C and compiles with both MSVC and GCC using a single batch script. It is under 2k LOC and uses no libraries except WinAPI and the font. I did not include windows.h directly but declared everything by hand which spared the compiler from going through additional 30-80K LOC and kept build times under a second. Everything is compiled as a unity build. The script also generates .lib files when the corresponding .def file changes which I did not know Batch could do.

Other than that, there's nothing else really, so I'll continue to work on this project after the jam. I'm planning to add a few things:

  • Editing obviously
  • Text selection
  • Infinite undo/redo using piece table
  • Asynchronous file loading which would allow showing the first lines almost instantly
  • Reading large files with which both original Notepad and Sublime struggle pretty hard