diff --git a/src/datapack/command/mod.rs b/src/datapack/command/mod.rs index 6e2e028..eb8f291 100644 --- a/src/datapack/command/mod.rs +++ b/src/datapack/command/mod.rs @@ -94,7 +94,7 @@ impl Command { // TODO: change comment to compile to `1`, make sure nothing breaks Self::Comment(_) => 0, Self::Debug(_) => usize::from(options.debug), - Self::Raw(cmd) => cmd.lines().count(), + Self::Raw(cmd) => cmd.split('\n').count(), Self::UsesMacro(cmd) => cmd.line_count(), Self::Execute(ex) => ex.get_count(options), Self::Group(_) => 1, diff --git a/src/util/macro_string.rs b/src/util/macro_string.rs index 11dfbc4..24988d5 100644 --- a/src/util/macro_string.rs +++ b/src/util/macro_string.rs @@ -51,12 +51,12 @@ impl MacroString { #[must_use] pub fn line_count(&self) -> usize { match self { - Self::String(s) => s.lines().count(), + Self::String(s) => s.split('\n').count(), Self::MacroString(parts) => { parts .iter() .map(|p| match p { - MacroStringPart::String(s) => s.lines().count() - 1, + MacroStringPart::String(s) => s.split('\n').count() - 1, MacroStringPart::MacroUsage(_) => 0, }) .sum::()