itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

TabRuns

Open claudiaareneee opened this issue 10 months ago • 5 comments

Description

This PR contains the following changes:

  • Creates a new type of run called TabRun
  • Associates the tab styling within TextStyleSettings
  • Adds tests for new run type
  • Adds a new geometry feature for debugging the ranges of individual text runs
  • Adds a isWhitespace method

Link to Issue

closes #7678

Screenshots

tabbing

claudiaareneee avatar Jun 17 '25 21:06 claudiaareneee

Your screenshot doesn't have any examples of consecutive tab stops - did you test those? Did you test lines containing only tab stops? Lines ending in tab stops? Did you test how tab stops behave with line wrapping?

pmconne avatar Jun 18 '25 14:06 pmconne

Did you test how layout behaves when you have a text block containing multiple tab runs where the style is overridden to specify different tab widths for different runs?

pmconne avatar Jun 18 '25 14:06 pmconne

@pmconne, I added tests and fixed some bugs. I ended up cleaning up the TextBlock.test.ts in the backend so the diff probably looks illegible now. For clarity, everything following 75b15bf is just whitespace and rearranging. If you want an easier to read diff since you last reviewed, checkout the commit here: ed98732

For reference, this is what the new organization looks like:

image

claudiaareneee avatar Jun 23 '25 19:06 claudiaareneee

That should be all the changes you requested. Let me know if I missed anything. I have three new test blocks:

  • applies tab shifts
  • applies consecutive tab shifts
  • wraps tabs

I did make changes to TextBlockLayout since you last viewed.

claudiaareneee avatar Jun 23 '25 19:06 claudiaareneee

Thanks for your patience @claudiaareneee - very nice PR!

pmconne avatar Jun 27 '25 09:06 pmconne