[general]
name=RTL Expression Editor
qgisMinimumVersion=4.0
qgisMaximumVersion=4.99
description=Fixes right-to-left (Hebrew and Arabic) text rendering in the Expression Builder and allows custom autocomplete sources.
about=QGIS's built-in editor (QScintilla) does not display right-to-left text correctly, especially when RTL and left-to-right text are mixed. Glyphs overlap and the text cursor jumps to the wrong place, which makes Hebrew or Arabic expressions and layer filters hard to read and almost impossible to edit.

    This plugin places an enhanced editor directly above the original one. The enhanced editor renders mixed RTL and LTR text correctly while staying fully sync-hronized with the original editor beneath it, so all existing QGIS functionality keeps working: the field, function and operator tools, validation, value previews and syntax highlighting. Matching brackets are highlighted as well. Nothing in QGIS is modified or replaced.

    The plugin also offers an optional advanced auto-complete system. Choose any table or dataset - picked straight from the QGIS Browser, without adding it to your project - and its fields as the source of allowed values, with optional descriptions, groups and group descriptions. Press Ctrl+Space to complete either a field name or a value, and the suggestions adapt automatically to the field being queried and to the layer you are working on.

    When a custom auto-complete source is configured, an optional Read Mode switch appears inside the editor. Read Mode shows the value descriptions instead of the stored codes, making a long expression far easier tounderstand, and never alters the expression itself. Where the same code has different meanings in different groups, Read Mode works out the right one automatically from the expression's own surrounding condition (e.g. "F_CODE" = 2300 AND "F_ATT" = 603), using an optional Group codes column - nothing about this is ever saved to the project. An optional second, alternative description per value adds a third switch position for a different wording of the same descriptions.

    The whole configuration, including the auto-complete source, can be exported to a file and imported again elsewhere - useful for sharing a ready-made setup with colleagues.
version=1.6
author=Jossef Kanter
email=jossefkan@gmail.com

tracker=https://github.com/GallPeters/rtl-expression-editor
repository=https://github.com/GallPeters/rtl-expression-editor

# Optional metadata
tags=rtl,hebrew,arabic,expression,filter,editor,expression 
homepage=https://github.com/GallPeters/rtl-expression-editor
icon=icon.png
experimental=False
deprecated=False
hasProcessingProvider=no
server=False

** v1.6 (26.08.2026):
  - Changed: the autocomplete lookup table is now picked straight from the QGIS Browser as a dataset, instead of being chosen from - and needing to be added to - the project's own layers. It is read directly from its own source and is never added to the project, so it no longer appears in the Layers panel or gets saved into the project file. A configuration saved by an earlier version is upgraded automatically the first time it is used.
  - Changed: Read mode now works out a code with several meanings directly from the expression's own surrounding group condition (e.g. "F_CODE" = 2300 AND "F_ATT" = 603, using the Group codes column) instead of remembering a choice you picked - showing every meaning only when that context is missing or ambiguous. A surrounding AND joins the two into one group correctly; a surrounding OR (or two AND-runs split by one) keeps them apart, exactly as the expression itself does.
  - Removed: saving a picked description to the project file, and the "Clear & Scan" / "Reset Legacy Entries" Settings buttons that maintained it - nothing about Read mode is ever saved to the project any more.
  - Added: any such entry left behind by an earlier version is removed automatically the first time the plugin activates.

** v1.5 (19.08.2026):
  - Added: suggestion-list titles with optional Table/Field description columns (also shown in Read mode); an optional Alternative value description, giving Read mode a third switch position; Export/Import Settings as a JSON file.
  - Added: "Clear & Scan" and "Reset Legacy Entries" buttons in a new "Maintenance" group in Settings, alongside Run Tests, to clean up remembered value/description choices no longer in use.
  - Improved: the Edit/Read mode switch is now a real slider; the Settings window is resizable with detailed tooltips; Run Tests stays responsive and never touches your open project.
  - Fixed: a Hebrew description could reverse an expression's left-to-right layout in Read mode; remembered choices now stay in sync with edits and with layer removal instead of only accumulating; copying or cutting an expression could leak a hidden internal tracking id onto the clipboard.

** v1.4 (12.08.2026):
  - Added: Ctrl+Space (and automatic suggestions while typing) for fields, functions, variables and values, with signatures and help - works even without a configured lookup table.
  - Added: a function helper showing the name and arguments while typing inside a call, with the current argument highlighted, following the caret and the window.
  - Added: whole-word occurrence highlighting, including while using Find; Enter/Shift+Enter in the Ctrl+H replace bar to replace one or all occurrences; a setting for how many values are suggested without a lookup table.
  - Added: a full test suite, plus a "Run Tests" button in Settings for development checkouts.
  - Improved: the suggestion list is grouped like the Expression Builder's own categories and shows functions by name only; the suggestion list and function helper sit clear of the text instead of overlapping it.
  - Fixed: a crash that could break autocomplete, duplicated quotes on accepting a suggestion, duplicate scrollbars, a suggestion-list flash on Linux, the function helper getting stuck on screen or the suggestion list closing the whole window instead of itself, and Enter in the Ctrl+H replace field sometimes replacing every occurrence instead of just the current one.

** v1.3 (10.08.2026):
  - Improved: the suggestion list now shows values without their surrounding quotes.
  - Improved: clearer labels in the settings window, with required options listed first.
  - Improved: read mode and the suggestion list now show values without surrounding quotes
  - Fixed: read mode now handles code and description columns whose values include quotes.
  - Fixed transparent background issue in the editor.

** v1.2 (06.08.2026):
  - Added: a Settings dialog with an enable/disable switch.
  - Added: optional autocomplete from project layer values.
  - Added: Read mode to display value descriptions instead of codes.
  - Added: project-specific storage for custom value descriptions.

** v1.1 (03.08.2026):
  - Added: RTL window now follows the original window's position and size.
  - Added: syntax highlighting.
  - Fixed: Removed the Apply and Cancel buttons.

** v1.0 (26.07.2026):
  - Initial release.
