sonnyp / Commit

Commit message editor
https://apps.gnome.org/Commit/
GNU General Public License v3.0
132 stars 25 forks source link

Syntax hightlighting for interactive rebase #44

Open dragunoff opened 2 years ago

dragunoff commented 2 years ago

This is a nice feature that I miss from the Kate editor on KDE. When doing interactive rebase the action, hash and commit message are highlighted in different colors. It's a simple quality of life improvement. Here's a quick mock-up (with example colors): image

Prior art in Kate text editor: image

sonnyp commented 2 years ago

That's a nice idea.

Does kate uses different colors for pick, drop, reword, ... ? If so can you post a screenshot.

dragunoff commented 2 years ago

Does kate uses different colors for pick, drop, reword, ... ? If so can you post a screenshot.

I hadn't noticed but indeed it uses different colors for some of the commands: image

sonnyp commented 2 years ago

Commit now use GtkSourceView which has a powerful language spec system.

It doesn't have one for git but that should be reasonabily easy to do.

https://gitlab.gnome.org/GNOME/gtksourceview/-/tree/master/data/language-specs https://wiki.gnome.org/Projects/GtkSourceView/LanguageDefinitions https://builder.readthedocs.io/en/latest/plugins/editor/highlighting.html https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/lang-tutorial.html https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/lang-reference.html

sonnyp commented 2 years ago

Commit now has language definitions for git and hg

https://github.com/sonnyp/Commit/tree/main/src/language-specs

Should be quite straightforward to add support for git rebase syntax highlighting