Skip to content

Commit

Permalink
Merge pull request jacobslusser#7 from Stumpii/master
Browse files Browse the repository at this point in the history
Added missing methods SCI_SETTABINDENTS & SCI_SETBACKSPACEUNINDENTS
  • Loading branch information
Petteri Kautonen authored Jun 9, 2020
2 parents 0b6c64a + e70b610 commit 6fc4ac8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/ScintillaNET/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ public enum Command
/// </summary>
LineTranspose = NativeMethods.SCI_LINETRANSPOSE,

/// <summary>
/// Reverses the current line.
/// </summary>
LineReverse = NativeMethods.SCI_LINEREVERSE,

/// <summary>
/// Duplicates the current line.
/// </summary>
Expand Down Expand Up @@ -578,4 +583,4 @@ public enum Command
/// </summary>
SelectAll = NativeMethods.SCI_SELECTALL
}
}
}
3 changes: 2 additions & 1 deletion src/ScintillaNET/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ internal static class NativeMethods
public const int SCI_LINEENDDISPLAY = 2347;
public const int SCI_LINEENDDISPLAYEXTEND = 2348;
public const int SCI_HOMEWRAP = 2349;
public const int SCI_LINEREVERSE = 2354;
public const int SCI_HOMEWRAPEXTEND = 2450;
public const int SCI_LINEENDWRAP = 2451;
public const int SCI_LINEENDWRAPEXTEND = 2452;
Expand Down Expand Up @@ -1911,4 +1912,4 @@ public struct SCNotification

#endregion Structures
}
}
}
40 changes: 40 additions & 0 deletions src/ScintillaNET/Scintilla.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3395,6 +3395,26 @@ public override ImageLayout BackgroundImageLayout
}
}

/// <summary>
/// Gets or sets whether backspace deletes a character, or unindents.
/// </summary>
/// <returns>Whether backspace deletes a character, (false) or unindents (true).</returns>
[DefaultValue(false)]
[Category("Indentation")]
[Description("Determines whether backspace deletes a character, or unindents.")]
public bool BackspaceUnindents
{
get
{
return (DirectMessage(NativeMethods.SCI_GETBACKSPACEUNINDENTS) != IntPtr.Zero);
}
set
{
var ptr = (value ? new IntPtr(1) : IntPtr.Zero);
DirectMessage(NativeMethods.SCI_SETBACKSPACEUNINDENTS, ptr);
}
}

/// <summary>
/// Gets or sets the border type of the <see cref="Scintilla" /> control.
/// </summary>
Expand Down Expand Up @@ -5042,6 +5062,26 @@ public TabDrawMode TabDrawMode
}
}

/// <summary>
/// Gets or sets whether tab inserts a tab character, or indents.
/// </summary>
/// <returns>Whether tab inserts a tab character (false), or indents (true).</returns>
[DefaultValue(false)]
[Category("Indentation")]
[Description("Determines whether tab inserts a tab character, or indents.")]
public bool TabIndents
{
get
{
return (DirectMessage(NativeMethods.SCI_GETTABINDENTS) != IntPtr.Zero);
}
set
{
var ptr = (value ? new IntPtr(1) : IntPtr.Zero);
DirectMessage(NativeMethods.SCI_SETTABINDENTS, ptr);
}
}

/// <summary>
/// Gets or sets the width of a tab as a multiple of a space character.
/// </summary>
Expand Down

0 comments on commit 6fc4ac8

Please sign in to comment.