A Lua code editor
Posted: Tue Jun 23, 2020 2:07 pm
This is code editor written in pure Lua that can be rendered within LÖVE framework. The editor can be used to build self-contained development environments, like fantasy consoles or in-game editors.
It is a rather complete implementation of editor component that's easy to integrate into any project. Host should provide function callbacks for drawing text and rectangles, and react to keypresses by calling into text buffer functions.
The main.lua demonstrates how to use the editor, but it is not meant to be complete standalone editor application. File access and dialogs for opening/saving files are out of scope.
Features:
* pure Lua platform-independant text buffer
* restricted to ASCII character set
* basic text typing/deleting
* easy key remapping
* horizontal and vertical scrolling
* single cursor with page up/down, word skip and other movement options
* text highlighting for Lua code, with external color scheme
* text selection, cut, copy and paste
* status line for filename and row/column info
* basic macros (quick one-liners to be executed on key combination)
* simple and extendable
* public domain code unburdened by license
There is currently no undo and search features, or support for general text files (currently always using Lua highlighting).
This LÖVE version is actually a by-product of VR project, I'm sharing here as it might be useful to someone. Future updates to the editor will be available here: https://github.com/jmiskovic/indeck
It is a rather complete implementation of editor component that's easy to integrate into any project. Host should provide function callbacks for drawing text and rectangles, and react to keypresses by calling into text buffer functions.
The main.lua demonstrates how to use the editor, but it is not meant to be complete standalone editor application. File access and dialogs for opening/saving files are out of scope.
Features:
* pure Lua platform-independant text buffer
* restricted to ASCII character set
* basic text typing/deleting
* easy key remapping
* horizontal and vertical scrolling
* single cursor with page up/down, word skip and other movement options
* text highlighting for Lua code, with external color scheme
* text selection, cut, copy and paste
* status line for filename and row/column info
* basic macros (quick one-liners to be executed on key combination)
* simple and extendable
* public domain code unburdened by license
There is currently no undo and search features, or support for general text files (currently always using Lua highlighting).
This LÖVE version is actually a by-product of VR project, I'm sharing here as it might be useful to someone. Future updates to the editor will be available here: https://github.com/jmiskovic/indeck