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

Provide a means to auto-determine the height of CH.Code blocks with focus #258

Closed
zentol opened this issue Aug 4, 2022 · 3 comments · Fixed by #262
Closed

Provide a means to auto-determine the height of CH.Code blocks with focus #258

zentol opened this issue Aug 4, 2022 · 3 comments · Fixed by #262

Comments

@zentol
Copy link

zentol commented Aug 4, 2022

When embedding a file the only way to only show a part of the file is to use focus and manually specific a height.

While this works perfectly fine, it is quite brittle as changes to the focused area requires re-adjustments of the height, and it's also a bit tedious.

It would be nice if there'd be a way for CH to auto-determine the height to show everything in focus, or a sort-of heightPerLine setting that could be set in the configuration.

@pomber
Copy link
Contributor

pomber commented Aug 5, 2022

Yes, that's something I want to add.

What do you thing about a linesOfHeight option?

```js foo.js linesOfHeight=12
// from ./a-long-file.js
```

It could also work for focused lines:

```js foo.js linesOfHeight=focus
// from ./a-long-file.js
```

@zentol
Copy link
Author

zentol commented Aug 5, 2022

Do I understand things correctly that linesOfHeight=12 displays exactly 12 lines, and linesOfHeight=focus displays all lines between the first&last focused line?
If so, then that sounds great.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

🚀 Issue was released in v0.7.3 🚀

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 a pull request may close this issue.

2 participants