github Zettlr/Zettlr v0.18.2

latest releases: v3.2.1, v3.2.0, v3.1.1...
6 years ago

Today's release again contains a lot of bug fixes and smaller improvements. There are, as always, some that deserve a little bit of spotlight:

Removed the annoying "Replace file in editor?" message

As many of you have already noticed (and as an issue actually reported a few days ago), Zettlr always had an annoying problem. Every time when you were editing a file that was stored via a cloud service, such as Dropbox, Nextcloud, or GoogleDrive, it could occasionally happen that Zettlr permanently asked you whether or not you want to replace the remotely-modified file. This message was irrational as you were the only one editing the file, and it broke your workflow every time. The reason for this message is that somehow the detection mechanism of cloud services seem to trigger another "change"-event inside Zettlr, which is then not ignored but passed on to the mechanism that prompted you to replace the file. Now, Zettlr will first determine whether or not the file has really changed since it last checked, and only if that is true, Zettlr will bother you with the prompt.

Syntax highlighting in fenced code blocks

Somehow, Zettlr is becoming more and more popular among coders, which is really nice! As my primary goal is to create a Markdown editor for researchers in the arts and humanities, I didn't initially implement code highlighting, because most of us never really need fenced code blocks to explain some code. But now after the issue has been raised, I decided to activate this functionality of Zettlr. Currently, a variety of popular languages is highlighted, but more can be implemented as well.

Currently implemented are: C, C++, Objective C, C#, Java, Javascript, PHP, Ruby, Python, R, SQL, Swift, YAML, CSS and LESS.

You can activate code highlighting for these languages by using the Commonmark specification for info text (i.e. write the language after your beginning fence, like this: ```javascript`)

The strings that trigger code highlighint are as follows: c, cpp, objectivec, csharp, java, javascript, php, ruby, python, r, sql, swift, yaml, css and less.

Do you want code highlighting enabled for additional languages? No problem, simply head over to the list of modes that CodeMirror supports and tell me. Enabling them is a matter of seconds.


As always, there are a lot of additional fixes and improvements, see the changelog for all of them:

Changelog

GUI and functionality

  • Minor fix to the style of code-blocks in modals.
  • Fixed a bug that prevented you from immediately re-selecting the previous file by simply clicking it again, after you opened an external markdown file in Zettlr, which then was selected automatically.
  • Fixed an error thrown if a root file was removed remotely.
  • Fixed Zettlr always asking to replace a file although it hasn't been modified remotely.
  • Fixed a missing translation for changed files.
  • Fixed the threshold for being close to surpassing average from 50 words below average to the half of average. 50 words were definitely too narrow for anyone to really see the intermediary message.
  • Fixed some design rules.
  • Reallowed arbitrary text selection inside the editor (mainly necessary for macOS's quick lookup functionality).
  • Added styling for horizontal rulers (* * *) and escaped characters (e.g. \*).
  • Fixes to the new tooltips. Now all tags receive the nicer tooltips on mouse over.
  • Replaced the old footnote tooltip bubble, which did not look nice, with the much better tippy.js-bubbles.
  • Added HTML syntax highlighting.
  • Fixed an error on the export of Markdown files with code blocks.
  • Added syntax highlighting capabilities in fenced code blocks for the following languages (use the words in brackets after the beginning of a code block, i.e. ```javascript`):
    • C (c)
    • C# (csharp)
    • C++ (cpp)
    • CSS (css)
    • Java (java)
    • JavaScript (javascript)
    • LESS (less)
    • Objective C (objectivec)
    • PHP (php)
    • Python (python)
    • R (r)
    • Ruby (ruby)
    • SQL (sql)
    • Swift (swift)
    • YAML (yaml)

Under the hood

  • Added an additional check to definitely determine if chokidar has choked or the file has indeed been modified remotely.
  • Lots of documentation has been added to the source code.
  • Moved the tippy() function from the ZettlrRenderer to the correct classes (ZettlrToolbar and ZettlrPreview).
  • Changes to the link detection regex in ZettlrEditor.
  • Changes to the export.tex LaTeX export template. It now provides the Shaded-environment Pandoc requires on exporting files containing fenced code blocks.
  • Added some amount of HTML syntax highlighting.
  • Added a multiplex mode that can highlight fenced code blocks.
  • Changed signature documentation of ZettlrRenderer's setCurrentFile method to reflect the actual process (it is being passed a hash, not a file object).
  • Changes to the _tags-array in ZettlrPreview. Now, the array is never completely regenerated, but resized according to the actual _data-array. The changes have affected the functionality of the functions _gen() and refresh() in this class.
  • Added a remove() method to Zettlr for root files wanting to delete themselves.

Don't miss a new Zettlr release

NewReleases is sending notifications on new releases.