Commit Graph

11 Commits

Author SHA1 Message Date
Christian Duerr 6e1b9d8b25
Replace serde's derive with custom proc macro
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.

The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.

Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.

The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.

Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.

Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.
2020-12-21 02:44:38 +00:00
Dettorer 2fd2db4afa
Add blinking cursor support
This adds support for blinking the terminal cursor. This can be
controlled either using the configuration file, or using escape
sequences.

The supported control sequences for changing the blinking state are
`CSI Ps SP q` and private mode 12.
2020-11-23 23:11:03 +00:00
Christian Duerr bede5d5d1c
Fix crash with large negative font offset
Fixes #4363.
2020-10-29 22:14:43 +00:00
Christian Duerr 7a4b4a6a24
Rename font crate to crossfont 2020-07-18 01:27:41 +00:00
Christian Duerr 7aafbb757d
Remove copyright notice from files
Keeping the license as part of every file bloats up the files
unnecessarily and introduces an additional overhead to the creation of
new modules.

Since cargo already provides excellent dependency management, most of
the code-reuse of Alacritty should occur through Rust's dependency
management instead of copying it source.

If code is copied partially, copying the license from the main license
file should be just as easy as copying from the top of the file and
making some adjustments based on where it is used is likely necessary
anyways.
2020-06-06 21:49:14 +03:00
Christian Duerr 81ce93574f
Extend style guideline documentation 2020-05-05 22:50:23 +00:00
Kirill Chibisov 33abfe34a8
Add config option to set cursor thickness
Fixes #3526.
2020-04-15 03:50:34 +00:00
Christian Duerr 6d60a49956
Run clippy on oldest supported version
Since there were some problems with clippy suggesting changes that were
not yet available in the oldest supported Rust compiler of Alacritty,
the clippy stage has been moved from stable to 1.37.0.
2020-03-12 22:49:46 +00:00
Kirill Chibisov 696fc792e8
Increase Beam, Underline and Box cursors' line width 2020-02-13 22:22:02 +00:00
Kirill Chibisov 79b19176ee Add support for colored emojis on Linux/BSD
Fixes #153.
2019-12-09 23:12:44 +01:00
Kirill Chibisov 474032742b Move renderer from alacritty_terminal to alacritty 2019-11-23 18:08:52 +01:00