Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Highlight Cabal with Haskell #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion zee-edit/src/diff.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ropey::Rope;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct OpaqueDiff {
pub byte_index: usize,
pub old_byte_length: usize,
Expand Down
2 changes: 1 addition & 1 deletion zee-edit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl RopeCursorExt for Rope {
///
/// `Cursor`s consist of a location in a `Rope` and optionally a selection and
/// desired visual offset.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Cursor {
/// The cursor position represented as the index of the gap between two adjacent
/// characters inside a `Rope`.
Expand Down
2 changes: 1 addition & 1 deletion zee-highlight/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl ScopePattern {
}
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Scope(pub String);

pub fn parse_rules_unwrap(language: Language, source: &str) -> HighlightRules {
Expand Down
4 changes: 2 additions & 2 deletions zee-highlight/src/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ use crate::error::{Error, Result};
// multiple node kind "ids" to the same node kind string. The highlighting rules
// refer to strings. To apply rules and avoid string matching, we have to first
// map the node kind ids of a grammar to a unique set.
#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Hash)]
#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq, Hash)]
pub struct SelectorNodeId(pub(crate) u16);

pub type NthChild = i16;

const NTH_CHILD_ANY: NthChild = -1;

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct Selector {
node_kinds: SmallVec<[SelectorNodeId; 4]>,
nth_children: SmallVec<[NthChild; 4]>,
Expand Down
4 changes: 3 additions & 1 deletion zee/config/config.ron
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
scope: "source.haskell",
injection_regex: "haskell",
patterns: [
Name("cabal.project"),
Suffix(".cabal"),
Suffix(".hs"),
],
comment: Some(Comment(token: "-- ")),
Expand All @@ -143,7 +145,7 @@
id: "haskell",
source: Git(
git: "https://github.com/tree-sitter/tree-sitter-haskell",
rev: "cf394604ae2ec2a5e65b1afbc7dea21258ede403",
rev: "972156b37ee6f4a8b51a6f67f76aecc6fa13714c",
),
)
),
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/buffer/line_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use zi::{Canvas, Component, ComponentLink, Layout, Rect, ShouldRender, Style};

#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct Properties {
pub style: Style,
pub line_offset: usize,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{
versioned::WeakHandle,
};

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Theme {
pub border: Style,
pub edit_tree_viewer: EditTreeViewerTheme,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/buffer/status_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
utils::StaticRefEq,
};

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Theme {
pub base: Style,
pub frame_id_focused: Style,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/edit_tree_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use zee_edit::tree::{self, EditTree};

use crate::versioned::WeakHandle;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Theme {
pub current_revision: Style,
pub master_revision: Style,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/prompt/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use zi::{
use super::Theme;

// Message type handled by the `InteractiveMessage` component
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Message {
Accept,
Decline,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/prompt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use self::{
picker::{FilePicker, FileSource, Properties as FilePickerProperties},
};

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Theme {
pub action: Style,
pub input: Style,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/prompt/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct FileListingDone {
listing: FileListing,
}

#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FileSource {
Directory,
Repository,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/components/prompt/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use zi::{
prelude::*,
};

#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct StatusProperties {
pub action_name: Cow<'static, str>,
pub pending: bool,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/editor/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl Buffers {
}
}

#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ModifiedStatus {
Changed,
Unchanged,
Expand Down
2 changes: 1 addition & 1 deletion zee/src/syntax/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use zi::terminal::{Background, Style};

use zee_edit::{CharIndex, Cursor};

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Theme {
pub cursor_focused: Style,
pub cursor_unfocused: Style,
Expand Down