Writing a Programmers Editor (Search & Replace) - Part 8
Draft — not yet published.
In Part 7 we will have a responsive rendering engine. Now we need one of the most used features in any editor: search. But not just any search — incremental search, where results appear as you type, before you even finish the query.
This part covers:
- Naive string search and why it is good enough for most cases.
- Incremental search: how emacs'
isearchworks — searching forward as each character is typed, with instant feedback. - Boyer-Moore and Knuth-Morris-Pratt: when to bother with fancy algorithms.
- Regular expression search: compiling patterns, matching against the gap buffer.
- Query replace: interactive replacement with
y/nat each match. - Implementing an incremental search engine in Scheme.
Search is the feature users reach for most after basic editing. Getting it right — making it feel instant — is one of the highest-impact things you can do.
Watchout for this assay when it is published, till then.
Shorel'aran
Writing a Programmer's Editor
A series of assays on building a programmable text editor from scratch in Scheme — exploring the balance of power between the C runtime and the scripting language, data structures, terminal I/O, and extensibility.
- 1 Writing a Programmers Editor - Part 1 2018-08-06
- 2 Writing a Programmers Editor (DS/Gapbuffer) - Part 2 2018-08-11
- 3 Writing a Programmers Editor (Gap Buffer in Scheme) - Part 3 Draft 2018-08-18
- 4 Writing a Programmers Editor (Lines & Display) - Part 4 Draft 2018-08-25
- 5 Writing a Programmers Editor (Terminal I/O & Raw Mode) - Part 5 Draft 2018-09-01
- 6 Writing a Programmers Editor (Keymaps & Input Handling) - Part 6 Draft 2018-09-08
- 7 Writing a Programmers Editor (Rendering & Redisplay) - Part 7 Draft 2018-09-15
- 8 Writing a Programmers Editor (Search & Replace) - Part 8 Here 2018-09-22
- 9 Writing a Programmers Editor (Syntax Highlighting) - Part 9 Draft 2018-09-29
- 10 Writing a Programmers Editor (Undo/Redo & Command Log) - Part 10 Draft 2018-10-06
- 11 Writing a Programmers Editor (Modes & Extensibility) - Part 11 Draft 2018-10-13
- 12 Writing a Programmers Editor (Reflections & Lessons) - Part 12 Draft 2018-10-20
Responses