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

Support variable line heights in the editor #147067

Open
hediet opened this issue Apr 8, 2022 · 6 comments
Open

Support variable line heights in the editor #147067

hediet opened this issue Apr 8, 2022 · 6 comments
Assignees
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality
Milestone

Comments

@hediet
Copy link
Member

hediet commented Apr 8, 2022

This would allow to use larger font sizes for markdown headers.

@hediet hediet added feature-request Request for new features or functionality editor-core Editor basic functionality labels Apr 8, 2022
@hediet hediet added this to the April 2022 milestone Apr 8, 2022
@hediet hediet self-assigned this Apr 8, 2022
@hediet hediet modified the milestones: April 2022, May 2022 Apr 29, 2022
@usernamehw
Copy link
Contributor

@hediet Is this issue for TextMate grammar or editor decorations or both?

Grammar makes sense for markdown headers but editor decorations would be great too. For example, adding an image decoration (bigger than one line) without a webview (like code inset #85682).

@hediet
Copy link
Member Author

hediet commented May 5, 2022

It is not clear yet what mechanism will be used for that.

How would you add that image if you could set the line height? By using css?

@usernamehw
Copy link
Contributor

usernamehw commented May 5, 2022

It's already supported, the image is just very small (1 line).

In decoration options after.contentIconPath


Hmmm, actually it renders the full image ignoring width & height

window.activeTextEditor?.setDecorations(window.createTextEditorDecorationType({
	after: {
		contentIconPath: Uri.parse('https://random.imagecdn.app/500/150'),
		margin: '0 20ch',
		height: '2ch',
		width: '2ch',
	},
}), [new Range(0, 0, 0, 0)]);

@yume-chan
Copy link
Contributor

yume-chan commented May 11, 2022

Another use case would be shrinking empty lines #66468

Visual Studio has an extension (by Microsoft) to do that. https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.SyntacticLineCompression2022

@folcik
Copy link

folcik commented Mar 31, 2023

+1 on this
Decorations can already modify the font size/font family/line height of a portion of text, but none of those changes render properly without the line height being variable.
Use cases for this include:

  • Different font (size/family/height) for keywords or for searched text
  • Inline markdown editor/viewer
  • Inline images or icons
  • Increasing or reducing the size of font/lines that may be irrelevant (say, big function header comments can be slightly smaller if you want them to be less distracting, or TODO items could be larger or more apparent)
  • Could allow some very clever community extensions for "rich" editing (I understand this is not intended to be a rich text editor, but it is very close to being able to be one)

@MrScottyTay
Copy link

+1 Trying to migrate over to VS Code and the shrink empty lines extension for Visual Studio was amazing

@aiday-mar aiday-mar self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants