Skip to main content

· 3 min read
Jefferson Gonzalez

A patch release that includes some nice fixes and additions!

In the past, the code responsible for file system monitoring automatically unwatched/watched files when an event was received. This behavior was disabled because it caused indefinite signaling of events, which increased CPU usage in the autoreload plugin that needs to monitor files independently. However, this behavior is actually necessary for backends like inotify, where a file would get automatically unwatched if it was removed, only to be re-added later. One example of this occurs when performing a git checkout <branch>, which removes and re-adds files that contain changes, causing a file to be unwatched by inotify. This release restores the previous behavior and fixes the endless signaling of file system events, resulting in a better functioning autoreload plugin.

note

The unwatched/watched behavior wouldn't be necessary if the DirMonitor implementation also reported the type of event, such as deletion, addition, modification, etc. However, until that is implemented (if it ever is), we will continue to re-watch on file system monitoring backends that may require it.

In the scaling random wars, we now keep the DEFAULT_SCALE always updated, even if auto-detection of scaling is disabled. This ensures that when enabling auto-detection on a running editor instance, it will use the correct system scale. Additionally, for Linux users, we have added code to prefer the Wayland video backend by default if the system is running on Wayland. This should result in crisper output on non-native scales, while the Xwayland backend may lead to blurry rendering.

In the Windows frontend, we added a pragtical.com wrapper around pragtical.exe, which is compiled in console mode. This enhancement improves the experience of using the editor's CLI interface from CMD or PowerShell, as these environments prioritize .com binaries over .exe files:

