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

Stretchy spaces? #3471

Open
lougreenwood opened this issue Apr 28, 2021 · 1 comment
Open

Stretchy spaces? #3471

lougreenwood opened this issue Apr 28, 2021 · 1 comment
Labels
A-editor-component Area: Editor component/UI A-font Area: Font loading and rendering enhancement New feature or request

Comments

@lougreenwood
Copy link

lougreenwood commented Apr 28, 2021

One of my favourite viscose addons is called stretchy spaces - it allows re-defining how much space a indentation-space takes up, kinda like the customisability of tabs, but in a codebase using spaces.

I've tried to manually install this add-on from the vscode marketplace (it's not on open VSX), and as expected, it doesn't work (it's quite niche and affects the rendered code, so I didn't expect it would work at this stage in the development of Onivim 2).

However, I did wonder if there would be any interest in supporting this kind of feature, essentially, allowing a single space of indentation to be displayed as indentation of an arbitrary number of spaces. For example, the code base I work on is 2 space indent, but I much prefer 4 space and I can handle that in VSCode without bothering my teammates. However, since switching to onivim 2 full time, I've lost this feature 😢

WDYT? Could this type of add-on (technically) eventually be supported, if not, could this make sense as a native feature? :)

@lougreenwood lougreenwood changed the title Stretchy spaces Stretchy spaces? Apr 28, 2021
@bryphe bryphe added A-editor-component Area: Editor component/UI A-font Area: Font loading and rendering enhancement New feature or request labels May 4, 2021
@bryphe
Copy link
Member

bryphe commented May 4, 2021

Thanks for logging the issue @lougreenwood !

Could this type of add-on (technically) eventually be supported,

Yep, this would be related to the #3189 implementation - the extension uses the letterSpacing property https://github.com/kylepaulsen/vscode-stretchy-spaces/blob/e1bb545a701989a2ce01a44759f04142d304a70c/extension.js#L121

Essentially, it involves wiring up the text decoration API, and then setting up some custom calculation and measurement for the characters. That extension uses kind of an obscure unit of ch: https://css-tricks.com/the-lengths-of-css/#ch - but it seems like we can calculate this based on our font metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-editor-component Area: Editor component/UI A-font Area: Font loading and rendering enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants