emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68226: closed ([PATCH] Improve block_node handling for yaml-ts-mode


From: GNU bug Tracking System
Subject: bug#68226: closed ([PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph)
Date: Fri, 05 Jan 2024 00:43:02 +0000

Your message dated Thu, 4 Jan 2024 16:42:23 -0800
with message-id <78357BE6-D127-4145-809D-BDD64C49D9C3@gmail.com>
and subject line Re: bug#68226: [PATCH] Improve block_node handling for 
yaml-ts-mode fill-paragraph
has caused the debbugs.gnu.org bug report #68226,
regarding [PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
68226: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68226
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph Date: Tue, 2 Jan 2024 14:10:53 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1
Hello Emacs maintainers,

I noticed that the yaml-ts-mode fill-paragraph function doesn't play nicely with block nodes, making it difficult to tidy paragraphs. For example,

foo: |
  line-one
  line-two

Becomes

foo: | line-one line-two

Effectively undoing the block.

My proposed changes (see attached patch) fixes this behavior so that block nodes remain formatted correctly:

foo: |
  line-one line-two

It also plays nicely with longer pieces of text and multiple paragraphs.

I tried to base my changes off of the fill-paragraph function from c-ts-common, though the YAML version is much simpler since it doesn't need to account for comment insertion. I've not written a fill-paragraph function before so I'm sure I messed something up.

What do you think?

Attachment: 0001-Improve-block_node-handling-for-yaml-ts-mode-fill-pa.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#68226: [PATCH] Improve block_node handling for yaml-ts-mode fill-paragraph Date: Thu, 4 Jan 2024 16:42:23 -0800

> On Jan 2, 2024, at 9:21 PM, Graham Marlow <graham@mgmarlow.com> wrote:
> 
>> Thank you! This is great. The function assumes that the block starts at 
>> the line below “|”, but I think it’s very rare when people write string 
>> block right after the “|”.
> 
> Happy to help!
> 
>> Have you signed the copyright assignment?
> 
> I have indeed. 

Installed on master, thanks!

Yuan

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]