feat: show_hints — opt out of the hint chrome - #5
Merged
Merged
Conversation
Closes #4. The ⟪neocursor · <Tab> accept⟫ label and the ⟪<Tab> → L42⟫ prediction pill are discoverability aids; once you know the keys they are just noise in the buffer. `show_hints` turns them off without touching suggestions. show_hints = false -- hide both show_hints = { edit = false } -- hide the label, keep the jump pill The invariant this has to preserve: hint chrome is display-only. It is easy to break, because show_prediction() both paints the pill and returns the boolean that gates jumping at four call sites — suppressing the paint by returning false would silently disable <Tab> jumps. The paint is now conditional; the return value is not. Covered two ways: test/hints_spec.lua asserts the render layer (label present or absent, diff body byte-identical either way, pill namespace isolation) and normalization; flow_spec.lua now reruns its full behavioral suite under NEOCURSOR_SPEC_NO_HINTS=1, so jump/accept/chain are proven identical with the chrome gone. Both wired into CI on all three platforms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4.
@scc02 asked for a way to hide the
⟪neocursor · <Tab> jump⟫label while keeping the suggestion itself. This addsshow_hints, using the exact API shape proposed in the issue.Two surfaces, and they aren't equally safe to hide
edit⟪neocursor · <Tab> accept⟫prediction⟪<Tab> → L42⟫falsehides both, since that's the least surprising reading of the option name. The table form keeps the pill for anyone who wants the label gone but still wants to see where<Tab>will land. The README documents the tradeoff rather than hiding it.The trap
show_prediction()does double duty — it paints the pill and returns the boolean that gates jumping at four call sites (init.lua358, 398, 814, 956).The obvious implementation (return
falsewhen hints are off) renders correctly and silently disables<Tab>jumping. So: the paint is conditional, the return value is not.Verification
Two independent angles, both in CI on ubuntu/windows/macos:
test/hints_spec.lua(new, 16 assertions) — label present/absent, diff body byte-identical either way, prediction-pill namespace isolation, all 7 normalization cases.test/flow_spec.luanow reruns its entire 20-assertion behavioral suite underNEOCURSOR_SPEC_NO_HINTS=1.Tab jumps to predicted lineandprediction consumed by jumppass with zero chrome — that's the regression that would otherwise ship silently.:NeocursorDebugprints the resolved setting.Note
M._normalize_hintsis exposed (underscore-prefixed, internal) so the spec can test the pure normalizer without spawning a sidecar.