Skip to content

refactor(run.lua): insert_commented works with piped expressions#504

Merged
jalvesaq merged 1 commit intomainfrom
feat/insert-commented-pipe-chain
Feb 9, 2026
Merged

refactor(run.lua): insert_commented works with piped expressions#504
jalvesaq merged 1 commit intomainfrom
feat/insert-commented-pipe-chain

Conversation

@PMassicotte
Copy link
Collaborator

Enhance the insert_commented function to handle multi-line code blocks by stripping comments and collapsing them into a single line. Improve cursor movement to the end of the chain for better user experience.

refactor(send.lua): modularize pipe chain extraction logic

Introduce get_pipe_node and get_pipe_chain functions to modularize the logic for extracting pipe chain nodes and code. This improves readability and maintainability. Add support for handling comments and cursor positioning within piped expressions.

Thank you to @guilhermegarcia for the initial implementation and the general idea.

Enhance the `insert_commented` function to handle multi-line code
blocks by stripping comments and collapsing them into a single line.
Improve cursor movement to the end of the chain for better user
experience.

refactor(send.lua): modularize pipe chain extraction logic

Introduce `get_pipe_node` and `get_pipe_chain` functions to modularize
the logic for extracting pipe chain nodes and code. This improves
readability and maintainability. Add support for handling comments
and cursor positioning within piped expressions.

Thank you to @guilhermegarcia for the initial implementation and the
general idea.

Co-authored-by: Guilherme D. Garcia <guilherme.garcia@lli.ulaval.ca>
@PMassicotte PMassicotte marked this pull request as ready for review February 9, 2026 17:31
@PMassicotte PMassicotte changed the title refactor(run.lua): improve comment stripping and code extraction logic refactor(run.lua): insert_commented works with piped expressions Feb 9, 2026
@jalvesaq
Copy link
Member

jalvesaq commented Feb 9, 2026

Thank you, @guilhermegarcia and @PMassicotte! In a quick test, it works!

@jalvesaq jalvesaq merged commit 659dc18 into main Feb 9, 2026
9 checks passed
@jalvesaq jalvesaq deleted the feat/insert-commented-pipe-chain branch February 9, 2026 18:59
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.

2 participants