mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 09:23:44 +03:00
22cf73acec
When indent guides were still WIP, I thought it might be a good idea to detect the tab size for every line individually, so we can handle files with mixed indentations. However, while optimizing the performance of indent guides I found that getting the language at a given anchor was pretty expensive, therefore I only resolved the language for the first visible row. However, this could lead to some weird flickering, where the indent guides would use different tab sizes depending on the first visible row (see #12492). This can be fixed by just using the primary buffer language size. So as of right now indent guides cannot handle files with mixed indentations. Im not sure if anyone actually does/expects this, but one use case I could imagine is something like this: User x has a svelte file, where the tab size is set to `4`. However the svelte code uses typescript inside a script tag, which User x wants to use a tab size of `2`. The approach used here would not work for this, but then again I think our formatter does not even support something like this. Im probably overcomplicating things, so let's stick with the simple solution for now. Release Notes: - Fixed an issue where indent guides would use an incorrect tab size ([#12492](https://github.com/zed-industries/zed/issues/12492)). |
||
---|---|---|
.. | ||
src | ||
build.rs | ||
Cargo.toml | ||
LICENSE-GPL |