improve: Move highlighted code to newly created cells
📝 Summary
Implements #2474.
🔍 Description of Changes
When a new cell is created, any highlighted code is cut from the original cell and pasted into the new cell.
📋 Checklist
- [x] I have read the contributor guidelines.
- [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
- [x] I have added tests for the changes made.
- [x] I have run the code and verified that it works as expected.
📜 Reviewers
@akshayka OR @mscolnick
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| marimo-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 5, 2024 10:40pm |
| marimo-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 5, 2024 10:40pm |
@akshayka Good catch thanks!
@wasimsandhu - can you verify this works with SQL and markdown? We probably have to do something similar to splitEditor. could we also write a test similar to splitEditor(utils.test.ts) and splitCell (cells.test.ts)
can you verify this works with SQL and markdown?
When editing a SQL/markdown cell and triggering a create new cell above/below (via button or shortcut), a Python cell is created. Do we want to change this behavior so that a cell of the same type is created? (This makes sense to me.)
When editing a SQL/markdown cell and triggering a create new cell above/below (via button or shortcut), a Python cell is created. Do we want to change this behavior so that a cell of the same type is created? (This makes sense to me.)
This might take some getting used to. I would keep it python for new cells, but keep the same language for "yanked" cells. thoughts? is that weird ux?
This might take some getting used to. I would keep it python for new cells, but keep the same language for "yanked" cells.
Works for me!
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.9.2-dev17