Git commit ec1e2cd2afe130a8ebc60199619d69760c7ff73a by Pablo Rauzy. Committed on 09/08/2022 at 09:57. Pushed by cullmann into branch 'master'.
moved document.alignOn to view.alignOn in frameworks/ktexteditor!391, reflecting this in the documentation M +15 -15 doc/katepart/development.docbook https://invent.kde.org/utilities/kate/commit/ec1e2cd2afe130a8ebc60199619d69760c7ff73a diff --git a/doc/katepart/development.docbook b/doc/katepart/development.docbook index 173b95547..c56aeede9 100644 --- a/doc/katepart/development.docbook +++ b/doc/katepart/development.docbook @@ -3534,6 +3534,21 @@ Properly re-indent lines within <replaceable>range</replaceable> according to cu </listitem> </varlistentry> +<varlistentry> +<term><synopsis> +void view.alignOn(<parameter>Range <replaceable>range</replaceable></parameter>, <parameter>String <replaceable>pattern</replaceable> = ""</parameter>); +</synopsis></term> +<listitem><para> +Aligns lines in <replaceable>range</replaceable> on the column given by the regular expression <replaceable>pattern</replaceable>. +With an empty <replaceable>pattern</replaceable> it will align on the first non-blank character by default. +If the pattern has a capture it will indent on the captured match. +</para> +<para><emphasis>Examples:</emphasis></para> +<para><literal>view.alignOn(document.documentRange(), '-');</literal> will insert spaces before the first <literal>-</literal> of each lines to align them all on the same column.</para> +<para><literal>view.alignOn(document.documentRange(), ':\\s+(.)');</literal> will insert spaces before the first non-blank character that occurs after a colon to align them all on the same column.</para> +</listitem> +</varlistentry> + <varlistentry> <term><synopsis> object view.executeCommand(<parameter>String <replaceable>command</replaceable></parameter>, @@ -4416,21 +4431,6 @@ Indents all lines in <replaceable>range</replaceable> by <replaceable>change</re </para></listitem> </varlistentry> -<varlistentry> -<term><synopsis> -void document.alignOn(<parameter>Range <replaceable>range</replaceable></parameter>, <parameter>String <replaceable>pattern</replaceable> = ""</parameter>); -</synopsis></term> -<listitem><para> -Aligns lines in <replaceable>range</replaceable> on the column given by the regular expression <replaceable>pattern</replaceable>. -With an empty <replaceable>pattern</replaceable> it will align on the first non-blank character by default. -If the pattern has a capture it will indent on the captured match. -</para> -<para><emphasis>Examples:</emphasis></para> -<para><literal>document.alignOn(document.documentRange(), '-');</literal> will insert spaces before the first <literal>-</literal> of each lines to align them all on the same column.</para> -<para><literal>document.alignOn(document.documentRange(), ':\\s+(.)');</literal> will insert spaces before the first non-blank character that occurs after a colon to align them all on the same column.</para> -</listitem> -</varlistentry> - </variablelist> </para>
