Neat! I have been trying to, in Nim, but I've had so little experience working with raw terminals and the IOCTL handles, I've been struggling! https://github.com/girvo/te This looks like a great tutorial to work through with it :)
Quickly looked at your source without the slightest knowledge of Nim language. It was certainly Python-like in ease of reading like some here told me. Nice, clean look to it vs the C stuff. Exception is types.nim file that just looks syntactically rougher than others with the asterisks. It looks like class or struct definitions but I'm curious if the asterisk has an effect like it does in C or what's it do?
Build Your Own Text Editor
11–20 of 164 posts
Re: Build Your Own Text Editor
#12Re: Build Your Own Text Editor
#13Earlier quoted context omitted.
The asterisks are what define a symbol as "exported" from a module -- every symbol is private to the module scope by default, but able to be exported by applying the asterisks to it; types.nim is funky because I was exploring a slightly different file/module structure (and having a singular place for top-level shared types that most other modules import is quite useful at times, and gets around circular dependencies)…
I appreciate it. So, it looks weird because it's an experiment with something non-standard? Makes sense. Things stay clean overall.
One other thing is that the {.compile.} pragma in term.nim is not needed anymore, as Nim's stdlib has added a lot of those in[0], but it does show how easy it is to bridge between the two languages (and I'm not much of a C developer!)
Re: Build Your Own Text Editor
#14Re: Build Your Own Text Editor
#15If you enjoy "redis style" C code, take a look at vis https://github.com/martanne/vis
Don't do it.
Re: Build Your Own Text Editor
#16Looks like it's been slashdotted.
Re: Build Your Own Text Editor
#17Reference implementations of medium sized applications are incredibly useful for leveling up as a programmer. While there are many large successful open source applications, many are overwhelming to read and learn from. Having something that outlines the key features and components and which ignores the important but complicated edge cases assists in keeping the attention focused. Now if there are annotation within t…
Do you have anything similar that you would recommend?
Re: Build Your Own Text Editor
#18Re: Build Your Own Text Editor
#19In hindsight, I would have a bit more caution programming text editors. I started tweaking and modifying Scite years ago, it was very interesting but it was no small undertaking and I came to understand why Neil advised in the support forum, to customise it using the inbuilt Lua scripting. Im still using this 6 year old customised version of Scite that I never managed to sync with the latest version, and it has 10 thousand lines of custom Lua facilities like file encryption, navigation panels, multi-edit mode etc.. which I wrote and stabilised a few years ago. I rarely venture to alter it now that I am at last comfortable with it, but its going to need serious attention sooner or later...