Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Helix Selection Renderer in Markdown (.multicursor file type) #12706

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

nik-rev
Copy link
Contributor

@nik-rev nik-rev commented Jan 27, 2025

This PR adds support for rendering Helix selections in markdown components:

`copy_selection_on_prev_line`

Copies the current primary selection to the first previous line long enough to accomodate it.

# Examples

The selection is copied from line 2 to line 1.

Before:

```multicursor
This is text #[|on line 1]#.
This is text on line 2.
```

Command: `C`

After:

```multicursor
This is text #(|on line 1)#.
This is text #[|on line 2]#.
```

Renders as:

image

It'll nicely complement #997 when that gets merged.

Here is the kind of workflow I'm envisioning:

  • All Helix help files will be written in markdown, using these blocks.
  • The :help completer will show these Helix selections when you press tab to go see different commands. You'll be able to access the documentation on each command just by holding tab
  • We'll also use this to generate integration tests that automatically run. So imagine this, you write documentation for a Helix command but you also the documentation won't become outdated because it's automatically tested
  • We can then turn these files into HTML to render on the website (like what was my dream from the beginning 😎 )

This PR just implements the renderer. The other stuff can be added in a different PR :-)

Tracked by #12714

@nik-rev nik-rev changed the title feat: Helix markdown selection renderer feat: Helix Selection Renderer (in Markdown) Jan 27, 2025
@nik-rev nik-rev changed the title feat: Helix Selection Renderer (in Markdown) feat: Helix Selection Renderer Jan 28, 2025
@nik-rev nik-rev changed the title feat: Helix Selection Renderer feat: Helix Selection Renderer in Markdown (.multicursor file type) Jan 28, 2025
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