Skip to content

Fix ToggleSuperscript/ToggleSubscript having no effect and ToggleList numbering from 0 - #3

Open
burque505 wants to merge 2 commits into
ellipticbit:masterfrom
burque505:burque505
Open

burque505 wants to merge 2 commits into
ellipticbit:masterfrom
burque505:burque505

Conversation

@burque505

Copy link
Copy Markdown

Pull request

Fixes #ISSUE1
Fixes #ISSUE2

Changes (RichEditorNET/RichEditBox.cs)

  • ToggleSuperscript / ToggleSubscript: clear the other flag before setting the new one. RichEdit clears both together, so the previous order undid the change.
  • ToggleList: set ListStart = 1 when applying a list style, as HtmlFormatter already does when loading lists.

Tests

The PR adds TestScripts/FormattingTests.cs, a .NET 10 file-based app with 19 checks:

  • superscript/subscript on, off and switching between them, including the Html output;
  • each ListStyle applied and removed, checking the numbering RichEdit displays (read with GetText2(tomIncludeNumbering)).
dotnet run TestScripts/FormattingTests.cs

The editor is never shown. The exit code is the number of failed checks.

  • On a342245 (before this PR): 13 passed, 6 failed
  • With this PR: 19 passed, 0 failed

The script is not part of RichEditorNET.slnx and isn't compiled by any project, so the package build and CI are unaffected. If you'd rather not have it in the repo, or would prefer it as a test project, I'm happy to change or drop it.

dotnet build RichEditorNET.slnx -c Release succeeds for both net8.0-windows and net48.

LLM disclosure

This contribution was made with Claude Code (Anthropic's Claude Opus 5.5 model). As the contributing guidelines require, the full prompts from the session are below.

Context: prompts 1–2 were about my own scripts, which run WinForms code from AutoHotkey. The bugs turned up while building the API showcase requested in prompt 3. The fix and test were written in response to prompts 7 and 8.

  1. I'm trying to adapt Program.cs to run using Csx-in-AHK. I believe I am close but the form will not show. Please analyze and debug.

  2. Please create rte_ex2.ahk, using Csharp-in-AHK instead of Csx-in-AHK, modifying and cloning the needed .cs files as required. Please do no overwrite existing files.

  3. I will now get more ambitious. Please examine the API at https://github.com/ellipticbit/RichEditorNET. Create a .cs file that will run from Csharp-in-AHK, with an AHK script rte_showcase.ahk that will run it, demonstrating all the API calls available.

  4. (sent while prompt 3 was in progress, reporting an error from one of the assistant's test scripts)

    Keep getting this error:
    Error: Target control not found.
    
    Specifically: RICHEDIT50W1
    
    	006: WinActivate(T)
    	007: FileAppend("active=" WinActive(T) "
    ", "*")
    ▶	008: ControlFocus("RICHEDIT50W1", T)
    	009: Send("{Alt down}f{Alt up}")
    	010: Sleep(600)
    
    Show call stack »
    
  5. The HTML comes back very nicely. Now I will get more ambitious. I have forked the RichEditorNET repo and added a burque505 branch. Please tell me what to do submit the workarounds and issues you found to the project owners. First I should clone the burque505 repo and checkout the burque505 branch, but I don't know how to do that - please advise.

  6. Should I open the newly created folder?

  7. It is cloned, please make the two fixes and test them.

  8. If adding your test script to the repo won't break anything, please add it upstream, and please write the two GitHub issues and PR description, including the required prompts section.

🤖 Generated with Claude Code

burque505 and others added 2 commits October 11, 2026 08:37
…leList

A .NET 10 file-based app (dotnet run TestScripts/FormattingTests.cs) that is
not part of the solution, so the package build and CI are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant