mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix: address verified review findings (comments-views-search-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
9 files changed
+68
-8
No files matched your search
@@ -246,12 +246,12 @@ func (a *application) writeComments(cmd *cobra.Command, t target, n int64, items
|
||||
text.WriteString(terminal.Table(nil, [][]terminal.Cell{{heading, {Text: meta, Muted: true}}}, d))
|
||||
body := strings.TrimSpace(comment.Body)
|
||||
if d.Markdown {
|
||||
body = strings.TrimSpace(terminal.Markdown(body, d))
|
||||
// Glamour already indents every line by its margin, which TrimSpace would strip from the first.
|
||||
text.WriteString(strings.Trim(terminal.Markdown(body, d), "\n"))
|
||||
} else {
|
||||
body = terminal.SafeText(body)
|
||||
}
|
||||
for line := range strings.Lines(body) {
|
||||
text.WriteString(" " + line)
|
||||
for line := range strings.Lines(terminal.SafeText(body)) {
|
||||
text.WriteString(" " + line)
|
||||
}
|
||||
}
|
||||
text.WriteString("\n")
|
||||
}
|
||||
@@ -283,6 +283,9 @@ $ tea %[1]s comment list %[2]s`, words.group, words.example), Annotations: map[s
|
||||
if deleteLast && (cmd.Flags().Changed("body") || cmd.Flags().Changed("body-file") || flags.useEditor) {
|
||||
return clierr.Wrap(clierr.Usage, errors.New("--delete-last takes no comment text"))
|
||||
}
|
||||
if deleteLast && a.options.json != "" {
|
||||
return clierr.Wrap(clierr.Usage, errors.New("comment deletion does not return a resource; --json and --jq are not supported"))
|
||||
}
|
||||
t, n, err := a.resolveRef(cmd, args[0], kind)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user