sidebar: quick scripts; fix Icon condition race

This commit is contained in:
end-4
2024-02-14 21:11:34 +07:00
parent 06245d13b0
commit bb28c9089c
26 changed files with 895 additions and 128 deletions
@@ -44,6 +44,7 @@ function copyToClipboard(text) {
function substituteLang(str) {
const subs = [
{ from: 'javascript', to: 'js' },
{ from: 'bash', to: 'sh' },
];
for (const { from, to } of subs) {
@@ -58,7 +59,7 @@ const HighlightedCode = (content, lang) => {
const buffer = new GtkSource.Buffer();
const sourceView = new GtkSource.View({
buffer: buffer,
wrap_mode: Gtk.WrapMode.WORD
wrap_mode: Gtk.WrapMode.NONE
});
const langManager = GtkSource.LanguageManager.get_default();
let displayLang = langManager.get_language(substituteLang(lang)); // Set your preferred language