Fix so code can be run after creating terminal #567
Fix so code can be run after creating terminal #567Ikuyadeu merged 2 commits intoREditorSupport:masterfrom
Conversation
Even when terminal was successfully created, success was undefined and so chooseTerminal would return undefined. Since failure to create a terminal should result in rTerm being undefined, it should be safe to ignore success and always return rTerm.
|
@renkun-ken Thanks for the review! I was about to merge this but looking at the recent commit history there seem to be fewer merge commits than there used to be. Are we favouring 'Squash and merge' over 'Create a merge commit'? |
|
All recent PRs were merged with "Squash and merge". @Ikuyadeu Do we have a preference on this? I'm totally ok with both if the PR is clean and short. |
|
@andycraig Thank you for your great work. @renkun-ken Thank you for your every review and discussion.
I agree with you. It depends on the reviewers' feelings.
Additionally, like this PR, @andycraig 's two commits have separated works. |
|
@Ikuyadeu @renkun-ken Thanks both! |
Fixes #563
Fixes #483
What problem did you solve?
Trying to create a terminal and run code at the same time results in a new terminal but does not run the code. The user has to run the command again to send the code to the terminal. This PR fixes that.
The problem was that even when terminal was successfully created,
successwasundefinedand sochooseTerminalwould always returnundefined. Since failure to create a terminal should result inrTermbeingundefinedanyway, it should be safe to removesuccessand always returnrTerm.How can I check this pull request?
temp.Rcontaining the codex <- 1R: Always Use Active TerminalR: Run Selection/Line. Observe that a new R terminal is created and thatx <- 1is sent to that terminalR: Run Source. Observe that a new a new R terminal is created and thatsource(...)is sent to that terminalR: Rterm Linux/Mac/Windowsto a nonsense path like 'abc'R: Run Selection/Line. Observe appropriate error message 'Cannot find R client ...'Note
This is the output I get when using
R: Run Selection/Line. Note the doubledx <- 1. I could avoid that by increasing the delay amount but the amount required is presumably going to vary according to how fast the user's PC is. I've left it as-is for now. We could add a setting if it bothers people.