This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
introduce numberOfRecentlyConfirmedCommandsShowsAtTop #103
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.
Description of the Change
Fix #18
There is already PR #86, #87.
This PR somewhat takeover of #86.
Introduce new configuration
numberOfRecentlyConfirmedCommandsShowsAtTop
(default 0).When set to greater than 0, it shows specified number of recently confirmed commands at top of list.
So user can simply confirm last confirmed item by "
cmd-shift-p
thenenter
".Why I send this PR when there is already similar PRs in the queue is, I think this PR's implementation is more straightforward in implementation(just move recent items to top of command array on
show()
timing).Why invalidation of cached element is important
If we return cached element for item which is moved to top of list, it breaks at here.
https://github.com/atom/atom-select-list/blob/ee325e75833acc84af9f9c90aed30157e1816f36/src/select-list-view.js#L449
atom-select-list#ListItemView::update()
does directly manipulate DOM element byreplaceChild
which assumethis.element
is stable at position in<ol>
.Alternate Designs
#86, #87
Benefits
Described in #18.
When user want to invoke last confirmed again, it's possible by just "
cmd-shift-p
thenenter
" workflow.Possible Drawbacks
None.
Applicable Issues
#18