Repository navigation
v0.11.4
0.11.4 (2026-11-26)
🐛 Bug Fixes
- editor: scroll by one line when typing at the edge; trackpad, knob and document switch (#30) (f7d0eb3)
Release notes
Typing past the edge of the window scrolls by one line instead of half a screen, trackpad scrolling no longer fights the bounce at the ends of a document, the scroll bar knob shows where you are and no longer moves backwards, and switching to a shorter document no longer freezes the app.
Fixed
Typing and moving the caret past the edge
- Return and typing on the last visible line — pressing Return on the last visible line, or typing until that line wrapped, moved the view by half a screen (213 pt and 192 pt in a 382 pt editor). The view now moves by just the line that left the screen (24 pt). The same goes for Hangul composition that wraps the line and for deleting at the head of the first visible line (it jumped 130–183 pt). Right after a very long line too: Return at the end of a 26,000-character line that ends on the bottom line moved the content by 202 pt and now moves it by one line.
- Return one line above the bottom — it jumped by 189 pt although the new line fitted on the screen. The view no longer moves.
- With word wrap off — there the arrow keys jumped as well: ↓ or Return on the bottom line and ↑ or Backspace on the top line moved the view by half a screen (192 pt of 382). They now move it by one line. Sideways, the view follows a caret that crosses the left edge by as much as it crossed, and brings a caret that crosses the right edge to the middle of the visible width, as before. A selection that an edit leaves behind — a snippet placeholder, a clause of an input method — is brought into view whole when it fits, and a horizontal scroll bar that appears while the view follows the caret no longer covers the caret's line.
- After a large paste — the caret could end up just outside the window: 182 pt below it after pasting 600 lines into the middle of a 1.3 MB note. The editor now checks once more, after the layout has settled, that the caret is on screen.
- Replaying a macro — the view followed the caret after every step of a replay; it now follows once per screen update and once at the end. A hundred runs of a 10-step macro on a 1.2 MB document take about 0.65 s (0.72–0.74 s before).
- Gutter width when the line count gains or loses a digit — the line-number gutter took its new width one layout pass after the edit. In a window completely covered by other windows that pass did not come, and the gutter's frame stayed at the old width (69 pt for a 62 pt gutter after going from 10,000 to 9,999 lines) until something else laid the window out. The width is now set together with the edit.
- Typing costs the same as before.
Trackpad
- Bounce at the ends — swiping past the end of a document with a trackpad made the text jump back by 16–82 pt on every frame of the bounce and left the view 5–71 pt short of the end, with the last line cut off. At the top it came to rest 5–19 pt below the first line. The view now stretches once and comes back to exactly the end.
- Typing while the view is coasting — typing or pressing an arrow key during the momentum of a swipe brought the caret into view, and the rest of the momentum then carried the view away again; the typed text ended up 1,375 pt off screen. When the gesture ends, the caret is brought back into view.
Scroll bar knob
- Knob moving the wrong way — while wheeling down through a 1.3 MB note the knob went backwards on 95 of 250 steps (by up to 14.6 pt on a 382 pt track), and after Go to Line it sat 2–4 % away from where that line is in the document. The knob is now placed by line: the same screen always gives the same position and it moves only the way you scroll. In the same run the largest backward move is 0.9 pt, and the lines at a quarter, half and three quarters of the document put the knob at 0.2499, 0.5000 and 0.7502.
- Dragging the knob — dragging the knob past the top of the track did not reach the first line (it stopped about 40,000 pt short in the 1.3 MB note); it does now. The same drag distance moves the same number of lines wherever you are, and dragging down and back up by the same amount returns to where you started.
- The markers in the strip at the right edge use the same scale as the knob, so the markers of the lines on screen lie within the knob.
Switching documents
- Switching from the end of a long document to a shorter one — opening a file, or switching to a tab, whose document is shorter than the place you were looking at in the previous one made the editor lay out the whole new document: 17.5 s for a 12,002-line JSON file opened from the end of a 24,000-line file. Large edits in that document were slow afterwards as well (Format JSON 3.1 s instead of 150 ms). The switch now takes 160 ms and Format JSON 166 ms. With a split editor it makes no difference which of the two editors was at the end.
- A file rewritten shorter by another program — while you looked at the end of a 24,002-line JSON file and it was rewritten with 12,002 lines, reading it again took 16.2 s and the next Format JSON 3.2 s. They now take 272 ms and 147 ms. A file that grows — a log being appended to — stays where you were reading, as before, and so does a reload while you read the middle of the file.
- The other editor of a split during a whole-document edit — when one editor of a split replaced the document (Select All and then a tool or a paste, or the undo or redo of that), the other editor kept its scroll offset while every height estimate changed: in a 24,000-line document it slid from line 12,002 to line 11,541, and from the end to 2,275 lines above it. It now stays on its line, and an editor that was showing the end stays at the end.
Known limitations
- An edit that sends the caret more than a screen away (a large paste), typing on the last line of the document, undo, find jumps and Go to Line still bring the caret's line to the middle of the window, as before.
- With several carets, typing while one of them is above the visible part of the document can still shift the text slightly (4–33 pt at once): TextKit re-estimates the heights above the screen after such an edit.
- The caret comes back when the momentum has ended, not at once: macOS offers no public way to stop its momentum scrolling.
- A paragraph that wraps over several lines counts as one line, so the knob moves more slowly through a stretch of long paragraphs.
- With word wrap off, or while anything is folded, the knob is placed as before.
- A wheel step larger than the window (800 pt in a 382 pt editor) that falls on the step where TextKit discards its layout cache can still move the text 22–61 lines backwards; the knob follows the text.
For contributors
insertText,setMarkedTextand theinsert…/delete…commands mark the reveal they cause (editRevealDepth), andscrollRangeToVisiblethen uses the minimal reveal of the arrow keys (revealCaretStep(afterEdit:)) — in both wrap modes; with wrap off the sideways position is settled right after it. Right after an edit the edited paragraph is back to an estimated height, so the caret line measured 24 pt lower than it is, and laying fragments out with.ensuresLayoutdoes not correct the positions below.caretLineAfterEditadds up the real heights from the edited paragraph to the caret's.- That sum is used only when the edit starts inside the laid-out viewport. From a second caret above the screen, in text that was never laid out, the caret line came out 295–1,900 pt off and typing one character threw the view up to 2,052 pt away; such edits are left to AppKit.
- It covers up to 64 paragraphs. Beyond that — and, for an edit that replaces the document, when a paragraph over the huge-paragraph limit lies on the way — the edit is left to AppKit and the caret is checked again on the next turn (
revealCaretAfterRelayout). An edit that starts on screen measures such a paragraph as well: it is laid out for drawing anyway, and skipping it handed Return right after a 26,000-character line back to AppKit's centring (202 pt instead of 24). Measuring far edits with a viewport layout walked the whole document after a whole-document edit (Toggle Comment on 1.3 MB went from 150 ms to 1.4 s) — a regression that the typing and scrolling scenarios did not show and the self-test'sperflines did. Whole-document edits keep the first ordinary paragraphs of the edit laid out, which is what stops the next layout pass from walking the document. - After a reveal the editor handled itself, the sideways position is settled for the caret, for the end of the selection an arrow key moved, or — after an edit — for the whole selection from its end back to its start. The visible height is read again on every pass of that reveal: with always-visible scrollers a horizontal scroller can appear in the middle of it and make the view 17 pt shorter.
- The gutter learned that the line count had gained or lost a digit while drawing and only then asked its container for a layout, so its frame followed one pass late — and a window that is fully covered has no display cycle of its own to run that pass.
updateThickness()is now called fromtextDidChange, and for the other editor of a split when the edit is passed on to it.typing-10000-lineschecks the width in the turn of the edit, before anything is drawn, and the frame after one layout pass, so it does not depend on whether the window is visible. - During a macro replay
scrollRangeToVisibledoes nothing;MacroRecordercallsrevealCaretAfterReplayStepsbefore each yield to the run loop and at the end. Inside one run-loop turn the paragraphs edited earlier are back at estimated heights, so following on every step scrolled to a wrong place, laid the viewport out and scrolled back (844–880 ms for the hundred runs before this change). - Real-use scenarios in
RealUse+ScrollEdge.swift:typing-edge-bottom,-top,-end,-cost,-huge-line,-nowrap,-multicaret,typing-big-tools,-long-head,-redo,typing-macro-costandtyping-paste-empty;nowrap-snippetandnowrap-legacy-scrollerinRealUse+NoWrap.swift.typing-macro-costcompares the replay with the same 1,000 steps sent one by one in the same run, because absolute times move with the load of the machine.typing-big-tools-redorecords that undo and redo of a whole-document tool are slow in the edit itself (5.3 s for Toggle Comment on 1.3 MB): the screen settles within 3 ms, so it is not a scrolling cost. - The editor pulls the scroll position back into the document after layout, except during a trackpad gesture. It asked on every live-scroll notification whether
NSApp.currentEventwas a phased scroll event; that is true for the first one only — the later ones come from the block that synchronizes responsive scrolling with the main thread, where there is no current event. The gesture is now recognized once, inwillStartLiveScroll, and remembered until it ends (liveScrollIsGesture). HyperTextView.liveScrollDidEndrepeats a reveal of the caret that was requested during the gesture, if the caret line is not visible by then. The request lives only inside that gesture: it is dropped when the next live scroll starts and when the document is replaced — a knob drag sends the live-scroll notifications too, and a request left over from a gesture that never reported its end snapped the view back to the caret. Only reveals of the caret count; restoring a tab's reading place goes throughscrollToReadingPlace, which says so, because its range can coincide with the caret (a tab left at the start of its document).- The harness can now produce trackpad gestures. Handed to
scrollWheel(with:)one by one, everything after the first phased event is ignored and the scroll view stays in a live scroll; posting the whole finger phase (began → changed… → ended) to the app's own event queue withNSApp.postEventworks — AppKit's tracker takes the queued events and then runs its own momentum and rubber-band in real time. The momentum check lets a frame carry what the frame before it fell short of, but only when that frame took more than one and a half periods and the clip view carried the catch-up as well: a late frame tends to follow a heavy layout pass, which is also where coordinates get re-estimated, so an unconditional allowance could cover a real jump. - Synthetic wheel events must not carry the modifier keys the user happens to hold. The harness builds them with a
CGEventthat has no source, and such an event takes the modifier keys that are down at that moment; AppKit turns a line wheel event that carries Shift into a horizontal scroll (deltaX −1, deltaY 0), so the notch moves nothing vertically. The flags are now cleared when the event is made. This fits the notches that moved nothing inscroll-line-wheel— one or a few in a row, only for line events, with the previous release's editor code as well, and in none of 44 runs while nobody was typing — but it could not be shown directly, since that needs someone to hold Shift during a run. For a notch that still does not move the view the scenario records the live-scroll notifications that arrived, whether the movement came within two seconds, whether the window was occluded and which modifier keys were down. - Real-use scenarios
scroll-trackpad-swipe,-ends,-interrupt,-longand-stale-reveal(RealUse+Trackpad.swift): 16 issues before, none after. EditorScrollViewandEditorScroller(Editor/EditorScrollView.swift).NSScrollViewplaces the knob at scroll position ÷ (document height − visible height), but the TextKit 2 document height is an estimate that is revised on every viewport layout — early in a session it swung between 847,845 and 1,157,051 pt for a note about 700,000 pt tall. The knob value is now the paragraphs above the screen divided by those above plus those below, read from the laid-out viewport and the live line index; a drag is translated back the same way (scrollToLineValue). Two traps: a scroller'senclosingScrollViewis nil, and anNSScrollersubclass must overrideisCompatibleWithOverlayScrollersto keep the overlay style.- A knob drag sends the live-scroll start and end notifications like any other scroll. The line-based drag is taken with overlay and with always-visible scrollers, and typing does not make an overlay scroller appear although the knob value changes with the line count.
- Real-use scenarios
scroll-knob-drag,scroll-knob-positionandscroll-knob-state(RealUse+ScrollKnob.swift), with a time budget per drag step and a limit on content going backwards;scroll-knobwent from 2 issues to none. - The text is replaced in place when a document comes in, but the scroll position is still the previous one. Past the end of a shorter document, the first layout pass lays out the viewport there and TextKit 2 walks every paragraph from the top (see the notes on reflowing at the end of a document); the rendering attributes it leaves on every paragraph then make the spell checker walk them on each large edit. This is what failed the self-test check
format JSON on 1.3 MB is not a hang. - Another document:
HyperTextView.leaveScrollPositionForNewDocumentputs the view at the start just before the text changes — where the document changes its address, the place that also forgets the measured no-wrap width. It must not hang on the storage's "whole text edited" notification: Fold All and Unfold All report that too, and Unfold All threw the view to the top of the document in the first attempt. The reading position is restored right after, as before. - The same file read again keeps its position, so the view only notes a wholesale replacement that happens away from the top (
contentReplacedBeforeLayout) and, before the next layout pass, asks the layout manager where the document ends and steps inside if it is past it — the probe the reading anchor uses. No frame is drawn between the probe and the restore. - A whole-document edit made in one editor of a split is a wholesale replacement for the other one as well. Its place is remembered by line before the edit — paragraph number and column,
captureReadingPlace— and restored after it with the reading anchor (settleReadingPlace), which also runs the past-the-end probe; an editor that was at the end is pinned to the end. For undo and redo every editor of the split remembers its own place, and the one that follows the caret is left alone. The place is restored once more on the next turn, because the syntax-colour revalidation can invalidate the whole document again by then. Sitting at the end, the other editor could also lay out the whole document (23,878 fragments, and an undo of 7.2 s instead of 5.6 s); leaving its probe unarmed made it do just that (2,254 ms to settle). - Real-use scenarios
layout-switch-shorter,layout-switch-shorter-split,layout-split-sibling-toolandlayout-reload-shorter(RealUse+Layout.swift).layout-split-sibling-toolruns comment, undo, redo and uncomment with the other editor in the middle and at the end.
Compatibility
- macOS 15 (Sequoia) or later. The DMG (
HyperEdit-<version>-universal.dmg) contains one universal binary that runs natively on Apple Silicon (arm64) and Intel (x86_64) Macs.
Downloads
| Asset | Contents |
|---|---|
| HyperEdit-0.11.4-universal.dmg | macOS app, universal binary — Apple Silicon (arm64) and Intel (x86_64), macOS 15 or later, Developer ID signed and notarized |
| SHA256SUMS | Checksum of the DMG — verify with shasum -a 256 -c SHA256SUMS |
| hyperedit-themes.json | The 22 HyperEdit palettes as Zed themes |
Install
- Homebrew:
brew tap Hyeongcheol-An/tap, thenbrew trust Hyeongcheol-An/tap(Homebrew 7+ refuses casks from an untrusted third-party tap; older Homebrew has no such command, skip it), thenbrew install --cask hyperedit. Upgrade withbrew upgrade --cask hyperedit. - DMG: open the DMG and drag
HyperEdit.apptoApplications. The app opens without Gatekeeper warnings.