Skip to content

Commit

Permalink
Merge pull request #2654 from BetterThanTomorrow/2653-snippet-ns
Browse files Browse the repository at this point in the history
Fixes #2653
  • Loading branch information
PEZ authored Oct 21, 2024
2 parents de2b759 + 2c78d7e commit 4f45c5f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Changes to Calva.

## [Unreleased]
- Fix: [Only the first environment variable is resolved in jackInEnvironment](https://github.com/BetterThanTomorrow/calva/issues/2650)

- Fix: [Custom command snippets use the wrong ns when repl sessions types do not match](https://github.com/BetterThanTomorrow/calva/issues/2653)
- Fix: [ns inner blocks are kept on the same line by default when using the clean ns command](https://github.com/BetterThanTomorrow/calva/issues/2648)

## [2.0.479] - 2024-10-01
Expand Down
6 changes: 5 additions & 1 deletion bundled/drams-menu/drams-dev.edn
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
{:title "Create a mini Clojure project",
:src "https://raw.githubusercontent.com/BetterThanTomorrow/dram/dev/drams/v2/mini",
:extraDetail "Starts a REPL, requires Java",
:description "A quick way to Fire up a Clojure REPL"}]
:description "A quick way to Fire up a Clojure REPL"}
{:title "Create a mini shadow-cljs Fullstack project",
:src "https://raw.githubusercontent.com/BetterThanTomorrow/dram/dev/drams/v2/mini_shadow_fullstack",
:extraDetail "Starts a REPL, requires Java",
:description "From Thomas Helller's Fullstack Workflow with shadow-cljs"}]
6 changes: 5 additions & 1 deletion bundled/drams-menu/drams-published.edn
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
{:title "Create a mini Clojure project",
:src "https://raw.githubusercontent.com/BetterThanTomorrow/dram/published/drams/v2/mini",
:extraDetail "Starts a REPL, requires Java",
:description "A quick way to Fire up a Clojure REPL"}]
:description "A quick way to Fire up a Clojure REPL"}
{:title "Create a mini shadow-cljs Fullstack project",
:src "https://raw.githubusercontent.com/BetterThanTomorrow/dram/published/drams/v2/mini_shadow_fullstack",
:extraDetail "Starts a REPL, requires Java",
:description "From Thomas Helller's Fullstack Workflow with shadow-cljs"}]
3 changes: 2 additions & 1 deletion src/custom-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ async function evaluateCodeOrKeyOrSnippet(codeOrKeyOrSnippet?: string | SnippetD
? codeOrKeyOrSnippet
: await getSnippetDefinition(codeOrKeyOrSnippet as string, editorNS, editorRepl);

snippetDefinition.ns = snippetDefinition.ns ?? editorNS;
snippetDefinition.repl = snippetDefinition.repl ?? editorRepl;
snippetDefinition.ns =
snippetDefinition.ns ?? (editorRepl === snippetDefinition.repl ? editorNS : undefined);
snippetDefinition.evaluationSendCodeToOutputWindow =
snippetDefinition.evaluationSendCodeToOutputWindow ?? true;

Expand Down

0 comments on commit 4f45c5f

Please sign in to comment.