Repository navigation
Open file in pending state on single click - #10178
Conversation
Add event methods for 'did-confirm-pending-state'.
Check if isPending function exists on item before invoking.
Only destroy active item if it is not the same as the new item.
Revert to original code to conform to specs.
|
I like this better, too. Nice work. Looks like you still need to thread the option through |
|
To me "confirm pending state" means that one is confirming that it is pending ... rather than making a pending item not-pending or confirmed. I feel like the term "pending" is causing a naming issue. Is there a reason we can't use the terms "temporary" and "permanent"? (I realize that "pending" came along with the original code, but I can't find the original discussion around the terminology.) I'm totally 👍 on the API though. Well designed. |
|
Now that all the methods are on the pane item itself rather than on the pane, maybe something like |
|
|
Now it is called onDidTerminatePendingState.
Test not yet passing. ::insertText is not triggering terminatePendingState. Not sure why...
|
Thanks for the feedback and great suggestions for improving the nomenclature! I changed the code to use "terminate" rather than "confirm".
No need to make any changes to Workspace::open, it's already set up to handle the Added a few tests. The test for modifying the buffer isn't passing because for some reason using |
It's an async event... the clock is mocked in the global environment and you should be able to use |
|
What happens if I single click, then double click a file in the tree view? |
|
Doh! Async, of course... I'm curious to know what you're not stoked about @nathansobo... is there a better way you know of? I tried using it "should terminate pending state when buffer is changed", ->
events = []
editor1.onDidTerminatePendingState (event) -> events.push(event)
expect(editor1.isPending()).toBe true
editor1.insertText('I\'ll be back!')
waits 500
runs ->
expect(editor1.isPending()).toBe false
expect(events).toEqual [editor1]I've seen I'd imagine that ideally there be a way that doesn't require hardcoding a somewhat arbitrary amount of time to wait or speed up the clock... Anyhow, using |
|
Single-clicking and then double-clicking a file in tree view should work as expected - single click opens the file in a pending state, and a subsequent double-click terminates the pending state. (Note that for the double-click the first click re-opens the file as pending and the second click terminates the pending state) You can view a test verifying this here Also note that single-clicking a file that is already open does not put the file back in pending state. |
👍 |
|
Last commit is superficial change. Merging. Congrats @kuychaco on landing your first PR on atom/atom! |
Open file in pending state on single click
|
Congratulations! 🎉 |
|
Note to self: Defer linting on preview tabs |
|
Is there any config to disable preview tabs? Existing config was removed in |
|
Not yet, though we plan to add one and patch it into 1.6 beta |
Addresses issue #9165
Single-clicking on a file in tree-view or on a search result from find-in-project opens a 'pending tab'.
See corresponding pull requests for tree-view and tabs packages: