Repository navigation
feat(tui): edit a widget's label with e - #666
Open
eric-engberg wants to merge 2 commits into
Open
eric-engberg wants to merge 2 commits into
eric-engberg wants to merge 2 commits into
Conversation
The label editor opened with b (la(b)el…). Custom Text, Custom Command, Custom Symbol and Link already open their text editors with e, so the line editor's "edit this widget's text" key differed by widget. Labels now use e too, shown as (e)dit label…, which also reads more plainly. None of the widgets that bind e has a label, so e is free wherever the label editor appears; the existing check that labeled widgets leave the label key unbound now runs against e.
The label key moved to e, but one sentence still said b is hidden while raw value is on.
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.
What
The line editor's label editor (#601) opens with
e, shown as(e)dit label…, instead ofb(la(b)el…).Why
ealready means "edit this widget's text" in the line editor:e(e)dit texte(e)dit cmde(e)dit symbole(e)dit textbla(b)el…e(e)dit label…Editing a label is the same kind of action, so one key covers both.
(e)dit label…also reads more plainly thanla(b)el…, whose mnemonic letter sits mid-word.l, the other natural choice, stays out of it for the reason the code already gave: the reset timers bind(l)ocale.How
LABEL_KEYBINDinraw-or-labeled.tsis nowe, with the label(e)dit label….ehas a label, soeis free wherever the label editor appears. The existing test that every widget declaring a label prefix leaves the label key unbound, in every mode, now runs againsteand passes.(label: "…")row note don't change.docs/USAGE.mdlists the new key in both places it mentions the label key.Demo
The line editor on a Custom Text, then Model, which is relabeled to
M. Before, Custom Text edits withebut Model's label opens withb; after, both usee. The model name is the TUI's sample.Before (Powerline)
After (Powerline)
Before (plain)
After (plain)
Testing
raw-or-labeled.test.ts: a new test that the label keybind ise/(e)dit label….ItemsEditor.test.ts: the label editor tests presseand look for(e)dit label….widgets.test.ts: the check that labeled widgets leave the label key free picks upewithout changes.bun testgives 2777 pass, 0 fail (Bun 1.4.2).bun run lintis clean. A 12-run loop ofItemsEditor.test.tshad no failures.main(with docs: explain an empty status line in one folder (workspace trust) #606 and feat(git-is-fork): render forks as an editable glyph #617): merging it in is clean,bun run lintis clean andbun testgives 2783 pass, 0 fail. No widget added since bindse.