=> b31e0ec735ec88492016ff4483dc4ec8556d3d25
[1mdiff --git a/po/en.po b/po/en.po[m [1mindex 812cb2c2..8977fb17 100644[m [1m--- a/po/en.po[m [1m+++ b/po/en.po[m [36m@@ -21,7 +21,7 @@[m [mmsgid "heading.archive.userdata"[m msgstr "User Data Archive"[m [m msgid "userdata.help"[m [31m-msgstr "User data archives contain exported browsing history, identities, bookmarks, site-specific settings, and fingerprints of trusted server certificates. They can be stored as backups and used for transferring data between devices."[m [32m+[m[32mmsgstr "User data archives contain exported browsing history, identities, bookmarks, text snippets, site-specific settings, and fingerprints of trusted server certificates. They can be stored as backups and used for transferring data between devices."[m [m msgid "doc.archive.view"[m msgstr "View archive contents"[m [36m@@ -1139,6 +1139,9 @@[m [mmsgstr "Import Failed"[m msgid "import.userdata.bookmarks"[m msgstr "Bookmarks:"[m [m [32m+[m[32mmsgid "import.userdata.snippets"[m [32m+[m[32mmsgstr "Snippets:"[m [32m+[m msgid "import.userdata.idents"[m msgstr "Identities:"[m [m [36m@@ -2059,6 +2062,9 @@[m [mmsgstr "Font glyph warnings:"[m msgid "prefs.font.smooth"[m msgstr "Font smoothing:"[m [m [32m+[m[32mmsgid "prefs.editor.highlight"[m [32m+[m[32mmsgstr "Syntax highlighting:"[m [32m+[m msgid "prefs.linewidth"[m msgstr "Line width:"[m [m [1mdiff --git a/res/lang/cs.bin b/res/lang/cs.bin[m [1mindex d893d758..1b8c0e08 100644[m Binary files a/res/lang/cs.bin and b/res/lang/cs.bin differ [1mdiff --git a/res/lang/de.bin b/res/lang/de.bin[m [1mindex 30a44438..d6d47f51 100644[m Binary files a/res/lang/de.bin and b/res/lang/de.bin differ [1mdiff --git a/res/lang/en.bin b/res/lang/en.bin[m [1mindex 1ab6df1f..f8b4ffca 100644[m Binary files a/res/lang/en.bin and b/res/lang/en.bin differ [1mdiff --git a/res/lang/eo.bin b/res/lang/eo.bin[m [1mindex 685ad5b5..865910c0 100644[m Binary files a/res/lang/eo.bin and b/res/lang/eo.bin differ [1mdiff --git a/res/lang/es.bin b/res/lang/es.bin[m [1mindex caafcf7f..c42c7c70 100644[m Binary files a/res/lang/es.bin and b/res/lang/es.bin differ [1mdiff --git a/res/lang/es_MX.bin b/res/lang/es_MX.bin[m [1mindex 030875cc..e9bafe94 100644[m Binary files a/res/lang/es_MX.bin and b/res/lang/es_MX.bin differ [1mdiff --git a/res/lang/eu.bin b/res/lang/eu.bin[m [1mindex fd0a2ce0..67bfccbc 100644[m Binary files a/res/lang/eu.bin and b/res/lang/eu.bin differ [1mdiff --git a/res/lang/fi.bin b/res/lang/fi.bin[m [1mindex 25f79d6f..802860a4 100644[m Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ [1mdiff --git a/res/lang/fr.bin b/res/lang/fr.bin[m [1mindex caa1b1e6..99bdc5c5 100644[m Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ [1mdiff --git a/res/lang/gl.bin b/res/lang/gl.bin[m [1mindex 1d9c1f9c..5acfecfc 100644[m Binary files a/res/lang/gl.bin and b/res/lang/gl.bin differ [1mdiff --git a/res/lang/hu.bin b/res/lang/hu.bin[m [1mindex 389b62f6..f07665ca 100644[m Binary files a/res/lang/hu.bin and b/res/lang/hu.bin differ [1mdiff --git a/res/lang/ia.bin b/res/lang/ia.bin[m [1mindex 1c6d9a6c..1e95f965 100644[m Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ [1mdiff --git a/res/lang/ie.bin b/res/lang/ie.bin[m [1mindex d95a0d6a..94220e80 100644[m Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ [1mdiff --git a/res/lang/isv.bin b/res/lang/isv.bin[m [1mindex 7b20db6b..e290eb93 100644[m Binary files a/res/lang/isv.bin and b/res/lang/isv.bin differ [1mdiff --git a/res/lang/it.bin b/res/lang/it.bin[m [1mindex af889c0e..3b1bd5d3 100644[m Binary files a/res/lang/it.bin and b/res/lang/it.bin differ [1mdiff --git a/res/lang/ja.bin b/res/lang/ja.bin[m [1mindex a4df6f94..d66a9f07 100644[m Binary files a/res/lang/ja.bin and b/res/lang/ja.bin differ [1mdiff --git a/res/lang/nl.bin b/res/lang/nl.bin[m [1mindex e49f2726..944e0414 100644[m Binary files a/res/lang/nl.bin and b/res/lang/nl.bin differ [1mdiff --git a/res/lang/pl.bin b/res/lang/pl.bin[m [1mindex 52578132..95d963fa 100644[m Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ [1mdiff --git a/res/lang/ru.bin b/res/lang/ru.bin[m [1mindex 6f4c0ecf..c3ed24ad 100644[m Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ [1mdiff --git a/res/lang/sk.bin b/res/lang/sk.bin[m [1mindex 3c1103cd..7f03e531 100644[m Binary files a/res/lang/sk.bin and b/res/lang/sk.bin differ [1mdiff --git a/res/lang/sr.bin b/res/lang/sr.bin[m [1mindex 70d9ed7a..77786e29 100644[m Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ [1mdiff --git a/res/lang/tok.bin b/res/lang/tok.bin[m [1mindex 03ae4b65..8a857f68 100644[m Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ [1mdiff --git a/res/lang/tr.bin b/res/lang/tr.bin[m [1mindex 22d2d5b9..5a10e7c4 100644[m Binary files a/res/lang/tr.bin and b/res/lang/tr.bin differ [1mdiff --git a/res/lang/uk.bin b/res/lang/uk.bin[m [1mindex 638f2591..26da3aad 100644[m Binary files a/res/lang/uk.bin and b/res/lang/uk.bin differ [1mdiff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin[m [1mindex 4e306a9a..7cb820a4 100644[m Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ [1mdiff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin[m [1mindex c8a9e349..24753c7e 100644[m Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ [1mdiff --git a/src/app.c b/src/app.c[m [1mindex c2855c79..fd4d53ff 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -315,6 +315,7 @@[m [mstatic iString *serializePrefs_App_(const iApp *d) {[m cstr_String(&d->prefs.strings[monospaceDocumentFont_PrefsString]));[m appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent);[m appendFormat_String(str, "inputzoom.set arg:%d\n", d->prefs.inputZoomLevel);[m [32m+[m[32m appendFormat_String(str, "uploadzoom.set arg:%d\n", d->prefs.editorZoomLevel);[m appendFormat_String(str, "pinsplit.set arg:%d\n", d->prefs.pinSplit);[m appendFormat_String(str, "feedinterval.set arg:%d\n", d->prefs.feedInterval);[m appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling);[m [36m@@ -359,6 +360,7 @@[m [mstatic iString *serializePrefs_App_(const iApp *d) {[m { "prefs.bottomtabbar", &d->prefs.bottomTabBar },[m { "prefs.centershort", &d->prefs.centerShortDocs },[m { "prefs.dataurl.openimages", &d->prefs.openDataUrlImagesOnLoad },[m [32m+[m[32m { "prefs.editor.highlight", &d->prefs.editorSyntaxHighlighting },[m { "prefs.evensplit", &d->prefs.evenSplit },[m { "prefs.font.smooth", &d->prefs.fontSmoothing },[m { "prefs.font.warnmissing", &d->prefs.warnAboutMissingGlyphs },[m [36m@@ -2518,6 +2520,14 @@[m [mvoid setForceSoftwareRender_App(iBool sw) {[m app_.forceSoftwareRender = sw;[m }[m [m [32m+[m[32mvoid setInputZoomLevel_App(int level) {[m [32m+[m[32m app_.prefs.inputZoomLevel = level;[m [32m+[m[32m}[m [32m+[m [32m+[m[32mvoid setEditorZoomLevel_App(int level) {[m [32m+[m[32m app_.prefs.editorZoomLevel = level;[m [32m+[m[32m}[m [32m+[m enum iColorTheme colorTheme_App(void) {[m return app_.prefs.theme;[m }[m [36m@@ -3588,6 +3598,10 @@[m [mstatic iBool handleNonWindowRelatedCommand_App_(iApp *d, const char *cmd) {[m }[m return iTrue;[m }[m [32m+[m[32m else if (equal_Command(cmd, "prefs.editor.highlight.changed")) {[m [32m+[m[32m d->prefs.editorSyntaxHighlighting = arg_Command(cmd) != 0;[m [32m+[m[32m return iFalse;[m [32m+[m[32m }[m else if (equal_Command(cmd, "prefs.gemtext.ansi.fg.changed")) {[m iChangeFlags(d->prefs.gemtextAnsiEscapes, allowFg_AnsiFlag, arg_Command(cmd));[m return iTrue;[m [36m@@ -4430,6 +4444,11 @@[m [miBool handleCommand_App(const char *cmd) {[m d->prefs.inputZoomLevel = iClamp(d->prefs.inputZoomLevel, 0, 2);[m return iTrue;[m }[m [32m+[m[32m else if (equal_Command(cmd, "uploadzoom.set")) {[m [32m+[m[32m d->prefs.editorZoomLevel = arg_Command(cmd);[m [32m+[m[32m d->prefs.editorZoomLevel = iClamp(d->prefs.editorZoomLevel, 0, 3);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m else if (equal_Command(cmd, "zoom.set")) {[m if (arg_Command(cmd) != d->prefs.zoomPercent) {[m d->prefs.zoomPercent = arg_Command(cmd);[m [36m@@ -4727,6 +4746,8 @@[m [miBool handleCommand_App(const char *cmd) {[m setToggle_Widget(findChild_Widget(dlg, "prefs.gemtext.ansi.fontstyle"),[m d->prefs.gemtextAnsiEscapes & allowFontStyle_AnsiFlag);[m setToggle_Widget(findChild_Widget(dlg, "prefs.font.smooth"), d->prefs.fontSmoothing);[m [32m+[m[32m setToggle_Widget(findChild_Widget(dlg, "prefs.editor.highlight"),[m [32m+[m[32m d->prefs.editorSyntaxHighlighting);[m setToggle_Widget(findChild_Widget(dlg, "prefs.tui.simple"), d->prefs.simpleChars);[m setFlags_Widget([m findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)),[m [1mdiff --git a/src/app.h b/src/app.h[m [1mindex 9242f1af..0b221b59 100644[m [1m--- a/src/app.h[m [1m+++ b/src/app.h[m [36m@@ -104,6 +104,8 @@[m [miBool isTextInputActive_App (void);[m const iPrefs * prefs_App (void);[m iBool forceSoftwareRender_App (void);[m void setForceSoftwareRender_App (iBool sw);[m [32m+[m[32mvoid setInputZoomLevel_App (int level);[m [32m+[m[32mvoid setEditorZoomLevel_App (int level);[m enum iColorTheme colorTheme_App (void);[m const iString * schemeProxy_App (iRangecc scheme);[m iBool schemeProxyHostAndPort_App (iRangecc scheme, const iString **host, uint16_t *port);[m [1mdiff --git a/src/prefs.c b/src/prefs.c[m [1mindex 1ad789df..fe890542 100644[m [1m--- a/src/prefs.c[m [1m+++ b/src/prefs.c[m [36m@@ -26,7 +26,8 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m #include[m #include [m [m [31m-_Static_assert(offsetof(iPrefs, plainTextWrap) == offsetof(iPrefs, bools[plainTextWrap_PrefsBool]),[m [32m+[m[32m_Static_assert(offsetof(iPrefs, geminiStyledGopher) ==[m [32m+[m[32m offsetof(iPrefs, bools[geminiStyledGopher_PrefsBool]),[m "memory layout mismatch (needs struct packing?)");[m [m void init_Prefs(iPrefs *d) {[m [36m@@ -46,6 +47,8 @@[m [mvoid init_Prefs(iPrefs *d) {[m d->uiAnimations = iTrue;[m d->uiScale = 1.0f; /* default set elsewhere */[m d->inputZoomLevel = 0;[m [32m+[m[32m d->editorZoomLevel = 0;[m [32m+[m[32m d->editorSyntaxHighlighting = iTrue;[m d->zoomPercent = 100;[m d->navbarActions[0] = back_ToolbarAction;[m d->navbarActions[1] = forward_ToolbarAction;[m [1mdiff --git a/src/prefs.h b/src/prefs.h[m [1mindex fb65a132..e5114f55 100644[m [1m--- a/src/prefs.h[m [1m+++ b/src/prefs.h[m [36m@@ -73,6 +73,7 @@[m [menum iPrefsBool {[m [m evenSplit_PrefsBool,[m detachedPrefs_PrefsBool,[m [32m+[m[32m editorSyntaxHighlighting_PrefsBool,[m [m /* Document presentation */[m sideIcon_PrefsBool,[m [36m@@ -151,6 +152,7 @@[m [mstruct Impl_Prefs {[m [m iBool evenSplit;[m iBool detachedPrefs;[m [32m+[m[32m iBool editorSyntaxHighlighting;[m [m /* Document presentation */[m iBool sideIcon;[m [36m@@ -208,6 +210,7 @@[m [mstruct Impl_Prefs {[m enum iToolbarAction navbarActions[maxNavbarActions_Prefs];[m enum iToolbarAction toolbarActions[2];[m int inputZoomLevel;[m [32m+[m[32m int editorZoomLevel;[m /* Document presentation */[m int zoomPercent;[m /* Behavior */[m [1mdiff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c[m [1mindex bf68bfc1..e3ba6635 100644[m [1m--- a/src/ui/inputwidget.c[m [1m+++ b/src/ui/inputwidget.c[m [36m@@ -248,6 +248,8 @@[m [mstruct Impl_InputWidget {[m iTextBuf * buffered; /* pre-rendered static text */[m iInputWidgetValidatorFunc validator;[m void * validatorContext;[m [32m+[m[32m iInputWidgetHighlighterFunc highlighter;[m [32m+[m[32m void * highlighterContext;[m iString * backupPath;[m int backupTimer;[m iString oldText; /* for restoring if edits cancelled */[m [36m@@ -835,6 +837,8 @@[m [mvoid init_InputWidget(iInputWidget *d, size_t maxLen) {[m init_Widget(w);[m d->validator = NULL;[m d->validatorContext = NULL;[m [32m+[m[32m d->highlighter = NULL;[m [32m+[m[32m d->highlighterContext = NULL;[m setFlags_Widget(w, focusable_WidgetFlag | hover_WidgetFlag, iTrue);[m setFlags_Widget(w, extraPadding_WidgetFlag, isMobile_Platform());[m #if LAGRANGE_USE_SYSTEM_TEXT_INPUT[m [36m@@ -1057,6 +1061,13 @@[m [mvoid setValidator_InputWidget(iInputWidget *d, iInputWidgetValidatorFunc validat[m d->validatorContext = context;[m }[m [m [32m+[m[32mvoid setHighlighter_InputWidget(iInputWidget *d, iInputWidgetHighlighterFunc highlighter,[m [32m+[m[32m void *context) {[m [32m+[m[32m d->highlighter = highlighter;[m [32m+[m[32m d->highlighterContext = context;[m [32m+[m[32m invalidateBuffered_InputWidget_(d);[m [32m+[m[32m}[m [32m+[m void setLineBreaksEnabled_InputWidget(iInputWidget *d, iBool lineBreaksEnabled) {[m iChangeFlags(d->inFlags, lineBreaksEnabled_InputWidgetFlag, lineBreaksEnabled);[m }[m [36m@@ -1145,6 +1156,7 @@[m [mstatic void updateBuffered_InputWidget_(iInputWidget *d) {[m strlen(uiTextStrong_ColorEscape));[m }[m }[m [32m+[m[32m /* TODO: To apply syntax highlighting here, we'd have to draw line by line. */[m iWrapText wt = wrap_InputWidget_(d, 0);[m wt.maxLines = d->maxWrapLines;[m wt.text = range_String(visText);[m [36m@@ -2920,7 +2932,13 @@[m [mstatic void draw_InputWidget_(const iInputWidget *d) {[m wrapText.text = range_String(&line->text);[m marker.line = line;[m marker.pos = drawPos;[m [31m- addv_I2(&drawPos, draw_WrapText(&wrapText, d->font, drawPos, fg).advance); /* lines end with \n */[m [32m+[m[32m iInputWidgetHighlight highlight = { .font = d->font, .color = fg };[m [32m+[m[32m if (d->highlighter) {[m [32m+[m[32m highlight = d->highlighter(d, wrapText.text, d->highlighterContext);[m [32m+[m[32m }[m [32m+[m[32m addv_I2(&drawPos,[m [32m+[m[32m draw_WrapText(&wrapText, highlight.font, drawPos, highlight.color)[m [32m+[m[32m .advance); /* lines end with \n */[m }[m markerRects[0] = marker.firstMarkRect;[m markerRects[1] = marker.lastMarkRect;[m [1mdiff --git a/src/ui/inputwidget.h b/src/ui/inputwidget.h[m [1mindex 817552ad..a2c5aa1e 100644[m [1m--- a/src/ui/inputwidget.h[m [1m+++ b/src/ui/inputwidget.h[m [36m@@ -32,14 +32,21 @@[m [menum iInputMode {[m overwrite_InputMode,[m };[m [m [31m-iDeclareType(InputWidgetContentPadding)[m [32m+[m[32miDeclareType(InputWidgetContentPadding);[m [32m+[m[32miDeclareType(InputWidgetHighlight);[m [m struct Impl_InputWidgetContentPadding {[m int left;[m int right;[m };[m [m [32m+[m[32mstruct Impl_InputWidgetHighlight {[m [32m+[m[32m int font;[m [32m+[m[32m int color;[m [32m+[m[32m};[m [32m+[m typedef void (*iInputWidgetValidatorFunc)(iInputWidget *, void *context);[m [32m+[m[32mtypedef iInputWidgetHighlight (*iInputWidgetHighlighterFunc)(const iInputWidget *, const iRangecc line, void *context);[m [m void setHint_InputWidget (iInputWidget *, const char *hintText);[m void setMode_InputWidget (iInputWidget *, enum iInputMode mode);[m [36m@@ -52,6 +59,7 @@[m [mvoid setFont_InputWidget (iInputWidget *, int fontId);[m void setContentPadding_InputWidget (iInputWidget *, int left, int right); /* only affects the text entry */[m void setLineLimits_InputWidget (iInputWidget *, int minLines, int maxLines);[m void setValidator_InputWidget (iInputWidget *, iInputWidgetValidatorFunc validator, void *context);[m [32m+[m[32mvoid setHighlighter_InputWidget (iInputWidget *, iInputWidgetHighlighterFunc highlighter, void *context);[m void setLineBreaksEnabled_InputWidget(iInputWidget *, iBool lineBreaksEnabled);[m void setEnterKeyEnabled_InputWidget (iInputWidget *, iBool enterKeyEnabled);[m void setOmitDefaultSchemeIfNarrow_InputWidget(iInputWidget *, iBool omitDefaultSchemeIfNarrow);[m [1mdiff --git a/src/ui/uploadwidget.c b/src/ui/uploadwidget.c[m [1mindex b04fa385..bef91d1f 100644[m [1m--- a/src/ui/uploadwidget.c[m [1m+++ b/src/ui/uploadwidget.c[m [36m@@ -201,6 +201,38 @@[m [mstatic void updateFieldWidths_UploadWidget(iUploadWidget *d) {[m }[m }[m [m [32m+[m[32mstatic int font_UploadWidget_(const iUploadWidget *d, enum iFontStyle style) {[m [32m+[m[32m iUnused(d);[m [32m+[m[32m static const int fontSizes_[4] = {[m [32m+[m[32m uiSmall_FontSize, uiNormal_FontSize, uiMedium_FontSize, uiBig_FontSize[m [32m+[m[32m };[m [32m+[m[32m return FONT_ID(monospace_FontId, style, fontSizes_[prefs_App()->editorZoomLevel]);[m [32m+[m[32m}[m [32m+[m [32m+[m[32mstatic iInputWidgetHighlight gemtextHighlighter_UploadWidget_(const iInputWidget *input,[m [32m+[m[32m iRangecc line, void *context) {[m [32m+[m[32m const iBool isFocused = isFocused_Widget(input);[m [32m+[m[32m iUploadWidget *d = context;[m [32m+[m[32m if (startsWith_Rangecc(line, "#")) {[m [32m+[m[32m return (iInputWidgetHighlight){ font_UploadWidget_(d, bold_FontStyle),[m [32m+[m[32m uiTextAction_ColorId };[m [32m+[m[32m }[m [32m+[m[32m if (startsWith_Rangecc(line, ">")) {[m [32m+[m[32m return (iInputWidgetHighlight){ font_UploadWidget_(d, italic_FontStyle),[m [32m+[m[32m uiTextStrong_ColorId };[m [32m+[m[32m }[m [32m+[m[32m if (startsWith_Rangecc(line, "* ")) {[m [32m+[m[32m return (iInputWidgetHighlight){ font_UploadWidget_(d, regular_FontStyle),[m [32m+[m[32m uiTextCaution_ColorId };[m [32m+[m[32m }[m [32m+[m[32m if (startsWith_Rangecc(line, "=>")) {[m [32m+[m[32m return (iInputWidgetHighlight){ font_UploadWidget_(d, regular_FontStyle),[m [32m+[m[32m uiTextAction_ColorId };[m [32m+[m[32m }[m [32m+[m[32m return (iInputWidgetHighlight){ font_UploadWidget_(d, regular_FontStyle),[m [32m+[m[32m isFocused ? uiInputTextFocused_ColorId : uiInputText_ColorId };[m [32m+[m[32m}[m [32m+[m void init_UploadWidget(iUploadWidget *d, enum iUploadProtocol protocol) {[m iWidget *w = as_Widget(d);[m init_Widget(w);[m [36m@@ -345,6 +377,9 @@[m [mvoid init_UploadWidget(iUploadWidget *d, enum iUploadProtocol protocol) {[m d->input = new_InputWidget(0);[m setId_Widget(as_Widget(d->input), "upload.text");[m setFixedSize_Widget(as_Widget(d->input), init_I2(120 * gap_UI * aspectRatio, -1));[m [32m+[m[32m if (prefs_App()->editorSyntaxHighlighting) {[m [32m+[m[32m setHighlighter_InputWidget(d->input, gemtextHighlighter_UploadWidget_, d);[m [32m+[m[32m }[m addChild_Widget(page, iClob(d->input));[m appendFramelessTabPage_Widget(d->tabs, iClob(page), "${heading.upload.text}", none_ColorId, '1', 0);[m }[m [36m@@ -392,7 +427,7 @@[m [mvoid init_UploadWidget(iUploadWidget *d, enum iUploadProtocol protocol) {[m updateFieldWidths_UploadWidget(d);[m setFocus_Widget(as_Widget(d->input));[m }[m [31m- setFont_InputWidget(d->input, FONT_ID(monospace_FontId, regular_FontStyle, uiSmall_FontSize));[m [32m+[m[32m setFont_InputWidget(d->input, font_UploadWidget_(d, regular_FontStyle));[m setUseReturnKeyBehavior_InputWidget(d->input, iFalse); /* traditional text editor */[m setLineLimits_InputWidget(d->input, 7, 20);[m setHint_InputWidget(d->input, "${hint.upload.text}");[m [36m@@ -758,6 +793,31 @@[m [mstatic iBool processEvent_UploadWidget_(iUploadWidget *d, const SDL_Event *ev) {[m refresh_Widget(as_Widget(d->input));[m }[m }[m [32m+[m[32m else if (isDesktop_Platform() &&[m [32m+[m[32m (equal_Command(cmd, "zoom.set") || equal_Command(cmd, "zoom.delta"))) {[m [32m+[m[32m int sizeIndex = prefs_App()->editorZoomLevel;[m [32m+[m[32m if (equal_Command(cmd, "zoom.set")) {[m [32m+[m[32m sizeIndex = 0;[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m sizeIndex += iSign(arg_Command(cmd));[m [32m+[m[32m sizeIndex = iClamp(sizeIndex, 0, 3);[m [32m+[m[32m }[m [32m+[m[32m setEditorZoomLevel_App(sizeIndex);[m [32m+[m[32m setFont_InputWidget(d->input, font_UploadWidget_(d, regular_FontStyle));[m [32m+[m[32m refresh_Widget(d->input);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m else if (isCommand_UserEvent(ev, "prefs.editor.highlight.changed")) {[m [32m+[m[32m if (arg_Command(command_UserEvent(ev))) {[m [32m+[m[32m setHighlighter_InputWidget(d->input, gemtextHighlighter_UploadWidget_, d);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m setHighlighter_InputWidget(d->input, NULL, NULL);[m [32m+[m[32m }[m [32m+[m[32m refresh_Widget(d->input);[m [32m+[m[32m return iFalse;[m [32m+[m[32m }[m else if (isCommand_Widget(w, ev, "upload.pickfile")) {[m #if defined (iPlatformAppleMobile) || defined (iPlatformAndroidMobile)[m if (hasLabel_Command(cmd, "path")) {[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex 446e443b..296d0280 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -2401,7 +2401,7 @@[m [miBool valueInputHandler_(iWidget *dlg, const char *cmd) {[m sizeIndex += iSign(arg_Command(cmd));[m sizeIndex = iClamp(sizeIndex, 0, 2);[m }[m [31m- ((iPrefs *) prefs_App())->inputZoomLevel = sizeIndex; /* const cast... */[m [32m+[m[32m setInputZoomLevel_App(sizeIndex);[m setFont_InputWidget(input,[m FONT_ID(default_FontId,[m regular_FontStyle,[m [36m@@ -2724,7 +2724,7 @@[m [mstatic iBool toggleHandler_(iWidget *d, const char *cmd) {[m if (equal_Command(cmd, "toggle") && pointer_Command(cmd) == d) {[m setToggle_Widget(d, (flags_Widget(d) & selected_WidgetFlag) == 0);[m postCommand_Widget(d,[m [31m- format_CStr("%s.changed arg:%d",[m [32m+[m[32m format_CStr("!%s.changed arg:%d",[m cstr_String(id_Widget(d)),[m isSelected_Widget(d) ? 1 : 0));[m return iTrue;[m [36m@@ -3533,6 +3533,8 @@[m [miWidget *makePreferences_Widget(void) {[m addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.ui}")));[m addFontButtons_(values, "ui");[m addDialogToggle_(headings, values, "${prefs.font.smooth}", "prefs.font.smooth");[m [32m+[m[32m addDialogPadding_(headings, values);[m [32m+[m[32m addDialogToggle_(headings, values, "${prefs.editor.highlight}", "prefs.editor.highlight");[m }[m }[m /* Page style. */ {[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex 384d5323..a4666c09 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -257,6 +257,9 @@[m [mstatic void aboutToBeDestroyed_Widget_(iWidget *d) {[m if (isHover_Widget(d)) {[m win->hover = NULL;[m }[m [32m+[m[32m if (win->focus == d) {[m [32m+[m[32m win->focus = NULL;[m [32m+[m[32m }[m if (win->lastHover == d) {[m win->lastHover = NULL;[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).