mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-28 08:36:11 +00:00
As part of prep for a 7.4.2 release, this backports changes to the 7.4.X branch that we can reasonably ship in 7.4.2 without too many code changes.
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
# Rojo Changelog
|
# Rojo Changelog
|
||||||
|
|
||||||
## Unreleased Changes
|
## Unreleased Changes
|
||||||
|
* Added Never option to Confirmation ([#893])
|
||||||
|
* Fixed removing trailing newlines ([#903])
|
||||||
|
|
||||||
|
[#893]: https://github.com/rojo-rbx/rojo/pull/893
|
||||||
|
[#903]: https://github.com/rojo-rbx/rojo/pull/903
|
||||||
|
|
||||||
## [7.4.1] - February 20, 2024
|
## [7.4.1] - February 20, 2024
|
||||||
* Made the `name` field optional on project files ([#870])
|
* Made the `name` field optional on project files ([#870])
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ impl Vfs {
|
|||||||
let path = path.as_ref();
|
let path = path.as_ref();
|
||||||
let contents = self.inner.lock().unwrap().read_to_string(path)?;
|
let contents = self.inner.lock().unwrap().read_to_string(path)?;
|
||||||
|
|
||||||
Ok(contents.lines().collect::<Vec<&str>>().join("\n").into())
|
Ok(contents.replace("\r\n", "\n").into())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write a file to the VFS and the underlying backend.
|
/// Write a file to the VFS and the underlying backend.
|
||||||
@@ -473,3 +473,23 @@ impl VfsLock<'_> {
|
|||||||
self.inner.commit_event(event)
|
self.inner.commit_event(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use crate::{InMemoryFs, Vfs, VfsSnapshot};
|
||||||
|
|
||||||
|
/// https://github.com/rojo-rbx/rojo/issues/899
|
||||||
|
#[test]
|
||||||
|
fn read_to_string_lf_normalized_keeps_trailing_newline() {
|
||||||
|
let mut imfs = InMemoryFs::new();
|
||||||
|
imfs.load_snapshot("test", VfsSnapshot::file("bar\r\nfoo\r\n\r\n"))
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let vfs = Vfs::new(imfs);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
vfs.read_to_string_lf_normalized("test").unwrap().as_str(),
|
||||||
|
"bar\nfoo\n\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ local function invertTbl(tbl)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local invertedLevels = invertTbl(Log.Level)
|
local invertedLevels = invertTbl(Log.Level)
|
||||||
local confirmationBehaviors = { "Initial", "Always", "Large Changes", "Unlisted PlaceId" }
|
local confirmationBehaviors = { "Initial", "Always", "Large Changes", "Unlisted PlaceId", "Never" }
|
||||||
|
|
||||||
local function Navbar(props)
|
local function Navbar(props)
|
||||||
return Theme.with(function(theme)
|
return Theme.with(function(theme)
|
||||||
|
|||||||
@@ -516,6 +516,9 @@ function App:startSession()
|
|||||||
return "Accept"
|
return "Accept"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif confirmationBehavior == "Never" then
|
||||||
|
Log.trace("Accepting patch without confirmation because behavior is set to Never")
|
||||||
|
return "Accept"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The datamodel name gets overwritten by Studio, making confirmation of it intrusive
|
-- The datamodel name gets overwritten by Studio, making confirmation of it intrusive
|
||||||
|
|||||||
Reference in New Issue
Block a user