Skip to content

Commit 7cb1292

Browse files
author
Sébastien Geiser
committed
CurrentEOL Correction
1 parent 114ec45 commit 7cb1292

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CSharpRegexTools4Npp/BNpp.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class BNpp
88
{
99
public static NotepadPPGateway NotepadPP { get; private set; } = new NotepadPPGateway();
1010

11+
public static ScintillaGateway Scintilla => new ScintillaGateway(PluginBase.GetCurrentScintilla());
12+
1113
/// <summary>
1214
/// Récupère les caractères de fin de lignes courant
1315
/// !!! Attention pour le moment bug. !!! Enlève la coloration syntaxique du fichier courant
@@ -17,14 +19,14 @@ public static string CurrentEOL
1719
get
1820
{
1921
string eol = "\n";
20-
int value = Win32.SendMessage(PluginBase.nppData._nppHandle, SciMsg.SCI_GETEOLMODE, 0, 0).ToInt32();
22+
int value = Scintilla.GetEOLMode();
2123

22-
switch (value)
24+
switch ((SciMsg)value)
2325
{
24-
case 0:
26+
case SciMsg.SC_EOL_CRLF:
2527
eol = "\r\n";
2628
break;
27-
case 1:
29+
case SciMsg.SC_EOL_CR:
2830
eol = "\r";
2931
break;
3032
default:

0 commit comments

Comments
 (0)