diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-09 09:16:52 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-09 09:16:52 -0700 |
commit | b7e8c2810a5008f68446ef62770ff2ec2c06a813 (patch) | |
tree | 6ffefd69cea31763fa2437634c538f84095afab0 /shell/primitives.mu | |
parent | 8cff44fef442bab0b6c75ac0ef1e3616c5149139 (diff) | |
download | mu-b7e8c2810a5008f68446ef62770ff2ec2c06a813.tar.gz |
snapshot: attempt at modifying a function name
It turns out there's another problem, and it predates the ability to create new definitions: ctrl-s triggers a call to `evaluate`, which inserts a new definition into globals. which has a null gap buffer. All this happens long before the new code in this commit, resulting in a null gap buffer by the time we get to word-at-cursor. Which in turn happens because we perform a raw `evaluate`, which doesn't update the gap buffer like `run` does (using `maybe-stash-gap-buffer-to-global`). And arguably `evaluate` shouldn't mess with the gap buffer. Gap buffers are a UI concern. The hardest version of this immediate scenario: It's unclear how to guarantee that every definition have a gap buffer, when two definitions may share one (closures sharing a lexical environment). New plan: - improve the logic for detecting definitions. Looking at the outermost layer isn't enough. And a single expression can create multiple definitions. - extract a helper to attach a single gap buffer to multiple definitions. - have the UI detect conflicts in gap buffers and prompt the user for a decision if a different gap buffer already exists for a definition.
Diffstat (limited to 'shell/primitives.mu')
0 files changed, 0 insertions, 0 deletions