Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3e51bc9
(theme) feat: mode based primary cursor colors
gibbz00 Dec 12, 2022
71c7565
docs/themes: mode based primary cursor colors
gibbz00 Dec 12, 2022
a2b488f
remove one-liner solely used for a test
gibbz00 Dec 17, 2022
34301f7
Inlined helper fuction with a singular referecne.
gibbz00 Dec 17, 2022
b41790a
Removed unused import
gibbz00 Dec 17, 2022
1e3f1e4
Remove order property of KeyTrie struct:
gibbz00 Dec 17, 2022
0f262c0
Infobox: Remove superflous command descripition pruning:
gibbz00 Dec 17, 2022
76054f7
Keymap infobox: Use Vec in place of BTree:
gibbz00 Dec 17, 2022
74833ff
Keymap infobox: Place in correct order from start:
gibbz00 Dec 17, 2022
d7b3e03
Keymap infobox: Format body from start
gibbz00 Dec 17, 2022
da994c9
keymap.rs file splitting, cleanup and descriptive naming:
gibbz00 Dec 26, 2022
fda6c3b
Rename MappableCommand field doc to description:
gibbz00 Dec 26, 2022
9d7e9a2
Initial sorting of keymap info window
gibbz00 Dec 26, 2022
8ce551b
Infobox: Consistently place lowercase equivalents first
gibbz00 Dec 27, 2022
efdb1a1
Infobox keyevent ordering "C-" aknowledgement:
gibbz00 Dec 27, 2022
2551b74
Remove infobox optimization suggestion comment:
gibbz00 Dec 27, 2022
61d6904
keymap testing touchups
gibbz00 Dec 27, 2022
c6e3bb9
Exclude config no_op bindings in command palette.
gibbz00 Dec 27, 2022
aa9095b
Reuse table in picker
sudormrfbin Jul 8, 2022
e5079c4
Use upstream implementation of table column calculation
sudormrfbin Dec 18, 2022
23abcd7
Minimize allocation when converting table rows to string
sudormrfbin Dec 24, 2022
4bf2caf
Replace menu::Item::{row, label} with format()
sudormrfbin Dec 25, 2022
3d8155c
Cleaner infobox join operation
gibbz00 Dec 27, 2022
4d4e87b
Helix term use statement cleanups
gibbz00 Dec 28, 2022
be31ee2
Move Config related tests from keymap tests Config tests
gibbz00 Dec 28, 2022
7231d0f
Config test cleanup
gibbz00 Dec 28, 2022
d25d0ac
Unify config loading pt 1:
gibbz00 Dec 29, 2022
8918553
Unify config loading pt 2:
gibbz00 Dec 29, 2022
b4ca7d8
Minor module visibility cleanup
gibbz00 Dec 29, 2022
8cb9a91
Renamed the keymap! macro to keytrie!:
gibbz00 Dec 29, 2022
ac7348b
Clarify config loading pt. 3
gibbz00 Jan 14, 2023
88abbcd
Clarify config loading pt. 4
gibbz00 Jan 14, 2023
10776c7
Clarify config loading pt. 5
gibbz00 Jan 14, 2023
6f4301c
Move --help message to separate file.
gibbz00 Jan 14, 2023
87afbe5
help.rs: use named parameters
gibbz00 Jan 14, 2023
b7f895a
Unify config loading
gibbz00 Jan 14, 2023
73676b5
Consistent exit handling
gibbz00 Jan 14, 2023
7ddeca2
Unify config loading
gibbz00 Jan 14, 2023
4731861
Unify config loading
gibbz00 Jan 14, 2023
c0ad268
Unify config loading
gibbz00 Jan 15, 2023
037f6d3
Unify config loading
gibbz00 Jan 17, 2023
0c3b6b9
Use unified config loading in docgen and health
gibbz00 Jan 17, 2023
a904e2c
fix rebase
gibbz00 Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,14 @@ These scopes are used for theming the editor interface.
| `ui.background` | |
| `ui.background.separator` | Picker separator below input line |
| `ui.cursor` | |
| `ui.cursor.normal` | |
| `ui.cursor.insert` | |
| `ui.cursor.select` | |
| `ui.cursor.match` | Matching bracket etc. |
| `ui.cursor.primary` | Cursor with primary selection |
| `ui.cursor.primary.normal` | |
| `ui.cursor.primary.insert` | |
| `ui.cursor.primary.select` | |
| `ui.gutter` | Gutter |
| `ui.gutter.selected` | Gutter for the line the cursor is on |
| `ui.linenr` | Line numbers |
Expand Down
10 changes: 0 additions & 10 deletions helix-core/src/config.rs

This file was deleted.

