hugoam/kiui

[feature request] source code widget

Opened this issue · 2 comments

Something that is really missing in existing game GUI widget sets so far is a source code editor component with line numbers and being able to define parsers for syntax highlighting as plugins or by something like User Defined Language from Notepad++.

Use case is scripting in game editors. For example, games like TSC would preferably have that instead some normal text box.

Chiming in. For ProDGB Daniel choose to use Scintilla which is a full-featured widget and adapt it for rendering in ImGui. Scintilla is a rather complex but does everything.

See sc_platform_bgfx.cpp and ui_sc_editor*
https://github.com/emoon/ProDBG/tree/master/src/prodbg/ui

Same approach could be used to adapt it to other systems. Afaik few people have bothered creating a new "platform" for Scintilla but with that code above as a base it should be much easier to extract it. Would be worthy to make a standalone app using Scintilla with bgfx/kiui/ImGui sample because it's an often desired feature, once it's standalone it's easy for anyone to port it somewhere else.

If you only want keyword highlighting without much awareness of the language it's probably easier to do it directly inside kiui.

If you only want keyword highlighting without much awareness of the language it's probably easier to do it directly inside kiui.

@ocornut Scintilla really seems like an overkill to me. For an actual IDE you'd use a "normal" toolkit, wouldn't you?