Bug 384972 - No change of preview on format change of content (e.g. plain text -> Markdown)
Summary: No change of preview on format change of content (e.g. plain text -> Markdown)
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: plugin-preview (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 466377 (view as bug list)
Depends on: 384448 384449
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-22 19:13 UTC by Friedrich W. H. Kossebau
Modified: 2023-04-08 10:38 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Friedrich W. H. Kossebau 2017-09-22 19:13:01 UTC
When editing a document and changing the format (like turning plain text into Markdown formatted one), the preview does not update. Even not when saving to a new file with a new file suffix.

Reason is that the plugin relies on the MIME type reported for the document. Right now KTextEditor only estimates that MIME type on request instead of maintaining this property itself and notifying clients about any changes (see bugs this report depends on).

Workaround:
Best ensure the changed document is saved at least once (for MIME types only detected by file suffix). Then either close & open again the file or switch the preview plugin shortly to preview another open document.
Comment 1 Justin Zobel 2020-11-02 02:16:33 UTC
Confirmed this is still an issue in kate from git master.
Comment 2 Bug Janitor Service 2023-04-06 20:08:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1189
Comment 3 Waqar Ahmed 2023-04-06 20:16:39 UTC
*** Bug 466377 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Cullmann 2023-04-07 13:49:11 UTC
Git commit 026fcc08f986b5a99ecf10ebe8a1749312eaf4cd by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 07/04/2023 at 13:48.
Pushed by cullmann into branch 'master'.

Fix preview for markdown files not loaded on mode change

For markdown files no mimetype gets returned, so just manually add the
mimetype

M  +5    -0    addons/preview/previewwidget.cpp

https://invent.kde.org/utilities/kate/commit/026fcc08f986b5a99ecf10ebe8a1749312eaf4cd
Comment 5 Waqar Ahmed 2023-04-08 10:38:28 UTC
Git commit 86780f90aa45efb97a7448b2311c4a096bfcf35f by Waqar Ahmed.
Committed on 08/04/2023 at 10:37.
Pushed by waqar into branch 'release/23.04'.

Fix preview for markdown files not loaded on mode change

For markdown files no mimetype gets returned, so just manually add the
mimetype
(cherry picked from commit 026fcc08f986b5a99ecf10ebe8a1749312eaf4cd)

M  +5    -0    addons/preview/previewwidget.cpp

https://invent.kde.org/utilities/kate/commit/86780f90aa45efb97a7448b2311c4a096bfcf35f