# Introduce a new \`BlockStyle\` field for blocks · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/666ea61dbc0311be869a998d6b26ba2fcbb2730e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 666ea61dbc0311be869a998d6b26ba2fcbb2730e

Requested commit: 666ea61dbc0311be869a998d6b26ba2fcbb2730e

Commit: 666ea61dbc0311be869a998d6b26ba2fcbb2730e

Tree: 816dd8c273401e47e6b857a6af81b78f427a816e

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Introduce a new `BlockStyle` field for blocks

This new field allows blocks to specify how they want to be laid out:

- If `Fixed` they can take up all the width they want and they will impact
the scroll width of the editor. This is useful for diagnostic messages and
allows scrolling the editor further to the right to visualize the entire message.
- If `Flex` they can extend all the way to the scroll width without impacting it
any further. This is useful for the rename editor that we insert as a block
decoration when hitting `F2`.
- If `Sticky`, they will be as wide as the editor element and won't participate
in the horizontal scrolling of the editor. This is useful for headers in general,
where we want e.g. the filename and the jump button to always be visible
independently of how much the user has scrolled to the right.

```

## Parents

- [8e440bf7ca1de10bc6ed9ee54f3669e31142c553](https://git.cafe/gitcafe/zed/commit/8e440bf7ca1de10bc6ed9ee54f3669e31142c553?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/666ea61dbc0311be869a998d6b26ba2fcbb2730e?format=markdown)
