mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
Trim leading and trailing whitespace in feedback
This commit is contained in:
parent
d6962d957b
commit
888145ebed
1 changed files with 3 additions and 2 deletions
|
@ -125,7 +125,9 @@ impl FeedbackEditor {
|
||||||
_: ModelHandle<Project>,
|
_: ModelHandle<Project>,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> Task<anyhow::Result<()>> {
|
) -> Task<anyhow::Result<()>> {
|
||||||
let feedback_char_count = self.editor.read(cx).text(cx).chars().count();
|
let feedback_text = self.editor.read(cx).text(cx);
|
||||||
|
let feedback_char_count = feedback_text.chars().count();
|
||||||
|
let feedback_text = feedback_text.trim().to_string();
|
||||||
|
|
||||||
let error = if feedback_char_count < *FEEDBACK_CHAR_LIMIT.start() {
|
let error = if feedback_char_count < *FEEDBACK_CHAR_LIMIT.start() {
|
||||||
Some(format!(
|
Some(format!(
|
||||||
|
@ -154,7 +156,6 @@ impl FeedbackEditor {
|
||||||
|
|
||||||
let this = cx.handle();
|
let this = cx.handle();
|
||||||
let client = cx.global::<Arc<Client>>().clone();
|
let client = cx.global::<Arc<Client>>().clone();
|
||||||
let feedback_text = self.editor.read(cx).text(cx);
|
|
||||||
let specs = self.system_specs.clone();
|
let specs = self.system_specs.clone();
|
||||||
|
|
||||||
cx.spawn(|_, mut cx| async move {
|
cx.spawn(|_, mut cx| async move {
|
||||||
|
|
Loading…
Reference in a new issue