Skip to content

PluginLinekeeper

Armin Burgmeier edited this page Feb 10, 2015 · 3 revisions

The linekeeper plugin

The linekeeper plugin makes sure that there is always a fixed number of empty lines at the end of the document. If users add newlines at the end of the document or remove them, then the server automatically fills up such that a fixed number of newlines show up. For this purpose, the plugin joins a user called "LineKeeper" into the session. This user actually performs the operations of inserting required newlines or deleting superfluous newlines.

This can be useful to for example always have 1 or 2 empty newlines at the end of the document that can be used by people to append text at the end of the document, even if someone else is currently writing in the last line of the document.

Note that with this plugin, the empty newlines are enforced on the server side. The libinfinity library contains a class to enforce the newlines on the client side, called InfTextFixlineBuffer. This eliminates some issues that can appear with the server-based solution, such as merge conflicts between the LineKeeper user and the person starting to type at the last line (this could be fixed, but it requires changing the infinote protocol), as well as the additional newlines also showing up when the document is saved. However, currently there is no option in Gobby to enable this feature.

Plugin options

  • n-lines: The number of empty lines to keep fixed at the end of the document. Can be any positive number or 0.

Example

[linekeeper]
n-lines=2

Makes sure that there are always two empty lines at the end of each text document.

Other Plugins

Back to the list of infinoted plugins.