This is very useful if you have created a snippet and want to create
another one that shares a lot of the source code, dependencies etc.
Just duplicate the first one with a new name and edit it as required.
It saves a lot of time.
There's a second use where you can duplicate a snippet from the main
database under the same name and make any tweaks you like to the new
version: duplicate snippets are always editable.
Use the
Snippets | Duplicate Snippet menu option, press
Shift+Ctrl+D or click the

tool button.
The Database now supports Unicode text for snippet names, descriptions
etc., and for source code. Using Unicode for snippet names and source
code will mean that the code will not compile on older compilers that
don't understand Unicode source code or unit file names.
There is now finer control over the control of warnings in generated
code via the $WARN
directive. This is controlled on the
Code Generation tab of the
Preferences dialogue box.
[v4.1] There is also finer control over the comments
written to exported snippets and units, in that snippet comments can be
restricted to display only the first paragraph of multi-paragraph
snippet descriptions. Select this option from the
Code Formatting tab of the
Preferences dialogue box.
The names of referenced units may now contain dots so that Delphi
namespaces can be used.
[v4.3] The user defined snippets database can now be
moved to a user specified directory. This useful for ensuring the
database is backed up, for example by placing it in a Dropbox
or GoogleDrive sub-folder. (This option is not available in the
portable edition.)
User Interface
-
The new multi-tab display can display details of more than one snippet,
category etc. in the main display. Ctrl
click items in the overview pane, or links in the details pane, to
display them in a new tab. See the Detail
Pane help topic for more information.
-
The main menu has been re-organised and there are new menu and toolbar
glyphs.
-
The structure of snippet pages in the details pane is now customisable:
various page elements can be omitted and the order of elements can be
changed. Each snippet type has its own page customisation. Use the
Snippet Layout tab of the
Preferences dialogue box to do the
customisation.
-
[v4.1] The list of required units displayed on the
References tab of the Snippets
Editor, is now persistent and can be edited. (The rest of the
References received a makeover at the same time).
-
The number of compilers that appear in the compile results table in the
details pane can now be limited. Use the Compiler tab of the
Configure Compilers dialogue box
to do this.
-
The colours used for Snippet and other headings can now be customised
using the Display tab of the
Preferences dialogue box.
-
Snippets can now have an optional "display name" that,
unlike the snippet's name, does not need to be unique. This is useful
for giving meaningful names to snippets such as overloaded functions.
For example snippets ResizeRect_A and ResizeRect_B
in the online database now have display names ResizeRect (TSize
overload) and ResizeRect (Longint overload) which are
much more meaningful.
-
Snippet descriptions can now be formatted and can contain multiple
paragraphs, just like "extra" text. Both are edited using the
new Markup Editor.
-
Syntax highlighting of source code of user defined snippets can now be
switched off on a per-snippet basis. This mainly of use for
freeform snippets that may be used
for notes or snippets in languages other than Pascal.
-
Information about how a snippet from the online Code Snippets Database
was tested is now displayed by means of a glyph at the top right of
the detail pane, as follows:
-
the snippet has been given some basic testing before
uploading to the database.
-
the snippet has been more rigorously tested, for
example by unit testing.
-
the snippet has not been tested and should be used with
care.
-
The Welcome page has been completely redesigned to be cleaner and to
provide more useful information about the databases and program.
Favourites [v4.2]
-
User's can now flag snippets as "Favourites". Press
Shift+Alt+F or click the
toolbar button to make the displayed snippet a favourite.
-
A new non-modal dialogue box can be
displayed alongside the main CodeSnip window where favourite
snippets are listed. Snippets be quickly displayed from here. Display
the dialogue box by pressing F4. Snippets
can also be "un-favourited" from the dialogue box.
Test Compilation
Other Features
For other features of v4 please read the change log for this release and all preceding v4 releases, including
alpha (preview) and beta releases and release candidates.