WhiteSpace plugin

Version 1.0.3 (May 16 2024)

André Kaplan

Legal Notice

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no "Invariant Sections", "Front-Cover Texts" or "Back-Cover Texts", each as defined in the license. A copy of the license can be found in the file COPYING.DOC.txt included with jEdit.


Table of Contents

Chapter 1. Presentation

The main feature of WhiteSpace is to highlight whitespaces.

When highlighted,

  • Spaces are represented by a

  • Tabs are represented by a

  • Other whitespaces are represented by a

Except for the space, the horizontal tabulation and the line feed, other whitespaces are defined by the Character.isWhitespace java function, i.e.:

  • a Unicode space separator (category "Zs"), but not a no-break space (\u00a0 or \ufeff).

  • a Unicode line separator (category "Zl").

  • a Unicode paragraph separator (category "Zp").

  • \u000b, vertical tabulation.

  • \u000c, form feed.

  • \u000d, carriage return.

  • \u001c, file separator.

  • \u001d, group separator.

  • \u001e, record separator.

  • \u001f, unit separator.

When the Display ISO control chars as whitespaces option is checked, the characters in the range \u0000 through \u001f or in the range \u007f through \u009f are also highlighted.

WhiteSpace has also some other useful features:

  • Paragraph separators: a paragraph separator is displayed whenever two or more empty lines are encoutered.

  • Fold guides show the different levels of indentations of your code by displaying vertical grey (default) lines

  • Fold tooltips are displayed when the beginning of a block is not visible and your mouse cursor is near a fold guide.

  • On save actions Currently, changing settings here only applies to to newly opened buffers, and not the ones that are already open.

    • Remove trailing whitespaces

    • Tabify/untabify leading whitespaces according to soft tabs settings

    • Tabify leading whitespaces

    • Untabify leading whitespaces

At last, some jEdit actions are related to spaces and tabs handling:

  • Edit> Text> Spaces-To-Tabs

  • Edit> Text> Tabs-To-Spaces

Chapter 2. Default Options

WhiteSpace default options affect newly opened buffers only. For seeing or changing the properties on already open buffers, see Chapter 3, Buffer Options. Default options are available under: Plugins> Plugin Options> WhiteSpace.

"Spaces" options
  • Show spaces by default

  • Space color

  • Show leading spaces by default

  • Show inner spaces by default

  • Show trailing spaces by default

"Tabs" options
  • Show tabs by default

  • Tab color

  • Show leading tabs by default

  • Show inner tabs by default

  • Show trailing tabs by default

"Other whitespaces" options
  • Show other whitespaces by default

  • Display ISO control chars as whitespaces

  • Other whitespace color

"Fold guides" options
  • Show fold guides by default

  • Show fold tooltips by default

  • Fold guide color

"Paragraph separators" options
  • Show paragraph separators by default

  • Paragraph separators respect indentation

  • Paragraph separator color

"On save" options

When chosen, these actions are performed when a buffer is saved:

Remove trailing whitespaces

All trailing tabs and spaces are removed, except those preceded by one of the given escape characters. The default escape character is \ (backslash). E.g.

Some Text\

will be replaced by

Some Text\

Tabify/untabify according to soft tabs setting

The soft tabs setting determines whether leading whitespaces should be converted to tabs or spaces.

Tabify leading whitespaces

Leading whitespaces are replaced by a sequence of tabs possibly followed by at most tabSize - 1 spaces. The expanded length of leading whitespaces remains the same.

Untabify leading whitespaces

All tabs are removed from the leading whitespaces and replaced by an equivalent number of spaces. The expanded length of leading whitespaces remains the same.

Chapter 3. Buffer Options

The Buffer options for WhiteSpace are available from the Plugins> WhiteSpace menu.

The following Buffer options enable you to control the highlighting of spaces, tabs and other whitespaces for a given jEdit buffer. It's also possible to highlight spaces and tabs depending on their position (leading/inner/trailing) in the text.

  • Show spaces

  • Show tabs

  • Show other whitespaces

  • Show paragraph separators

  • Show fold guides

  • Show fold tooltips

  • Show leading spaces

  • Show inner spaces

  • Show trailing spaces

  • Show leading tabs

  • Show inner tabs

  • Show trailing tabs

The following Buffer options control the actions to be taken when a buffer is saved. Note that the last three actions are mutually exclusive.

  • Remove trailing whitespaces

  • Tabify/untabify according to soft tabs setting

  • Tabify according whitespaces

  • Untabify leading whitespaces

Chapter 4. License

The source code is distributed under the GPL. Please see http://www.fsf.org/copyleft/gpl.html

Chapter 5. Feedback

The preferred way to send bug reports is to use the Sourceforge Bug Tracker at http://sourceforge.net/bugs/?group_id=588

You can also write to:

Appendix A.  Changes

Click here to see the changelog.