1 change: 0 additions & 1 deletion helix-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub use encoding_rs as encoding;
pub mod auto_pairs;
pub mod chars;
pub mod comment;
pub mod config;
pub mod diagnostic;
pub mod diff;
pub mod graphemes;
Expand Down
2 changes: 1 addition & 1 deletion helix-core/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ macro_rules! hashmap {
($($key:expr => $value:expr),*) => {
{
let _cap = hashmap!(@count $($key),*);
let mut _map = ::std::collections::HashMap::with_capacity(_cap);
let mut _map = std::collections::HashMap::with_capacity(_cap);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliberate for macro hygiene purposes.

Copy link
Contributor Author

@gibbz00 gibbz00 Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm sure, I can revert this. Although I doubt there will be a namespace are namespace collisions with: std::collections::HashMap::with_capacity

$(
let _ = _map.insert($key, $value);
)*
Expand Down
26 changes: 17 additions & 9 deletions helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,21 @@ fn default_timeout() -> u64 {
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Configuration {
pub struct LanguageConfigurations {
pub language: Vec<LanguageConfiguration>,
}

impl Default for Configuration {
impl LanguageConfigurations {
/// Attemps to deserialize a merged user configured languages.toml with the repository languages.toml file.
pub fn merged() -> Result<Self, toml::de::Error> {
helix_loader::merged_lang_config()?.try_into()
}
}
impl Default for LanguageConfigurations {
fn default() -> Self {
crate::config::default_syntax_loader()
helix_loader::default_lang_configs()
.try_into()
.expect("Failed to deserialize built-in languages.toml into LanguageConfigurations")
}
}

Expand All @@ -75,11 +83,11 @@ impl Default for Configuration {
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub struct LanguageConfiguration {
#[serde(rename = "name")]
pub language_id: String, // c-sharp, rust
pub language_id: String, // c-sharp, rust
pub scope: String, // source.rust
pub file_types: Vec<FileType>, // filename extension or ends_with? <Gemfile, rb, etc>
#[serde(default)]
pub shebangs: Vec<String>, // interpreter(s) associated with language
pub shebangs: Vec<String>, // interpreter(s) associated with language
pub roots: Vec<String>, // these indicate project roots <.git, Cargo.toml>
pub comment_token: Option<String>,
pub max_line_length: Option<usize>,
Expand Down Expand Up @@ -561,7 +569,7 @@ pub struct Loader {
}

impl Loader {
pub fn new(config: Configuration) -> Self {
pub fn new(config: LanguageConfigurations) -> Self {
let mut loader = Self {
language_configs: Vec::new(),
language_config_ids_by_extension: HashMap::new(),
Expand Down Expand Up @@ -2278,7 +2286,7 @@ mod test {
"#,
);

let loader = Loader::new(Configuration { language: vec![] });
let loader = Loader::new(LanguageConfigurations { language: vec![] });
let language = get_language("rust").unwrap();

let query = Query::new(language, query_str).unwrap();
Expand Down Expand Up @@ -2337,7 +2345,7 @@ mod test {
.map(String::from)
.collect();

let loader = Loader::new(Configuration { language: vec![] });
let loader = Loader::new(LanguageConfigurations { language: vec![] });

let language = get_language("rust").unwrap();
let config = HighlightConfiguration::new(
Expand Down Expand Up @@ -2440,7 +2448,7 @@ mod test {
) {
let source = Rope::from_str(source);

let loader = Loader::new(Configuration { language: vec![] });
let loader = Loader::new(LanguageConfigurations { language: vec![] });
let language = get_language(language_name).unwrap();

let config = HighlightConfiguration::new(language, "", "", "").unwrap();
Expand Down
42 changes: 0 additions & 42 deletions helix-loader/src/config.rs

This file was deleted.

4 changes: 2 additions & 2 deletions helix-loader/src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub fn build_grammars(target: Option<String>) -> Result<()> {
// merged. The `grammar_selection` key of the config is then used to filter
// down all grammars into a subset of the user's choosing.
fn get_grammar_configs() -> Result<Vec<GrammarConfiguration>> {
let config: Configuration = crate::config::user_lang_config()
let config: Configuration = crate::merged_lang_config()
.context("Could not parse languages.toml")?
.try_into()?;

Expand Down Expand Up @@ -511,7 +511,7 @@ fn mtime(path: &Path) -> Result<SystemTime> {
/// Gives the contents of a file from a language's `runtime/queries/<lang>`
/// directory
pub fn load_runtime_file(language: &str, filename: &str) -> Result<String, std::io::Error> {
let path = crate::RUNTIME_DIR
let path = crate::runtime_dir()
.join("queries")
.join(language)
.join(filename);
Expand Down
Loading