-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make REPL prompt reflect current NS reliably #340
Conversation
If an evaluation changes the namespace the change is populated back.
CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ Changes to Calva. | |||
- [Support for custom project/workflow commands](https://github.com/BetterThanTomorrow/calva/issues/281) | |||
|
|||
## [Unreleased] | |||
- [REPL ns prompt does not change with (ns ..) form](https://github.com/BetterThanTomorrow/calva/issues/280) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should reflect what has happened with the change. So either something like what I renamed the PR to, or simply add the word ”Fix” in the beginning.
@@ -169,6 +169,10 @@ class REPLWindow { | |||
}) | |||
try { | |||
this.postMessage({ type: "repl-response", value: await this.evaluation.value, ns: this.ns = ns || this.evaluation.ns || this.ns }); | |||
if(this.evaluation.ns && this.ns != this.evaluation.ns) { | |||
// the evaluation changed the namespace so set the new namespace. | |||
this.setNamespace(this.evaluation.ns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. I have been figuring about this a bit, but obviously not enough to figure this fix out. Thanks!
Sweeet! |
This works like a charm. It's a bit late here, so I will merge tomorrow, when I am a bit less stupidly tired. 😄 |
Among fixes, this one is one of the nicest. It has bothered me a lot that I can't trust the prompt. |
If an evaluation changes the namespace the change is populated back to the REPL window.
This pull request:
Fixes #280.
Introduces the following change(s):
CANGELOG.md
as requestedcalva/repl-window.ts
REPLWindow.replEval()
method to populate a namespace change from the evaluation back to the repl window.(If you have considered alternative ways to introduce the change, replace this paragrah with a brief reasoning about why you made the choices you did. Otherwise just remove this paragraph.)
I have:
dev
branch. (Or have specific reasons to target some other branch.)master
. (Sorry for the nagging.)[Unrleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.Ping: @PEZ, @kstehn