Other changes include:

  • Making the latency reduction feature toggleable (in case you want to reduce some CPU usage).
  • Fixes to the JavaScript syntax embedded HTML support (which was matching elements that weren't embedded HTML).
  • Plus other fixes and changes...

Downloads on GitHub.

Changes Log

Fixes

  • Check valid line state on retokenization check (#186)

  • Fix language_js embedded html matching (#187)

  • Fix DirWatch check duplication on multiple mode (#197)

Enhancements

  • Make the input latency reduction toggleable (#188)

  • Always keep default scale updated on scale changes (#190)

  • Use wayland by default if possible on linux (#191)

  • CLI subcommands: allow skipping invalid arguments (#192)

  • Restore DirWatch unwatch/watch behavior (#193)

  • Fully move autoreload cleanup from co to Doc:on_close (#194)

  • Add a .exe to .com console wrapper on windows (#199)

Lite XL Merged Changes

  • api/system: make stat() call consistent across platforms (#195)

  • treeview: remove unused code (#1895)

· 3 min read
Jefferson Gonzalez

A new week and a new release with fixes and performance improvements!

Over the past few days, various people have helped by reporting issues on the GitHub issue tracker, and this release tackles some of them. One prominent change is the improvement in the way that coroutines are scheduled, resulting in overall better responsiveness and performance of the editor, an improvement that would not have been possible without the testing of AmerM137.

Also, while working on a not-yet-finished C++ native tokenizer (to see if we gain some better performance), I found that the utf8.len function accepts a lax parameter that allows calculating the length of the string without checking if it is invalid UTF-8 (we don't need this check since we are passing clean UTF-8 text to the tokenizer). Using this flag on the Lua tokenizer calls of ulen gives us over a 75% time reduction in the per-line tokenization process.

Another area that has seen improvements is in the startup and memory usage departments. We changed how the settings plugin deals with the global status of the scrollbar to not depend on a coroutine. In the memory department, we modified various core plugins that make use of weak document table keys to clear the content of these tables immediately after a document is closed. This change should result in the garbage collector kicking in sooner for cleanup of unused memory.

This release also introduces AppImage and Portable ARM64 Linux builds of the editor for people working on those platforms, as suggested by jvoisin.

For plugin developers, we introduced two new functions to deal with ignore files: core.get_ignore_file_rules() and common.match_ignore_rule(path, info, ignore_rules). Also, the editor version was aligned with the mod version, meaning that they are now the same.

Some other changes include:

  • Proper updates to the NoteBook widget on tab change.
  • Better DPI runtime awareness on Windows (special thanks to LeDominik, who performed macOS scale testing on previous releases, resulting in today's improvements).
  • Fixes to the regex C API that allow it to work properly on macOS ARM64 (reported by dilpreetsio).
  • Better borderless behavior when clicking window action buttons.
  • Fixes to window size restoration on startup.
  • Improvements to the findfile and projectsearch plugins in handling ignore files.

A big THANK YOU to everyone who reports issues!

Downloads on GitHub.

Changes Log

Performance Improvements

  • Lower input latency improving co-routine scheduling and tokenizer (#174)

  • Reduce the amount of co-routines needed on startup (#176)

  • Document lax param and use on tokenizer ulen calls (#183)

Enhancements

  • Added PerMonitor dpi awareness to windows manifest (#158)

  • Don't trust weak table keys to clean cached items (#164)

API

  • Introduce new ignore files handling functions (#177)

  • Use project version as mods version (#184)

Fixes

  • Fix issues with window size restoration (spotted on Windows) (#162)

  • IPC Plugin: restore current project working dir (#167)

  • If all documents are closed chdir to root project (#168)

  • findfile: use project when resolving file path (#169)

  • Fix regex api wrong value set to regex.ENDANCHORED (#170)

  • regex api: use proper type for options parameter (#171)

  • Do not maximize window on macOS at startup (#175)

  • Process TitleView button actions on mouse release (#178)

Build System

  • Add Linux AArch64 build target to CI (#157)

  • CI: Properly enable ccache for linux builds (#161)

Widgets

  • Allow scheduling core updates and redraws (a2637c37)

Lite XL Inherited Changes

  • DocView: check token_count not 0 (#1879)

  • Added in keyboard shortcut tooltips. (#1880)

  • Add primary selection support (#1729)

· 2 min read
Jefferson Gonzalez

This is a SCALE bug fix release! Release explanation slightly adapted from #152

Since new renwindow api (that allows initializing windows directly in Lua) the main window creation was moved to core.init but, the scale detection code was still been performed before. This meant that loading the default system style was using the incorrect scale causing issues that would only be resolved by manually re-scaling the interface.

Previously, tried to wrongly fix the issue by delegating the responsibility to the scale plugin but that wasn't the correct solution (didn't notice what explained on first paragraph until later 😓). Now we defer style loading until main window is created and the default system scale properly detected, this ensures that the correct scale is set before performing any style calculations that rely on it.

Now besides updating scale on the displaychanged event it also updates it when the window is resized, but we limited the amount of scale checks on resize to prevent crashes on X11.

Hopefully these changes finally tackle the scale issues 😄

Downloads on GitHub.

Changes Log

Fixes

  • Adjust scale retrieveal on startup (#152)

  • When scale changes rescale item sizes on LogView (#154)

  • Updated widgets to latest with smaller rescale fix (#155)

  • Rescale the EmptyView icons font on instantiation (#156)

· 2 min read
Jefferson Gonzalez

This release fixes various issues reported on GitHub, and introduces some new features and enhacements. The big ticket for this release is overall better scaling behaviour. macOS builds now default to the plain software renderer which is faster. This is possible because various releases ago (almost a year?) we introduced functionality to detect the display scale at runtime, meaning that scaling should be properly performed Lua side instead of relying on the renderer. The SDL Renderer (aka "hardware renderer") is still available but since the glyph loading optimizations, it needs some adjustments to better handle the positions and sizes of fonts when the scale is >= 2.

So, this release improves upon previous scaling code work and fixes some related issues. Finally, widgets now behave better when the scale changes.

Thanks to everyone who reported issues and helped with testing!

Downloads on GitHub.

Changes Log

New Features

  • Add cli flag to allow forking editor to background (#132)

  • Scale plugin: added commands and bindings to allow zooming/scaling the code independently of the user interface. (#150)

Performance Improvements

  • Widgets: moved most calculations out of update to specialized update_size_position function that gets called mostly only when neccesary. Also improved widgets size/position calculations for better scaling. (#9)

Enhancements

  • Patched some luajit functions to support unicode file names and strings on windows (#138)

  • Always select first result on findfile plugin (#141)

Fixes

  • Use PRAGTICAL_USERDIR instead of HOME on scripts/run-local because XDG_CONFIG_HOME been set has priority over HOME. (#133)

  • Fix scaling logic regressions, now macOS builds are configure by default with the software renderer since current display scale is detected at startup and applied on the whole interface, also the plain software renderer is faster. (#134)

  • Return actual scale on system.get_scale() for macOS too (#143)

  • Minor correction on search_ui replace button position (#149)

Build System

  • Fix rolling builds staying as draft (a0d062f5)

  • Remove widget submodule in favor of subproject (#148)

· One min read
Jefferson Gonzalez

This release includes the accumulated dose of fixes, some performance improvements and enhacements as listed on the changes log.

Downloads on GitHub.

Changes Log

Performance Improvements

  • Revert previous optimized glyphset loading lite-xl/lite-xl#1543 and rebased/merged new implementation which is even faster (lite-xl/lite-xl#1845)

  • Port rest of regex functions from Lua to C (#120)

Enhancements

  • Enable utf8 module for Lua < 5.3 using utf8extra (#119)

  • Use core.warn on autocomplete plugin (89d24eb4)

  • Improvements to c/c++ language plugins (#128)

Fixes

  • Fix thread initialization on non macOS bundle (#118)

  • Fix use of no longer valid core.add_project_directory (#121)

  • Fix for IPC plugin to properly open a relative path (#125)

Build System

  • Fix PPM build on msys (#126)

  • Update sdl2 wrap to v2.30.6 which fixes an initialization issue on hyprland. Also updated other wrap components. (#127)

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.4.1...v3.4.2

· One min read
Jefferson Gonzalez

This quick minor release introduces some more enhancements and fixes for annoyances found while testing other stuff, most of them are triggered in some edge cases but still, they were causing an itch 😄

Some nice additions are: better restoration of window size on startup which was causing me headaches on wayland, support for autocompletion of preprocessor symbols on C/C++ and fallback detection of UTF-16/32 when no encoding was detected.

Downloads on GitHub.

Changes Log

Fixes

  • If no surface return on font_render_glyph (#114)

  • Restore support for tokenizer empty matches with subsyntax (#111)

  • If encoding detect fails check if UTF-16/32 LE/BE (#115)

Enhancements

  • Better matching of placeholder chars (_) on lua (#112)

  • Better restore of window mode/size on startup (#113)

  • Added custom symbols pattern to language c and cpp (#116)

  • autocomplete: strip punctuations from partials (#117)

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.4.0...v3.4.1

· 3 min read
Jefferson Gonzalez

After two months finally a release with the accumulated sum of new features, fixes and enhancements!

One notable change is the DocView cache for better performance on files with really long lines, which previously caused the editor to hang when plugins like drawwhitespace, colorpreview or selectionhighlight were enabled.

Also, this release introduces code that moves window management from C to Lua, which breaks most system.{*window*} functions. Updating the following plugins will be necessary for a smooth transition:

  • centerdoc
  • opacity
  • lsp

Downloads on GitHub.

Changes Log

New Features

  • Add ui config to toggle the treeview toolbar (#84)

  • Support multiple projects on the findfile plugin (#100)

  • Multiproject handling for statusview doc:file (#101)

  • Introductory window creation and management using Lua (#108)

Performance Improvements

  • Basic doc/docview cache for better performance (#105)

Fixes

  • CLI: lowercase the appname on usage description (#92)

  • Mark common.serializeoptions fields as optional (#95)

  • Render the statusview message on demand (#103)

  • Check doc is still in view before autoreloading it (#104)

  • Handle conversion of \ to ¥ as reported on #94 (#106)

  • Support for utf-8 text reduction on node title (#107)

Enhancements

  • Add /usr/local/bin, /usr/local/sbin to PATH on Mac OS X (#87)

  • Assign ctrl+, binding to open user module command (#88)

  • Update JetBrains Mono font to latest version 2.304 (#91)

  • Auto chdir to project depending on active document (#93)

  • Improvements to core.visited_files handling (#96)

Workarounds

  • Disable assert on font resizing to allow fonts scanning. (#89)

Build System

  • Changes to msys build on rolling release workflow (d5811328)

  • Various maintainance changes to github workflows

Widgets

  • Use correct path separator on FilePicker widget (1347e8c3)

  • Update for lua window management (#7)

Lite XL Inherited Changes

  • build: fix dirmonitor backend selection (#1790)

  • api/system: fix newlines returned by get_clipboard (#1788)

  • Change co_wait to co_await in language_cpp (#1800)

  • build: fix dirmonitor backend selection (#1790)

  • Handle static constexpr in language_cpp (#1806)

  • improve number highlighting for c (#1752)

  • language_cpp: backport number highlighting from c (#1818)

  • Add support for binary integer literals. (#1819)

  • Update language_python.lua (#1723)

  • rootview: workaround macos weird dnd event timing

  • Expand Process API (#1757)

  • fix(dirmonitor): avoid calling the change callback multiple times in the same notification (#1824)

  • core/rootview: fix dnd multiple folders into dock (#1828)

  • fix(doc): convert Doc:merge_cursors parameter from "selection index" to table index

  • core/doc: fix wrong table index in Doc:merge_cursors

  • Keep font scale updated for RENDERER backend

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.3.1...v3.4.0

· 2 min read
Jefferson Gonzalez

This release consist mostly of editor and build system bug fixes with some minor new features and enhancements.

Downloads on GitHub.

Changes Log

New Features

  • settings ui: added max_visible_commands config (#79)

Fixes

  • Fixes to autocomplete re-sizing code (#76)

  • Fix conflicting goto jump on tokenizer which was introduced by the skipping of patterns matching nothing code. (b2d03264)

Enhancements

  • Renamed numpad insert key from 'ins' to 'insert' and empty 5 to 'clear' (#73)

  • Added TextEditor category on linux (#77)

  • plugin language_lua: added unescaped [=string=] support (#78)

  • Alert by default of file changes in autoreload plugin (#82)

Build System

  • Build the plugin manager statically for msys (#80)

  • Fix for mbedtls2 detection on ppm subproject (abc2d93f)

  • Meson subproject updates (6f5ab121)

Lite XL Inherited Changes

  • Improve autocomplete scroll behavior (#1732)

  • Fix language_js regex/comment distinction (#1731)

  • scripts: not hardcode MSYSTEM (#1739)

  • Add SerenityOS platform support (#1745)

  • Limit language_js regex avoidance to numbers, and fix starting /* comments (#1744)

  • Fixed some typos in core.init (#1755)

  • Added Arduino syntax highlighting support alongside C++. (#1767)

  • Fix BufferSize in g_read for Windows (#1722)

  • Skip patterns matching nothing in tokenizer (#1743)

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.3.0...v3.3.1

· One min read
Jefferson Gonzalez

Prominent changes on this release include: adaptive sizing of autocomplete box, TreeView horizontal scrollbar support, TreeList widget and performance improvements.

TreeList Widget for LSP Symbols

symbols-treeview

Adaptive Sizing Autocomplete

Downloads on GitHub.

Changes Log

API

  • Expose renderer.font.get_metadata() as a method, documented it, etc... (#64)

  • Expose get_partial_symbol on autocomplete plugin (for LSP) (#66)

  • Increase mod version from 3.3.1 to 3.4.0 (also because of new system.setenv) (#68)

Fixes

  • Fix modversion matching to align with semver (#71)

Enhancements

  • Enable horizontal scrollbar on treeview plugin (#63)

  • Added adaptive sizing to autocomplete plugin (#67)

Build System

  • Removed no longer needed microtar subproject (#70)

Widgets

  • Optimize SearchReplaceList collapse/uncollapse (#4)

  • FontDialog: use the font metadata preview text if available (#5)

  • Added new TreeList widget (#6)

Performance Improvements

  • Merged: glyphset loading optimization for faster font loading (#1543)

Lite XL Inherited Changes

  • process: fix unitialized variables (#1719)

  • Added .pyi extension to python. (#1728)

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.2.2...v3.3.0

· 2 min read
Jefferson Gonzalez

Some of the changes for this release include: drops findfileimproved plugin merging the threading functionality directly into findfile plugin, introduces code that respects config.file_size_limit on various components of the editor and updates SDL2 meson wrap to latest.

It also incorporates various bug fixes both from upstream and our side.

Downloads on GitHub.

Changes Log

Fixes

  • Fix project module sometimes not loading. (#54)

  • Correct the runtime environment variable (#55)

  • Use unique GUID for the inno setup installer (#58)

  • Null check file_info on core.open_doc (4418bb6c)

Enhancements

  • Merge findfileimproved into findfile plugin and made the loading text update smoother. (#53)

  • Update thread initialization code to match main (#56)

  • Update macOS icons to be more close to apple guidelines (#57)

  • Limit max bytes read when detecting file encoding (#59)

  • Respect config.file_size_limit on some components (#60)

Lite XL Inherited Changes

  • Fix doc:create-cursor-previous/next-line with tabs (#1697)

  • Memory fixes (#1705)

  • Improve number highlighting for python syntax highlighting (#1704)

  • reorder nagview options on doc:save error to be more consistent with other nagview confirmations (#1696)

  • autoreload docs only if their filename matches an actual file (#1698)

  • language_js: support binary and octal representation (#1710)

  • process: style changes (#1709)

  • Add system.setenv (#1706)

Full Changelog: https://github.com/pragtical/pragtical/compare/v3.2.1...v3.2.2