The PostOffice Syntax Editor is an integrated text editor for editing texts and source code of certain languages. It currently supports 13 different language types with syntax highlighting, collapsible and expandable code fragments, automatic code completion, syntax quick help and much more. Depending on the application, the editor is displayed as a separate window or as an integrated window in an existing dialog, but the behaviour and view remain the same. The following syntax and corresponding functions are currently supported:
Regardless of whether the syntax editor is used as a dialog or embedded, the layout of the dialog is always the same.
The status bar is divided into 5 different information fields, which contain the following information:
The operation of the syntax editor is divided into the categories operation with the mouse, with the keyboard and the available functions. The current line on which the input cursor is active is always marked with a defined background color.
-
Positioning
Position the mouse anywhere in the document and press the left mouse button. The cursor is then positioned in the editor at the corresponding position in the text. If this position is outside a line of text, the cursor is placed on the last position of the line of text.
-
Context menu
If you press the right mouse button within the editor, a pop-up menu appears at the current mouse position with the content available in the "Edit" menu.
-
Marking continuous text
Use the mouse to mark any continuous text by clicking on the first position to be marked with the right mouse button, holding it down and then moving the mouse pointer to the end position of the text to be marked. Then release the right mouse button and the text remains marked. This marking works in both directions, from the start position downwards or upwards. If you repeat this function, the old marking is deleted and a new one is started.
-
Selecting several continuous texts
Proceed as in the "Selecting continuous text" function, but hold down the Control key (CTRL) to retain the old selection and add a new selection.
-
Selecting rows
You can move the mouse pointer from bottom to top or vice versa in the column with the row numbers by holding down the right mouse button and thus select entire rows. If you repeat this function, the old selection is deleted and a new one is started.
-
Selecting all lines
Proceed as in the "Select lines" function, but hold down the Control key (CTRL) to select all lines contained in the editor.
-
Highlighting words
If you double-click within a word or term with the right mouse button, the underlying word is highlighted and all identical words within the entire text are highlighted. This means that the word is highlighted throughout the text.
-
Marking bracket characters
If you click with the left mouse button on a so-called bracket character (i.e. <>()[]), the underlying bracket character and the corresponding bracket character are highlighted. It does not matter whether you click on the opening or closing bracket character.
-
Set/delete bookmark
Left-click within the 2nd column on the row on which you would like to set a bookmark. If you click on an existing bookmark, it will be deleted.
-
Menu function
Move the mouse over a menu in the menu bar and press the left mouse button; the submenu of the main menu you clicked on will then appear. If you want to select a different submenu, click on a main menu again, the previously opened submenu will close and the newly selected submenu will open.
-
Menu functions in the toolbar
Move the mouse over the toolbar and select the screen whose function you want to execute. A text explaining the meaning of the function is displayed for each screen. Then click on the symbol with the left mouse button and the function will be executed.
-
Change text size
Hold down the Control key (CTRL) and move the mouse wheel up (enlarge) or down (reduce) and the text in the editor window will be enlarged or reduced. This setting is retained when the editor is closed.
-
Scrolling text
If you scroll down or up with the mouse wheel, the text in the editor window scrolls down or up. Please note that this does not change the current cursor position in the text. If you hold down the SHIFT key and scroll down or up with the mouse wheel, the text in the editor window scrolls to the left and/or right, unless Fixed line width is set.
-
Expanding and collapsing text blocks
If the syntax of the current editor window supports this, the text blocks that can be expanded and collapsed are displayed on the 3rd sidebar with the "+" and "-" characters. If the "-" symbol is displayed, this means that a text block can be collapsed; if the "+" symbol is displayed, this means that a text block has been collapsed and can be expanded again by clicking on the "+" symbol.
Operation with the keyboard is not limited to cursor positioning, but there are many keyboard shortcuts for which a function is stored. Please refer to the "Keyboard shortcuts" help pages for this information.
The following functions are available in the menu, in the toolbar and in some cases via keyboard shortcuts:
-
Menu file
-
New
Deletes the entire content of the document including the file name if a document has been loaded.
-
Open
This reads in a new document. The file open dialog is displayed, with which you can load a file of the corresponding syntax type. This document is read into the text editor. If it is a document that can only be read but not overwritten, the syntax editor works in read-only mode, i.e. the text can be viewed but not edited, which is also indicated by a gray text background.
-
Save
The document is saved under the name with which it was loaded. If the document is new or has not been loaded, the function changes to "Save as".
-
Save as
This saves the current document under a file name to be selected. This opens the file selection dialog in which you can select the path and file name.
-
Edit menu
-
Undo
The last change is undone. Every change is saved, so all changes can be undone with this function until there are no more saved changes. Reloading or recreating a document resets the counter for changes, as does saving and saving as.
-
Restore
If a change is undone with the "Undo" function, it can be restored with this function, so that all undos are restored in sequence until no more are possible.
-
Cut
First select a text. The selected text is then cut out of the document and saved to the clipboard.
-
Copy
First select a text. The selected text is then saved to the clipboard.
-
Paste
The text stored in the clipboard is pasted into the document from the current cursor position. It does not matter where the text was copied from.
-
Select all
The entire text in the editor is selected.
-
Select nothing
All selections are deleted, the text is not changed.
-
Convert selection to upper/lower case
First select the text you want to convert. Then select this function. The selected text is then converted to either upper or lower case. The upper or lower case status always alternates, so you may have to execute this function twice to achieve the desired status.
-
Remove leading spaces
This function removes leading spaces at the beginning of a line. If you have previously selected a text, only the leading spaces are removed from the selected text, otherwise from the entire text.
-
Remove trailing spaces
This function removes trailing spaces at the end of a line. If you have previously selected a text, only the trailing spaces are removed from the selected text, otherwise from the entire text.
-
Remove blank lines
Use this function to remove blank lines, i.e. lines of text that do not contain any text, from the document. Please note that this function is always applied to the entire document, regardless of whether you have selected a text or not.
-
Commenting out
First select the text that you want to comment out. Then, when this function is executed, the selected text is commented out based on the selected syntax. So XML, for example, gets <!-- at the beginning of the selection and --> at the end of the selection. This works for all syntaxes except the plain text document.
-
Set/delete bookmark
Use this function to set a bookmark on the active line. If a bookmark already exists on the active line, it will be deleted.
-
Next bookmark
The cursor is placed on the line with the next bookmark. If there are no more bookmarks, it will start again at the first one. This allows you to jump to all bookmarks in the entire text. Please note that the cursor is placed on the first column in the line.
-
Previous bookmark
The cursor is placed on the line with the previous bookmark. If there are no more bookmarks, it will start again at the last one. This allows you to jump to all bookmarks in the entire text. Please note that the cursor is placed on the first column in the line.
-
Delete all bookmarks
This deletes all set bookmarks.
-
Search menu
-
Search
The search dialog opens. Please read the help Find/Replace dialog
-
Replace
The search and replace dialog is opened. Please read the help Find/Replace dialog
-
Continue search
Searches for the next search term in the text from the current cursor position. If something is found, the cursor is positioned at the end of the search term found and the search term is highlighted.
-
Search backwards
Searches for the previous search term in the text from the current cursor position. If something is found, the cursor is positioned at the end of the search term found and the search term is highlighted.
-
Replace found
This function replaces a found search term that has been selected with the replacement term entered in the search/replace dialog. The next search term is selected and positioned on it.
-
Replace all search terms found
All search terms that are found are replaced. As a result, a message dialog is displayed showing how many search terms have been replaced.
-
Go to Line
A dialog is displayed in which you can enter the desired line number to which you want to position. Either press the Enter key or the "Go to line" button. If the line number entered exists, the cursor will be positioned on it, with the cursor at the start of the line.
-
Menu Macros
-
Start/stop macro recording
This function is used to start a macro or, if a macro recording is already running, to stop it. A macro records all activities carried out in the editor until the recording is stopped. These can then be repeated as often as required with Execute macro. Please note that not all functions can be recorded, especially not file functions.
-
Execute macro
Use this function to execute a previously recorded macro. Please note that macros are not saved and only remain in memory until the editor is closed.
-
Menu view
-
Toolbar on/off
Shows and hides the toolbar. Please note that this setting is not saved when you close the editor. The active status of whether the toolbar is shown or hidden is displayed in the menu with an active checkbox.
-
Status bar on/off
Shows and hides the status bar. Please note that this setting is not saved when you close the editor. The active status of whether the status bar is shown or hidden is displayed in the menu with an active checkbox.
-
Display spaces and tabs
If this function is used to activate the display of spaces and tabs, a centered dot is displayed in the text instead of spaces and a tab character (right arrow) is displayed instead of 4 spaces. This setting is saved and will be the same as the last setting the next time the Syntax Editor is opened.
-
Display end of line
If the display of the end of line is activated with this function, the corresponding ASCII character is displayed in the text at the end of the line; in the standard case under Windows, this is CRLF. This setting is saved and corresponds to the last setting the next time the Syntax Editor is opened.
-
Fixed line width on/off
This function can be used to activate and deactivate the fixed line width. If the fixed line width is activated, the length of a line is limited to the displayed width of the editor window; all texts that are longer than this width are wrapped. This setting is saved and is available the next time the Syntax Editor is opened in accordance with the last setting
-
Enlarge view
This function increases the font size in the editor by a factor. This setting is saved and will be the same as the last setting the next time the Syntax Editor is opened.
-
Reduce view
This function reduces the font size in the editor by a factor. This setting is saved and will be the same as the last setting the next time the Syntax Editor is opened.
-
Reset view
This function resets the display size of the font in the Editor to the default setting. This setting is saved and corresponds to the last setting the next time the Syntax Editor is opened.
-
Menu Tools
-
XSD validation
This function allows you to validate the active document with an XSD of your choice. If you have an XML schema definition to which the current XML document must match, an XML schema validation is carried out. The errors are displayed as an info box. This function is only available when XML documents are being edited.
-
Format XML
This function formats an XML document with the correct indentations according to the XML tags. This function is only available when XML documents are being edited.
-
Format JSON
This function formats a JSON document with the correct indentations. This function is only available when JSON documents are being edited.
-
Display in browser
This function displays the document in the standard browser. This function is only available if Html and CSS documents are being edited.
-
Syntax check
Depending on the syntax (see above which document types support a syntax check), you can use this function to check your document for errors. If errors are found, they are marked with a bookmark and a note is added to the document describing the error.
-
Menu settings
-
Editor settings
This function can be used to set the editor settings and the syntax coloring/highlighting of the individual languages. A separate dialog containing all settings is opened for this purpose.
-
References settings
You can use this function to define the references for the keywords of each language. A separate dialog containing all references is opened for this purpose.
-
Menu Help
-
Help
This function displays this help.