Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto disable line wrap for the edited message #50

Open
paride opened this issue Jul 19, 2022 · 10 comments
Open

Auto disable line wrap for the edited message #50

paride opened this issue Jul 19, 2022 · 10 comments
Labels
enhancement New feature or request Thunderbird dependency This issue requires changes in Thunderbird

Comments

@paride
Copy link

paride commented Jul 19, 2022

Description

When editing a message with the external editor, once it's saved and moved to the TB native editor, longs lines are wrapped (and sent wrapped). That's not desirable in my opinion: any wrapping should be done by external editor. My use case is writing text, plus code snippets (which are sacred and shouldn't be wrapped).

I could disable wrapping TB-wide, but sometimes I want to write simple message with TB's native editor. I think the ideal solution would be to get this extension disable wrapping for the message it edits (not sure this is feasible).

(Huge thanks for this much needed extension!)

Environment

  • OS: Linux
  • Thunderbird version: 102.0.1
  • ExtEditorR extension version: 0.3.0
  • ExtEditorR host version:v0.3.0
@Frederick888 Frederick888 added the enhancement New feature or request label Jul 20, 2022
@Frederick888
Copy link
Owner

Can you use https://addons.thunderbird.net/en-us/thunderbird/addon/toggle-line-wrap/ for the time being?

The linked extension uses an experimental Thunderbird API, thus

  • requires full access to TB
  • potentially needs to be updated frequently to keep up with TB API changes

So unless this gets requested by a lot of other users as well, I reckon it's better to leave it to a separate extension. I'm more than happy to add this functionality once the API is stabilised of cos.

@paride
Copy link
Author

paride commented Jul 20, 2022

Makes sense, thanks.

@tim-seoss
Copy link

tim-seoss commented Aug 16, 2022

Firstly thanks very much for writing this extension!

unless this gets requested by a lot of other users as well, I reckon it's better to leave it to a separate extension.

I also hit this problem. To keep noise down on this issue, perhaps a thumbs up on the comment by @Frederick888 which I've quoted would be a good way of indicating that you'd like this feature (which I've just done)?

@Frederick888
Copy link
Owner

@tim-seoss I just realised that messenger.ComposeLineWrap wasn't an experimental API from Thunderbird itself but one registered by Toggle Line Wrap. So filing a feature request to https://bugzilla.mozilla.org to provide the same API natively is more appropriate.

@Frederick888 Frederick888 added the Thunderbird dependency This issue requires changes in Thunderbird label Sep 27, 2022
@lersek
Copy link

lersek commented Dec 12, 2022

Adding @jan-kiszka (developer of Toggle Line Wrap).

I'm affected by this as well. The symptom I'm encountering is a bit different though (I think anyway) from the one reported at the top of this ticket. Namely, for me the undesired wrapping occurs when invoking ExtEditorR from TB upon a message already being composed, for which wrapping has already been disabled using Toggle Line Wrap. In other words, the damage to the composition occurs as soon as I invoke ExtEditorR, not (only) when I return from ExtEditorR to Thunderbird.

Env:

  • Toggle Line Wrap 1.4.1
  • External Editor Revived 0.4.3
  • Thunderbird 102.5.0

Steps:

  1. Select Message | New Message in the main Thunderbird window / main menu bar.
  2. Click the Line Wrap button in the composition window, so that the red off icon appears atop of Line Wrap.
  3. Open your favorite editor manually, enter an a character, followed by 126 space characters, followed by a b character, and then a newline. This makes for a line that's 128 characters long.
  4. Copy this line to the clipboard using the external editor, then paste it like 10 times into the Thunderbird composition window. This produces a column of as to the left, and a column of bs to the right -- no wrapping.
  5. Briefly toggle the Line Wrap button twice, so as to check, temporarily, that Thunderbird would normally wrap these lines, but won't wrap them now.
  6. With the separate (not wrapped) columns of as and bs visible in the composition window, click External Editor.
  7. As soon as the external editor displays the temporary file, the lines are already wrapped.

Which component is responsible for the wrapping?

Thank you.

@Frederick888
Copy link
Owner

@lersek I'm not sure if it's actually related, but TB recently changed the way how text is extracted from the composition window, and this change landed in 102.5.1. Could you upgrade and test again?

@lersek
Copy link

lersek commented Dec 13, 2022

@Frederick888 thank you for the suggestion; I've installed 102.6.0, and indeed everything works fine.

Thanks for having reported https://bugzilla.mozilla.org/show_bug.cgi?id=1792551 in the upstream thunderbird bug tracker!

@paride
Copy link
Author

paride commented Dec 12, 2023

@Frederick888 would it be possible to use the messenger.ComposeLineWrap API that the Toggle Line Wrap extension defines to disable wrapping when editing a message with an external editor? This would make external-editor-revived depend on Toggle Line Wrap being installed for this feature to work, of course.

I'm also curious: how do you prevent Thunderbird from rewrapping your externally edited messages, which may contain text you don't want rewrapped (e.g. code snippets)? Do you just disable wrapping globally?

(Came here to see if anybody already reported this issue, and I found my own bug report!)

@lersek
Copy link

lersek commented Dec 12, 2023

@paride for me, this use case has been working well. I first disable line wrapping using the Toggle Line Wrap extension, then invoke my external editor with the External Editor Revived extension. Using a recent enough Thunderbird, Thunderbird itself does no wrapping at all, so all the wrapping I want, I can (and have to) do in the external editor.

@Frederick888
Copy link
Owner

Frederick888 commented Dec 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Thunderbird dependency This issue requires changes in Thunderbird
Projects
None yet
Development

No branches or pull requests

4 participants