Skip to content

fix: keep scratch eval working after ns forms, vibe, and go/future - #20

Merged
nooga merged 1 commit into
mainfrom
fix/scratch-eval-ns-and-goroutines
Sep 19, 2026
Merged

nooga merged 1 commit into
mainfrom
fix/scratch-eval-ns-and-goroutines

Conversation

@nooga

@nooga nooga commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • C-x C-e / C-j now eval in the buffer's (ns …) and restore the editor ns afterwards, so C-c C-e then @a sees foo/a instead of compiling in legmacs.main.
  • Intern vibe into let-go.core so (ns weather) does not make C-c C-v fail with "Can't resolve vibe".
  • Track scratch go/future spawns and capture *out*/*err* during eval so a background goroutine cannot freeze the UI or paint over the TTY.

Test plan

  • lg test/run.lg
  • In *scratch*: (ns foo) / (def a (atom 0)) via C-c C-e, then C-x C-e on @a prints => 0 (not "Can't resolve a")
  • (ns weather) then C-c C-v on (vibe "…") resolves vibe
  • C-x C-e (future (sleep 5000)) returns immediately; editor still takes keys
  • C-x C-e (go (println "hi")) does not clobber the frame; typing still works

Made with Cursor

C-c C-e restored the editor ns so C-x C-e missed buffer-local defs,
vibe vanished after (ns ...), and a scratch (go ...) parked the loop
on read-key while println wrote onto the TTY.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nooga
nooga merged commit babcbd9 into main Sep 19, 2026
1 check passed
@nooga
nooga deleted the fix/scratch-eval-ns-and-goroutines branch September 19, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant