marimo icon indicating copy to clipboard operation
marimo copied to clipboard

improve: Move highlighted code to newly created cells

Open wasimxyz opened this issue 1 year ago • 6 comments

📝 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

wasimxyz avatar Oct 03 '24 05:10 wasimxyz

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

vercel[bot] avatar Oct 03 '24 05:10 vercel[bot]

@akshayka Good catch thanks!

wasimxyz avatar Oct 03 '24 06:10 wasimxyz

@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)

mscolnick avatar Oct 03 '24 13:10 mscolnick

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.)

wasimxyz avatar Oct 04 '24 05:10 wasimxyz

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?

mscolnick avatar Oct 04 '24 11:10 mscolnick

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!

wasimxyz avatar Oct 05 '24 04:10 wasimxyz

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.9.2-dev17

github-actions[bot] avatar Oct 06 '24 01:10 github-actions[bot]