TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to learn about text editor architectures and implementations?

195 点作者 s3arch超过 3 年前
I am a self taught developer. Its been more than 3 years. I know decent JavaScript, and full-stack developement knowledge. I recently started admiring text editors. I use vscode. I have also used VIM and EMACS. I tried reading their source code, also of atom, brackets, light table etc.<p>Honestly I don&#x27;t understand anything. I am not able to make sense of the data flow and the architecture. I want to understand how text editors work under the hood. Also I want to understand the plugable architecture they use to extend the functionalities of the editor.<p>Please suggest me any articles, videos, conferences, blogs, where I can pick up the concepts. I have been troubled by this lack of knowledge and unclear path to access it.<p>Edit: Reasons for this quest: I am not here to create yet another text editor. But I do understand that they are one of the complex peice of software which still is under constant improvisation and developement. Also text processing is the one of the core concepts of computer science. A lot of algorithm and data structure knowledge is hidden inside it. Besides, I feel through real world projects one can learn alot about core computer science foundations.

39 条评论

bakul超过 3 年前
I have a different suggestion. Start with a single line. define an api for move, insert and delete. figure out how to display this line, associate the cursor with the current position and how to map keystrokes to these simple functions. Add commands to load&#x2F;save this one line file. Also some convenience functions (move to star&#x2F;end of a line etc). Add simple search, search and replace. Next extend this to as many lines as you can display on your screen. Add more commands. Add commands to operate on a sequence of lines. Next allow arbitrary number of lines, and arbitrary length lines (now you can see only a rectangular slice of the file). Add commands to move that window, move lines around etc. Resist the urge to micro optimize or do so early. Just use the simplest data structures that help you write the clearest code. Later you can profile the code and fix slow parts.<p>I suggest this as it will force you to solve problems yourself as opposed reading about other people’s solutions. Basically learn by doing. Learn by struggling to come up with solutions and data structures, thereby developing some insight. The stepwise development should help focus on a small subset of problems at a time. Don’t be afraid of changing data structures as you gain knowledge. In fact write code to make it easy! Use a language that won’t trip you up in low level issues such as memory management. The api will make testing easier. Armed with this knowledge you’ll better appreciate and understand other people’s solutions as well!
评论 #29877929 未加载
评论 #29878051 未加载
评论 #29877608 未加载
nurbel超过 3 年前
Have you seen The Architecture of Open Source Applications book [1] ? There is a chapter on Eclipse and its plugin system in it [2]. Lots of other interesting content not really related to text editing however.<p>[1]: <a href="http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html</a> [2]: <a href="http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;eclipse.html" rel="nofollow">http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;eclipse.html</a>
antidnan超过 3 年前
Prosemirror is a good place to start. <a href="https:&#x2F;&#x2F;prosemirror.net&#x2F;docs&#x2F;guide&#x2F;" rel="nofollow">https:&#x2F;&#x2F;prosemirror.net&#x2F;docs&#x2F;guide&#x2F;</a> <a href="https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;blog&#x2F;prosemirror.html" rel="nofollow">https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;blog&#x2F;prosemirror.html</a><p>They have a well architected model, including plugins to extend functionality, see <a href="https:&#x2F;&#x2F;tiptap.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tiptap.dev&#x2F;</a> which is built ontop of Prosemirror<p>bonus: The author talks about collaborative editing here: <a href="https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;blog&#x2F;collaborative-editing.html" rel="nofollow">https:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;blog&#x2F;collaborative-editing.html</a>
评论 #29876933 未加载
评论 #29877227 未加载
grisha超过 3 年前
An excellent tutorial for terminal based text editor from scratch: <a href="https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;</a>
评论 #29875167 未加载
bmitc超过 3 年前
I’m interested in this as well and know nothing but know of a few things.<p>I know of <i>The Craft of Text Editing</i>.<p><a href="https:&#x2F;&#x2F;www.finseth.com&#x2F;craft&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.finseth.com&#x2F;craft&#x2F;</a><p>There’s also the Racket editors, which includes a text editor control, in the Racket Graphical Interface Toolkit. It’s what is used to implement the DrRacket IDE.<p><a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;gui&#x2F;editor-overview.html" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;gui&#x2F;editor-overview.html</a>
munificent超过 3 年前
I have a little fantasy console project I tinker on that has a built-in text editor. Working on that has been an insightful trip into all of the subtleties of text editing that we intuitively know but don&#x27;t know we know. Here&#x27;s one I stumbled onto recently. Say your file looks like this, with the cursor at `|`:<p><pre><code> 12345|678 123 12345678 </code></pre> Press arrow key down once, and you get:<p><pre><code> 12345678 123| 12345678 </code></pre> Because the second line&#x27;s length is too short to preserve the cursor column, the cursor snaps to the end of the line. Note that the cursor is really here. If the user were to press left once, it would take them to:<p><pre><code> 12|3 </code></pre> Instead of pressing left, say the user presses down again. The cursor is currently on column 4, so you&#x27;d expect:<p><pre><code> 12345678 123 123|45678 </code></pre> But in the text editors I&#x27;ve tested, you get:<p><pre><code> 12345678 123 12345|678 </code></pre> So the cursor is snapped to the end of the line on line 2, but if the user keeps cursoring past that, the original cursor column is remembered and restored. The text editor has to display where the cursor currently is, but track where it &quot;wants&quot; to be if the line length weren&#x27;t getting in the way.<p>This is definitely useful behavior. If you arrow down through a bunch of lines of various lengths, it&#x27;s <i>really</i> annoying if the cursor starts drifting left. But implementing it correctly was much more subtle than I expected.<p>There are all sorts of other edge cases too. If a user presses Command-Up to move the cursor to the beginning of the file, and then presses Down, does the cursor always stay on column one, or does it remember the original column before Command-Up was pressed?
评论 #29882293 未加载
marttt超过 3 年前
Rob Pike has published several great papers about <i>sam</i>, the Plan 9 text editor he wrote.<p>1. General overview of the editor; maybe scroll to the &quot;Implementation&quot; section here: <a href="http:&#x2F;&#x2F;doc.cat-v.org&#x2F;plan_9&#x2F;4th_edition&#x2F;papers&#x2F;sam&#x2F;" rel="nofollow">http:&#x2F;&#x2F;doc.cat-v.org&#x2F;plan_9&#x2F;4th_edition&#x2F;papers&#x2F;sam&#x2F;</a><p>Some of the references at the end of that paper may also be relevant or interesting.<p>2. Tutorial for the command language: <a href="http:&#x2F;&#x2F;doc.cat-v.org&#x2F;bell_labs&#x2F;sam_lang_tutorial&#x2F;sam_tut.pdf" rel="nofollow">http:&#x2F;&#x2F;doc.cat-v.org&#x2F;bell_labs&#x2F;sam_lang_tutorial&#x2F;sam_tut.pdf</a><p>3. And explanations on structural regular expressions that <i>sam</i> uses: <a href="http:&#x2F;&#x2F;doc.cat-v.org&#x2F;bell_labs&#x2F;structural_regexps&#x2F;se.pdf" rel="nofollow">http:&#x2F;&#x2F;doc.cat-v.org&#x2F;bell_labs&#x2F;structural_regexps&#x2F;se.pdf</a><p>4. Pike&#x27;s paper representing <i>Acme</i>, the (sort-of) follow-up editor of <i>sam</i>: <a href="http:&#x2F;&#x2F;doc.cat-v.org&#x2F;plan_9&#x2F;4th_edition&#x2F;papers&#x2F;acme&#x2F;" rel="nofollow">http:&#x2F;&#x2F;doc.cat-v.org&#x2F;plan_9&#x2F;4th_edition&#x2F;papers&#x2F;acme&#x2F;</a>
Someone超过 3 年前
<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20603567" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20603567</a>, discussing <a href="https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;index.html</a> probably will give you some hints.<p>Architecture-wise, you can start with an ordered list of lines, with each line stored as a string.<p>Features that complicate things are:<p>- supporting large documents and staying speedy (“replace all” is a good test case)<p>- supporting line wrapping or proportional fonts (makes it harder to translate between screen locations and (line, character) offsets)<p>- supporting Unicode (makes it harder to translate between screen locations and (line, byte position) offsets)<p>- syntax-colouring<p>- plug-ins<p>- regular expression based search (fairly simple for single-line search _if_ you store each line as a string; harder for custom data structures, as you can’t just use a regexp library)<p>- supporting larger-than-memory files (especially on systems without virtual memory, but I think that’s somewhat of a lost art)<p>- safely saving documents even if the disk doesn’t have space for two files (a lost art. Might not even have been fully solved, ever)<p>Edit: you also want to look at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11244103" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11244103</a>, discussing <a href="https:&#x2F;&#x2F;ecc-comp.blogspot.com&#x2F;2015&#x2F;05&#x2F;a-brief-glance-at-how-5-text-editors.html" rel="nofollow">https:&#x2F;&#x2F;ecc-comp.blogspot.com&#x2F;2015&#x2F;05&#x2F;a-brief-glance-at-how-...</a>
评论 #29875426 未加载
scandox超过 3 年前
You could start by looking at something super simple like Kilo:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;antirez&#x2F;kilo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;antirez&#x2F;kilo</a><p>Even I could understand this one pretty well and that&#x27;s no small matter.
评论 #29877249 未加载
评论 #29877369 未加载
评论 #29877254 未加载
jesperlang超过 3 年前
The rope data structure is an interesting concept worth checking out!<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rope_(data_structure)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rope_(data_structure)</a>
评论 #29876640 未加载
mattferderer超过 3 年前
This article on VS Code has been on my read list for a while. Maybe you&#x27;ll get to it faster than me.<p>Bracket pair colorization 10,000x faster - <a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2021&#x2F;09&#x2F;29&#x2F;bracket-pair-colorization" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2021&#x2F;09&#x2F;29&#x2F;bracket-pair-...</a>
whartung超过 3 年前
If you&#x27;re interested in visual editors and if you&#x27;re looking for something perhaps more accessible (and I can&#x27;t honestly say how much it really is, I have not looked at it) then consider taking a look at &#x27;less&#x27;, the pager.<p>Less does almost everything an &quot;editor&quot; does, at least visually, except change text. It pages through text, forward and backward, line by line, it handles lines that are too long, tab expansion, it searches, even has an extended command set. (Can less do syntax coloring?)<p>It also handles files too big for memory. These are all editor problems. Mind its solutions may not be optimized for an editor, but it&#x27;s certainly smaller.<p>Today, modern machines &quot;suffer&quot; from &quot;too much&quot; performance which actually frees you from not having to worry so much about the actual backing store, especially early on. Do you really intend to be editing a 2GB file? Honestly, how big is an average text file? And how many billion cycles per second does a modern CPU handle? Sucking the entire file in to RAM, and just pushing stuff around with block moves will take you very far on a modern machine. Not that you should not look at the other data structures (there are many), but you don&#x27;t have to start there, depending on where your interest lies.<p>Also consider hunting down the book &quot;Software Tools&quot;. There&#x27;s two editions, the original and &quot;Software Tools in Pascal&quot;. It&#x27;s by Kernighan and Plauger. They go through in detail and write a version of the &#x27;ed&#x27; line editor.<p>And if you really want to work on an editor, the CP&#x2F;M world would love a new one. There, it&#x27;s all about efficiency.
评论 #29876808 未加载
caconym_超过 3 年前
I wrote a toy text editor for fun a while back. I was aware of the &#x27;rope&#x27; and &#x27;gap buffer&#x27; data structures, but beyond that I had no knowledge of how &quot;mainstream&quot; text editors are put together. I still don&#x27;t, really, but I feel that I did get an understanding of many of the core problems.<p>My editor had a modular architecture flexible enough to implement different input modes, including a mostly-complete subset of Vim bindings, and was fast enough to open and edit files on the order of a few hundred megabytes without perceptible slowdown. I&#x27;m sure my implementation would have looked insane to anybody who&#x27;s worked on a <i>real</i> text editor, but I was fairly proud of it myself.<p>Anyway, I guess the point is that it was interesting and rewarding to navigate the core challenges myself. I&#x27;m not sure I would have gotten as much out of trying to understand how a massive project like vscode is put together, since the actual text editing functionality is (presumably) a comparatively small part of the software as a whole.
teddyh超过 3 年前
You want this:<p><i>The Craft of Text Editing<p>—or—<p>Emacs for the Modern World<p>–by–<p>Craig A. Finseth</i><p><a href="https:&#x2F;&#x2F;www.finseth.com&#x2F;craft&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.finseth.com&#x2F;craft&#x2F;</a>
评论 #29875495 未加载
评论 #29880508 未加载
danking00超过 3 年前
I think this might be the kind of content you seek:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11244103" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11244103</a><p>It’s about data structures for editable text. Surprisingly complex!
atfzl超过 3 年前
xi-editor <a href="https:&#x2F;&#x2F;xi-editor.io&#x2F;docs.html" rel="nofollow">https:&#x2F;&#x2F;xi-editor.io&#x2F;docs.html</a><p>This is written in rust and has docs about rope data structure and editor architecture.
jdefelice超过 3 年前
Not sure if this is entirely what you are after but Andreas Kling of SerenityOS builds an IDE from scratch[1] for his own operating system. While I don&#x27;t personally know C++ I found the videos interesting and fun to watch.<p>[1] DevTools hacking playlist - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLMOpZvQB55bfeIHSA71J81OZi3F19lh3d" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLMOpZvQB55bfeIHSA71J8...</a>
danielbarla超过 3 年前
Object oriented programming and design patterns in particular get a bad rap these days, however, the original Design Patterns book [1] has a case study chapter about designing a WYSIWYG document editor. Also, one of the authors, Erich Gamma, joined Microsoft in 2011, and works on the Monaco suite of components that VS Code is built on top of. So, while I am sure there&#x27;s a fair bit of difference in the years since they wrote that book, as well as the needs of implementation in JS, I&#x27;d say it&#x27;s a fairly good deep dive into some of the topics from one of the actual architects behind it.<p>Fair warning though, it&#x27;s a fairly hard book to read. For a lighter, more fun intro to design patterns in particular, I always recommend Game Programming Patterns [2]<p>[1] <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Design-Patterns-Elements-Reusable-Object-Oriented&#x2F;dp&#x2F;0201633612" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Design-Patterns-Elements-Reusable-Obj...</a><p>[2] <a href="https:&#x2F;&#x2F;gameprogrammingpatterns.com&#x2F;contents.html" rel="nofollow">https:&#x2F;&#x2F;gameprogrammingpatterns.com&#x2F;contents.html</a>
评论 #29878685 未加载
andrewstuart超过 3 年前
&gt;&gt; I tried reading their source code, also of atom, brackets, light table etc. Honestly I don&#x27;t understand anything. I am not able to make sense of the data flow and the architecture.<p>Even so, this is exactly the right thing to do, except probably you are studying editors that are too big for your purposes - find something smaller in scope.<p>You won&#x27;t understand without significant effort - you need to put in the work.<p>So, here&#x27;s what I suggest:<p>1: keep examining the source code of various editors - however, focus on trying to find small editors that are very focused in what they do. Also look for old editors for operating systems like DOS - they might be smaller in scope and therefore easier to understand. Also look at editors in other languages, such as Pascal.<p>2: The essence of learning is to implement - so start writing the smallest editor you can.<p>3: continue searching for and reading any sort of written documentation&#x2F;blog posts&#x2F;articles as you are doing.<p>Eventually the light will switch on.
tester34超过 3 年前
Honestly nothing gives as much experience&#x2F;knowledge<p>as trying to write it yourself<p>and then reading about how other people do it e.g VS Code blog<p><a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2018&#x2F;03&#x2F;23&#x2F;text-buffer-reimplementation" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2018&#x2F;03&#x2F;23&#x2F;text-buffer-r...</a>
coutego超过 3 年前
I was on the same boat many years ago, when I co-founded Monodevelop, a port of #SharpDevelop to Mono. I started by porting the text component, which was the core of the text editor itself.<p>There was a book explaining the implementation of this IDE:<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Dissecting-C-Application-Inside-SharpDevelop&#x2F;dp&#x2F;1861008171&#x2F;ref=mp_s_a_1_2?crid=2LD87802QQDY0&amp;keywords=sharpdevelop+dissecting+christian+holm&amp;qid=1641838236&amp;sprefix=sharpdevelop+dissecting+christian+holm%2Caps%2C179&amp;sr=8-2" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Dissecting-C-Application-Inside-Sharp...</a><p>I think you might find it interesting for what you are trying to do, even though it&#x27;s a bit old.
RapperWhoMadeIt超过 3 年前
As far as I know, some of these terminal text editors use the ncurses library to handle their &quot;frontend&quot;, the way in which they properly display text in your terminal. As mentioned in another comment it is utmost necessary that you feel comfortable reading code in C (with a decent knowledge of syscalls) in order for you to understand the programs&#x27; source code. But when you have already achieved that level, you can start learning about ncurses with this basic tutorial [0].<p>[0] <a href="https:&#x2F;&#x2F;tldp.org&#x2F;HOWTO&#x2F;NCURSES-Programming-HOWTO&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tldp.org&#x2F;HOWTO&#x2F;NCURSES-Programming-HOWTO&#x2F;</a>
jmiskovic超过 3 年前
Lately I&#x27;ve been studying lite editor which is mostly Lua code. It&#x27;s quite easy to read the code and follow along. Before that I wrote my own editor which kind of works, but it mostly made me appreciate the lite&#x27;s design.<p><pre><code> https:&#x2F;&#x2F;github.com&#x2F;rxi&#x2F;lite https:&#x2F;&#x2F;rxi.github.io&#x2F;lite_an_implementation_overview.html https:&#x2F;&#x2F;rxi.github.io&#x2F;a_simple_undo_system.html</code></pre>
cdrini超过 3 年前
If you&#x27;re looking for more CS fundamental things--which I take to mean slightly more theoretical--you might be more interested in programming language design. A lot of the features that make an IDE powerful, things like tracking variable references, resolving&#x2F;unioning types for better autocomplete, dependency graphs, tree parsing, etc., are based on programming language design&#x2F;theory. I haven&#x27;t used this, but this seems like an interesting open book on the subject: <a href="https:&#x2F;&#x2F;craftinginterpreters.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;craftinginterpreters.com&#x2F;</a><p>If you&#x27;re interested more in the complexity management--which I would call more software engineering-y--not sure what the best way might be! I know one cool thing about Vs code is the language server provider (LSP). This provides all the IDE-goodies for all the languages Vs code supports in an abstract interface any plugin can implement. The spec has been so popular it&#x27;s now supported in a bunch of editors! So you could develop an LSP for eg python, and then just have a light wrapper for vim, Vs code, Emacs.
buescher超过 3 年前
It&#x27;s from a completely different time and point of view than &quot;full-stack development&quot;, vi, or emacs, but Petter Hesselberg&#x27;s <i>Programming Industrial Strength Windows: Shrink-Wrap Your App!</i> presents a complete text editor for Windows as an example of a complete &quot;real-world&quot; Windows application.
ketanmaheshwari超过 3 年前
I would suggest start with getting familiar with the C programming language. I suggest use Beej&#x27;s guide for C. Next, pick up the &quot;The Linux Programming Interface&quot; book by Michael Kerrisk. As you read the book you will get better at understanding source code of at least Vim and Emacs if not others.
bebop超过 3 年前
Ewig is an interesting implementation using immutable data structures. <a href="https:&#x2F;&#x2F;github.com&#x2F;arximboldi&#x2F;ewig" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;arximboldi&#x2F;ewig</a> Very proof of concept, tries to be a little emacs like. Might be worth checking out.
评论 #29888799 未加载
cellularmitosis超过 3 年前
Gary Bernhardt of destroyallsoftware did a screencast episode about that: <a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;screencasts&#x2F;catalog&#x2F;text-editor-from-scratch" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;screencasts&#x2F;catalog&#x2F;text-...</a><p>Note that it’s behind a paywall (his catalog is likely worth it for a curious hacker such as yourself).<p>Watch his “compiler from scratch” for free to get a sense of what his casts are like: <a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;screencasts&#x2F;catalog&#x2F;a-compiler-from-scratch" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;screencasts&#x2F;catalog&#x2F;a-com...</a>
cartesius13超过 3 年前
Emacs and vim are way too complicated to just jump directly to the source code. Try something smaller and more manageable. I would personally recommend vis[1]. Also, take a look at <a href="https:&#x2F;&#x2F;texteditors.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;texteditors.org&#x2F;</a> to discover new editors and resources on design and implementation<p>[1]<a href="https:&#x2F;&#x2F;github.com&#x2F;martanne&#x2F;vis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;martanne&#x2F;vis</a>
epberry超过 3 年前
Here&#x27;s 2 articles on building a SQL editor.<p>- <a href="https:&#x2F;&#x2F;arctype.com&#x2F;blog&#x2F;sql-query-editor-switch&#x2F;" rel="nofollow">https:&#x2F;&#x2F;arctype.com&#x2F;blog&#x2F;sql-query-editor-switch&#x2F;</a><p>- <a href="https:&#x2F;&#x2F;arctype.com&#x2F;blog&#x2F;indexeddb-localstorage&#x2F;" rel="nofollow">https:&#x2F;&#x2F;arctype.com&#x2F;blog&#x2F;indexeddb-localstorage&#x2F;</a><p>Disclaimer: I wrote the 2nd one. My general takeaway is that it gets interesting quickly as the amount of text edited increases.
schemathings超过 3 年前
&#x27;Challenging projects every programmer should try&#x27; - first example is a text editor with some pointers to some data structures to consider, some design patterns to use, and a few links to other resources. <a href="https:&#x2F;&#x2F;austinhenley.com&#x2F;blog&#x2F;challengingprojects.html" rel="nofollow">https:&#x2F;&#x2F;austinhenley.com&#x2F;blog&#x2F;challengingprojects.html</a>
jhallenworld超过 3 年前
Read technical documentation for existing editors, for example:<p><a href="https:&#x2F;&#x2F;sourceforge.net&#x2F;p&#x2F;joe-editor&#x2F;mercurial&#x2F;ci&#x2F;default&#x2F;tree&#x2F;docs&#x2F;hacking.md" rel="nofollow">https:&#x2F;&#x2F;sourceforge.net&#x2F;p&#x2F;joe-editor&#x2F;mercurial&#x2F;ci&#x2F;default&#x2F;tr...</a>
mxstbr超过 3 年前
If you&#x27;re curious about looking at something novel and ambitious, Zed has a really interesting writeup of their… unusual architecture involving a GPU-powered UI framework and CRDTs written in Rust: <a href="https:&#x2F;&#x2F;zed.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zed.dev&#x2F;</a>
wnolens超过 3 年前
Off topic&#x2F;meta: I really really love this question, and appreciate so many good replies. &lt;3 HN
cx0der超过 3 年前
Neatpad <a href="https:&#x2F;&#x2F;www.catch22.net&#x2F;tuts&#x2F;neatpad" rel="nofollow">https:&#x2F;&#x2F;www.catch22.net&#x2F;tuts&#x2F;neatpad</a><p>This is a series that I used to follow as I too wanted to implement my own text editor to learn the underlying architecture.
mathieubordere超过 3 年前
A small `vi` implementation that might be understandable -&gt; <a href="https:&#x2F;&#x2F;git.busybox.net&#x2F;busybox&#x2F;tree&#x2F;editors&#x2F;vi.c" rel="nofollow">https:&#x2F;&#x2F;git.busybox.net&#x2F;busybox&#x2F;tree&#x2F;editors&#x2F;vi.c</a>
armchairhacker超过 3 年前
See RSyntaxTextArea (open-source code editor) and the underlying JTextArea &#x2F; swing code.<p>There are a few weird design decisions especially in swing, but overall it&#x27;s very easy to read and understand.
maxk42超过 3 年前
vim is kinda hard to follow and emacs is probably too complex. Start with some simpler open-source editors like joe, nano, or gEdit. neovim is probably a lot easier to follow than vim, as well. You could also peruse these github projects: <a href="https:&#x2F;&#x2F;github.com&#x2F;collections&#x2F;text-editors" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;collections&#x2F;text-editors</a>
amichail超过 3 年前
For WYSIWYG scientific&#x2F;math editors, see the open source TeXmacs.