Conversation
c7be8dd to
90b4eee
Compare
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5922 +/- ##
==========================================
+ Coverage 93.73% 93.95% +0.21%
==========================================
Files 641 647 +6
Lines 138167 140305 +2138
Branches 14561 14706 +145
==========================================
+ Hits 129510 131820 +2310
+ Misses 8657 8485 -172
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
1 similar comment
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
… calculations # Conflicts: # src/virtual_renderer.js
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
There was a problem hiding this comment.
Nice work, this is awesome!
I built #5988 on an earlier snapshot of this branch, so below are a few things I hit while testing grapheme/bidi edge cases against real browser measurements. Most are small and cherry-pickable from #5988. Details inline.
Once this merges I'd like us to review and maybe do a follow-up PR picking up the rest of #5988: the grapheme-cluster model (Intl.Segmenter-based helpers in lib/lang, cluster-snapping moveCursorTo, cluster-aware $getDisplayTokens/$computeWrapSplits, $alignTokensToClusters). It touches the same code this PR rewrites, so rebasing it on top of merged master is cleaner than growing this PR's scope. With the current branch a wrap limit crossing 👨👩👧👦 still splits its 11 code units across screen rows, and moveCursorTo only snaps surrogate pairs, not ZWJ/combining-mark clusters; the follow-up addresses #460, #4142, #5431, #4602, #3753, #3866, #3617.
| maxDistance = d; | ||
| } | ||
| } | ||
| if (blockCursor) { |
There was a problem hiding this comment.
if (blockCursor) { // TODO } is a no-op, so vim block-cursor mode gets round-to-nearest instead of floor semantics. Either implement or drop the branch and note the limitation.
|
|
||
| var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * | ||
| this.config.lineHeight; | ||
| var cursorWidth = this.config.fontMetrics.textWidth(pos.row, pos.column + 1) - textWidth; |
There was a problem hiding this comment.
If textWidth(col+1) and textWidth(col) measure equal (zero-width cluster tail, or a measurement fallback), cursorWidth is 0 and the cursor becomes invisible. Suggest (... - textWidth) || this.config.characterWidth.
| this.updateBidiMap(); | ||
| } | ||
| return this.bidiMap.bidiLevels; | ||
| return true; |
There was a problem hiding this comment.
isBidiRow now returns true for every row once the document contains any bidi character. One Hebrew word in a 10k-line file routes every marker on every line through drawBidiSingleLineMarker → getRects → DOM range measurement. A cheap per-line bidiRE.test(line) here would keep the fast path for the 99% of lines that aren't bidi.
There was a problem hiding this comment.
The problem is that when calling isBidiRow we only have screenLine, so finding the line is quite expensive. drawBidiSingleLineMarker on the other hand is not very slow, so we end up with similar performance in both cases.
| if (useFontMetrics && this.$desiredColumn == null) { | ||
| offsetX = fontMetrics.textWidth(screenPos.row, screenPos.column); | ||
| if (isFinite(offsetX)) | ||
| this.$desiredColumn = offsetX / fontMetrics.config.characterWidth; |
There was a problem hiding this comment.
$desiredColumn now stores a fractional pixel-derived value (offsetX / characterWidth). When the target row isn't rendered, $pixelToColumn returns it unchanged and a non-integer column flows into screenToDocumentPosition. It works in the cases I tested, but rounding the fallback would keep the column contract integer-valued.
There was a problem hiding this comment.
I think we should allow fractional screenColumn for reasons similar to screenRow, also because fractional screenColumns were allowed in the old implementation of varchar https://github.com/ajaxorg/ace/blob/master/src/edit_session.js#L2507C19-L2507C34
| } | ||
|
|
||
| var rowCount = 10; | ||
| var rowCount = 5.5; |
There was a problem hiding this comment.
rowCount = 5.5 looks like a leftover from testing fractional row heights; intentional?
There was a problem hiding this comment.
fractional row heights were intentional, without that all linewidgets are forced to have heights in multtiples of line height, and our api doesn't enforce that.
| } | ||
|
|
||
| /** | ||
| * Calculates the width of the text up to a specific scrrenColumn on a given screen row. |
There was a problem hiding this comment.
nit: typo, scrrenColumn (also ends up in the generated types/ace-modules.d.ts)
| var m0 = 0.7, m1 = 0.1, m2 = 0.3, m3 = 0.82; | ||
| var t1 = 100, t2 = 20; | ||
| function testTransform() { | ||
| fontMetrics.config.$transformData = null; //FIXME |
| * @related EditSession.documentToScreenPosition | ||
| **/ | ||
| screenToDocumentPosition(screenRow: number, screenColumn: number, offsetX?: number): Point; | ||
| screenToDocumentPosition(screenRow: number, screenColumn: number): Point; |
There was a problem hiding this comment.
This is a public API break: screenToDocumentPosition loses its documented offsetX param, and BidiHandler loses getPosLeft/getSelections/offsetToCol/updateCharacterWidths. Embedders calling these will break at runtime, not just in types. Probably fine given the old bidi pixel model is gone, but worth a changelog note and a decision on whether this ships as a minor or major bump.
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
|
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Open kitchen-sink @ c7be8dd97af41183600195164d17e00f387c23f6
Open kitchen-sink @ 90b4eee66710148337aee06de5ad6e46df0b347f
Open kitchen-sink @ 5a08e666570cde601c49a89c3cf7ee66d32ba8de
Open kitchen-sink @ bed04381bebaa0464636dbed3dbd1c95e6edc99e
Open kitchen-sink @ 2de603755db99236770c3d1d096aac6583f4e8bf
Open kitchen-sink @ 6138c2d3378fc9b489a279145fc98be977233005
Open kitchen-sink @ d7b2cdd7cb12149184fd7f0f0475cc2f846773c1
Open kitchen-sink @ a99a4870bb7d2ec8e7d16cba766645c75e0d713c
Open kitchen-sink @ 60ce0b14fe5032b4fd5789871fa578a652d72fa5
Open kitchen-sink @ 33d1040444586512d70f0d4c28302e94879cf2da
Open kitchen-sink @ 0e9e8bec27cd3677fc50a77343426c4e7bd09a39
Open kitchen-sink @ fca477cbaef5a4f1917382eeed2fd300ac928c60
Open kitchen-sink @ c6c9f87a587d99fb015adf3c905339d16bc54ee0
Open kitchen-sink @ 32ae297abead042c6680563f46b8e10dcb6483ec
Open kitchen-sink @ 40e5bdc846720749cb5392b96a1181744b87c3bb
Open kitchen-sink @ 8f9018cdcadd14972e6cd8d2c6aa0c6a1ba25aeb
Open kitchen-sink @ 8105fe2f6937b345a923c92a95c461dc3e51e11b
Open kitchen-sink @ bd38fd5337efe5242de0ff6edaaa75fa75e8ec5c