Remove inaccurate comments (#23056)
These comments are inaccurate. Even if `convert_case` provided a way to customize which boundaries were used (which is now does, it 0.7.1), they would be removed from the string and replaced with the new boundary character (`-`, `_`, ...), and we'd lose the ability to reconstruct the text the way the author formatted it. This is not a hack, this is the way we have to do it. Release Notes: - N/A
This commit is contained in:
parent
bd3c7d6cbf
commit
85b727c1a2
2 changed files with 0 additions and 6 deletions
|
@ -6203,8 +6203,6 @@ impl Editor {
|
||||||
|
|
||||||
pub fn convert_to_title_case(&mut self, _: &ConvertToTitleCase, cx: &mut ViewContext<Self>) {
|
pub fn convert_to_title_case(&mut self, _: &ConvertToTitleCase, cx: &mut ViewContext<Self>) {
|
||||||
self.manipulate_text(cx, |text| {
|
self.manipulate_text(cx, |text| {
|
||||||
// Hack to get around the fact that to_case crate doesn't support '\n' as a word boundary
|
|
||||||
// https://github.com/rutrum/convert-case/issues/16
|
|
||||||
text.split('\n')
|
text.split('\n')
|
||||||
.map(|line| line.to_case(Case::Title))
|
.map(|line| line.to_case(Case::Title))
|
||||||
.join("\n")
|
.join("\n")
|
||||||
|
@ -6225,8 +6223,6 @@ impl Editor {
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) {
|
) {
|
||||||
self.manipulate_text(cx, |text| {
|
self.manipulate_text(cx, |text| {
|
||||||
// Hack to get around the fact that to_case crate doesn't support '\n' as a word boundary
|
|
||||||
// https://github.com/rutrum/convert-case/issues/16
|
|
||||||
text.split('\n')
|
text.split('\n')
|
||||||
.map(|line| line.to_case(Case::UpperCamel))
|
.map(|line| line.to_case(Case::UpperCamel))
|
||||||
.join("\n")
|
.join("\n")
|
||||||
|
|
|
@ -3705,7 +3705,6 @@ async fn test_manipulate_text(cx: &mut TestAppContext) {
|
||||||
"});
|
"});
|
||||||
|
|
||||||
// Test multiple line, single selection case
|
// Test multiple line, single selection case
|
||||||
// Test code hack that covers the fact that to_case crate doesn't support '\n' as a word boundary
|
|
||||||
cx.set_state(indoc! {"
|
cx.set_state(indoc! {"
|
||||||
«The quick brown
|
«The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|
@ -3719,7 +3718,6 @@ async fn test_manipulate_text(cx: &mut TestAppContext) {
|
||||||
"});
|
"});
|
||||||
|
|
||||||
// Test multiple line, single selection case
|
// Test multiple line, single selection case
|
||||||
// Test code hack that covers the fact that to_case crate doesn't support '\n' as a word boundary
|
|
||||||
cx.set_state(indoc! {"
|
cx.set_state(indoc! {"
|
||||||
«The quick brown
|
«The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue