Skip to content

Commit

Permalink
feat: update bash grammar to latest tree-sitter-bash rev (helix-edito…
Browse files Browse the repository at this point in the history
  • Loading branch information
CSergienko authored and postsolar committed Apr 20, 2024
1 parent a4f5c42 commit 93d6a3d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 42 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# PRs merged into this branch

[Add `unbind_default_keys` config option #9384](https://github.com/helix-editor/helix/pull/9384)

[Add command expansions `%key{body}` #6979](https://github.com/helix-editor/helix/pull/6979)

~~[Globbing support in `:open` #9723](https://github.com/helix-editor/helix/pull/9723)~~
*Too many merge conflicts + it's easy to substitute with `:open %sh{ printf '%s\n' <globs> }`*

[Pickers "v2" #9647](https://github.com/helix-editor/helix/pull/9647)

[Implement new textobject for indentation level #9843](https://github.com/helix-editor/helix/pull/9843)

<div align="center">

<h1>
Expand Down
40 changes: 0 additions & 40 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2472,46 +2472,6 @@ fn echo(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
Ok(())
}

fn yank_diagnostic(
cx: &mut compositor::Context,
args: &[Cow<str>],
event: PromptEvent,
) -> anyhow::Result<()> {
if event != PromptEvent::Validate {
return Ok(());
}

let reg = match args.first() {
Some(s) => {
ensure!(s.chars().count() == 1, format!("Invalid register {s}"));
s.chars().next().unwrap()
}
None => '+',
};

let (view, doc) = current_ref!(cx.editor);
let primary = doc.selection(view.id).primary();

// Look only for diagnostics that intersect with the primary selection
let diag: Vec<_> = doc
.diagnostics()
.iter()
.filter(|d| primary.overlaps(&helix_core::Range::new(d.range.start, d.range.end)))
.map(|d| d.message.clone())
.collect();
let n = diag.len();
if n == 0 {
bail!("No diagnostics under primary selection");
}

cx.editor.registers.write(reg, diag)?;
cx.editor.set_status(format!(
"Yanked {n} diagnostic{} to register {reg}",
if n == 1 { "" } else { "s" }
));
Ok(())
}

fn read(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) -> anyhow::Result<()> {
if event != PromptEvent::Validate {
return Ok(());
Expand Down
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "bash"
source = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "275effdfc0edce774acf7d481f9ea195c6c403cd" }
source = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "f8fb3274f72a30896075585b32b0c54cad65c086" }

[[language]]
name = "php"
Expand Down
1 change: 0 additions & 1 deletion runtime/queries/bash/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
">>"
"<"
"|"
(expansion_flags)
] @operator

(
Expand Down

0 comments on commit 93d6a3d

Please sign in to comment.