desjarlais / scintilla.net Goto Github PK
View Code? Open in Web Editor NEWA Windows Forms control, wrapper, and bindings for the Scintilla text editor.
License: MIT License
A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
License: MIT License
https://github.com/VPKSoft/Scintilla.NET/blob/2e458d140067a9167e3c30e3c8e7a9ab0a9cb163/Shared/Scintilla.cs#L48 - this assumes GetExecutingAssembly().Location is not null, which isn't always true. Using 'AppDomain.CurrentDomain.BaseDirectory' instead (or as a fallback if attached to the existing approach for other cases?) would avoid this.
Describe the bug
SetLexerByName does not cache the lexer created, instead it creates a new one each time.
To Reproduce
call SetLexerByName(valid_lexer_name) multiple times, each time a new handle is created
Expected behavior
call SetLexerByName(valid_lexer_name) multiple times, only the first time a new handle is created, this avoid a memory leakage in lexilla
a Dictionary<string, IntPtr>lexerName to Handle might be necessary.
this behavior is particularly important for applications dynamically selecting the lexer
Describe the bug
Error attempting to add control to .NET Framework project "Failed to create component 'Scintilla'."
To Reproduce
Expected behavior
The control is added to the form
I have noticed that in some cases regular win forms TextBox control is influenced by Scintilla.Net control in way that caret on TextBox control is jumping back and forth just by moving the mouse over the text box control. This happens when on single forms TextBox, Scintilla and TabControl are placed.
To Reproduce
Create simple windows forms app, .Net 8, add text box control, scintilla control and tab control. Run it, type some text in textbox and observe caret behavior when mouse is moved over it. There are no events assigned, just simple placing controls on the forms and run it.
It noticed two workarounds so far that removes this behavior:
Expected behavior
There should not be any influence on regular textBox control in any way.
Desktop (please complete the following information):
Thx
Ivan
As mentioned, I'm using Framework 4.8 on Windows 10 but this is also happening with 4.5.2.
I added Scintilla to a project with framework 4.5 however I need to update the framework to at least 4.5.2 and figured since I'm updating it, might as well update all the way up to modern day (sort of). Everything else updated fine however I'm getting an issue with Scintilla where it broke the form in the designer so I created a new project and tried to add it again and I'm met with an error message:
---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'Scintilla'. The error message follows:
'System.ComponentModel.Win32Exception (0x80004005): Could not load the Scintilla module at the path 'C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\16.0_a4ee1e43\ProjectAssemblies\l7qy_paq01\..\..\build\x86\Scintilla.dll'. ---> System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
at ScintillaNET.Scintilla.get_CreateParams()
at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
at System.Windows.Forms.Control..ctor()
at ScintillaNET.Scintilla..ctor()'
---------------------------
OK
---------------------------
I've tired a couple different versions and still nothing. I might be missing something simple but I feel like I've exhuasted all of my ideas.
Steps to Reproduce
Thank you for your good work and support!
EDIT: I should mention that both my main app and test app are both 32bit.
It seems that the Scintilla.NET v3.3.3.6 package is not released: the latest one available in the NuGet Gallery is v5.3.2.9.
But version 5.3.2.9 in NuGet Gallery doesn't work anymore either.
I am upgrading a .NET 4.5.2 project from the old CodePlex Scintilla.NET v2.5.2 to VPKSoft ScintillaNET v5.3.1.3. I've got everything working except the autocomplete. The main problem that I'm running in to is that the old component had and AutoCompleteList property, and I can't find a corresponding property on the new component.
Looking at your wiki, I saw the link to the AutoCompleteMenu-ScintillaNET project. However, when I tried to install that package, I found that it only supports .NET 4.6.1.
Is there an autocomplete solution that I can use for .NET 4.5.2?
I'm trying to implement an undo/redo for Scintilla.NET. I have implemented the undo ... but for the life of me I cannot implement the redo.
Scintilla.NET has a built-in undo, but its Redo() does not work and CanRedo is read-only and set to false when I test for it.
Anyone have any ideas on how to implement/activate the redo?
(Yes, I have done a Google search and here for this issue and found nothing.)
How do I set the encoding of Scintilla.NET
Coming with Scite v 5.4.0, new versions for scintilla.dll and lexilla.dll ((2023/11/18))
Scintilla: 5.3.9 -> 5.4.0
Lexilla: 5.2.9 -> 5.2.9
(Thanks to Joachim Mairböck)
It's OK when .Technology = Default, specified font will be displayed.
When .Technology = Technology.DirectWrite, it seems font is reset to default.
do I need to set something else?
Describe the bug
CaretLineBackColor is black by default when adding the control to a form.
To Reproduce
Expected behavior
CaretLineBackColor should be white
Hello! Could you add the AutoIt language to the build?
is StyleNeeded still supported? how to activate without Lexer.Container ?
will this be supported?
Context
As ScintillaNET
(https://github.com/jacobslusser/ScintillaNET) is archived and not supported anymore, I upgrade to Scintilla.NET
. And Lexer.Container
is not supported since scintilla 5.0+
and with no default, lexer Null is accepted only.
With that, when I defined my own language, Styules and set Lexer.Null I do not get StyleNeeded notification anymore.
** Project info:
.net8.0
After days of unsuccessful attempts to use the VPK package Scintilla.NET for CSS files, I found the VPK project ScintillaLexers-v.1.1.15 which was to bring me the solution to the configuration of Scintilla and the Css lexer (with in addition the recovery of Notepad++ parameters).
Unfortunately, the display of a css file by TestLexer is incorrect (see image).
Would you have the solution?
Describe the bug
Hi, first of all, thanks for taking up the job of maintaining Scintilla.NET.
There is some kind of issue in the way which the package deals with wide characters. It affects searching and indicator fills, and probably much more.
I am not well versed in the internals of Scintilla so I will demonstrate with an example.
To Reproduce
Steps to reproduce the behavior:
Create a new project.
Add a Scintilla control and a button.
In Form1_Load, add the following code:
scintilla1.Text = "ä ä ä";
Note that ä is encoded as 0xC3 0xA4 in UTF8. I doubt the exact characters matter, the string just has to be of the form "{wide} {wide} {wide}".
In the button's click handler, add the following code:
scintilla1.IndicatorCurrent = (int)8;
scintilla1.IndicatorClearRange(0, scintilla1.TextLength);
scintilla1.IndicatorFillRange(0, 1);
scintilla1.IndicatorFillRange(2, 1);
scintilla1.IndicatorFillRange(4, 1);
The intention here is to underline every "ä" when the button is clicked.
Expected behavior
Every ä should have line under it, like so:
This is what happens in version 5.3.3.6.
However, starting with version 5.3.3.9, it actually looks like this:
It looks the same in 5.3.3.16. It looks like it's just underlining the first ä and the space. It seems very likely that the underlying issue is due to the handling of wide characters.
Desktop (please complete the following information):
Additional context
Possibly related to #65 ?
Originally posted by VPKSoft September 8, 2023
Hi,
I'm looking for someone to take over this project. I'm just currently too busy and my interests are elsewhere to keep maintaining this.
This also applies to the satellite assemblies:
It has been fun for over three years with this project after continuing from the original, which was abandoned after Oct 31, 2018. That is why I wish to transfer the ownerships of these projects rather than leaving them unmaintained in silence.
Please reply to this message in public if you wish to continue with the project or some of these satellite assemblies 👍
Coming with Scite v 5.3.9, new versions for scintilla.dll and lexilla.dll (
Scintilla: 5.3.7 -> 5.3.8
Lexilla: 5.2.7 -> 5.2.8
Attached files dated 11/06/2023
dlls.zip
Is there any way to make default SQL lexer case insensitive without the need of create my own lexer?
In the README, ScintillaNET-FindReplaceDialog
is mentioned/linked. That's something that I use, but the NuGet package I use has a dependency on jacobslusser.ScintillaNET
.
Could you fork that repo and put it in NuGet with a dependency on your package? I could fork it and make it dependent on your package, but I think it would make more sense to have it under one maintainer.
Describe the bug
When I use WrapMode.Word, scintilla.Lines.Count
is not lines of content currently displayed.
Coming with Scite v 5.4.0, new versions for scintilla.dll and lexilla.dll ((2023/11/18))
Scintilla: 5.3.9 -> 5.4.0
Lexilla: 5.2.9 -> 5.2.9
dlls.zip
Describe the bug
The length
parameter of the GetTextRange
method is not consistent with the TextLength
property and other length/positional properties of Scintilla.NET.
To Reproduce
var text = "😁😁😁";
Assert.AreEqual(6, text.Length); // Succeeds, because each 😁 is 2 characters wide
Assert.AreEqual("😁", text.Substring(0, 2)); // Succeeds
scintilla1.Text = text;
Assert.AreEqual(6, scintilla1.TextLength); // Succeeds
Assert.AreEqual(6, scintilla1.Lines[0].EndPosition); // Succeeds
Assert.AreEqual("😁", scintilla1.GetTextRange(0, 2)); // Fails, as GetTextRange returns "😁😁"
Expected behavior
GetTextRange
should have consistent behavior with the other length/position properties and methods of Scintilla.NET. The inconsistency is illustrated above. Alternatively, there should be another method or an optional parameter that lets us specify how wide characters should be handled.
I am recieiving the following warning in project using Scintilla.NET 5.3.2.9, the latest version.
warning CS0618: 'Scintilla.Lexer' is obsolete: 'This property will get more obsolete as time passes as the Scintilla v.5+ now uses strings to define lexers. Please use the LexerName property instead.'
I cant find any documentation on what the valid Lexername values are.
On the page Automatic Syntax Highlighting it still shows the example scintilla.Lexer = Lexer.Cpp;
Describe the bug
For some reason, TextLength is not reporting a valid result. I set Text property with a string consisting of 95 characters, and yet, TextLength reports 158!
To Reproduce
var s = "MyProductName5 version 1.2.0.0\r\n© 2022 Name of Developer, [email protected]\r\n\r\ninput 1 >\r\n";
this.Text = s;
var n1 = s.Length; // 95
var n2 = this.TextLength; // 158
Expected behavior
TextLength should have reported 158 given the string passed.
Desktop (please complete the following information):
to verify:
WPF + WindowsFormsHost application
.Net 6
Scintilla.NET v5.3.2.9
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" xmlns:ScintillaNET="clr-namespace:ScintillaNET;assembly=Scintilla.NET" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <WindowsFormsHost> <ScintillaNET:Scintilla x:Name="Text" Margin="10,31,10,10"> </ScintillaNET:Scintilla> </WindowsFormsHost> </Grid> </Window>
`using ScintillaNET;
using System.Windows;
namespace WpfApp1
{
///
Text.StyleResetDefault();
Text.Styles[ScintillaNET.Style.Default].Font = "Consolas";
Text.Styles[ScintillaNET.Style.Default].Size = 10;
Text.Styles[ScintillaNET.Style.Default].ForeColor = System.Drawing.Color.Black;
Text.StyleClearAll();
Text.Lexer = Lexer.Json;
Text.Styles[ScintillaNET.Style.Json.Default].ForeColor = System.Drawing.Color.Black;
Text.Styles[ScintillaNET.Style.Json.Number].ForeColor = System.Drawing.Color.Blue;
Text.Styles[ScintillaNET.Style.Json.String].ForeColor = System.Drawing.Color.Blue;
Text.Styles[ScintillaNET.Style.Json.StringEol].ForeColor = System.Drawing.Color.Purple;
Text.Styles[ScintillaNET.Style.Json.PropertyName].ForeColor = System.Drawing.Color.Brown;
Text.Styles[ScintillaNET.Style.Json.EscapeSequence].ForeColor = System.Drawing.Color.Red;
Text.Styles[ScintillaNET.Style.Json.LineComment].ForeColor = System.Drawing.Color.DarkGreen;
Text.Styles[ScintillaNET.Style.Json.BlockComment].ForeColor = System.Drawing.Color.DarkGreen;
Text.Styles[ScintillaNET.Style.Json.Operator].ForeColor = System.Drawing.Color.LightGray;
Text.Styles[ScintillaNET.Style.Json.Uri].ForeColor = System.Drawing.Color.LightGray;
Text.Styles[ScintillaNET.Style.Json.CompactIRI].ForeColor = System.Drawing.Color.LightGray;
Text.Styles[ScintillaNET.Style.Json.Keyword].ForeColor = System.Drawing.Color.LightGray;
Text.Styles[ScintillaNET.Style.Json.LdKeyword].ForeColor = System.Drawing.Color.LightGray;
Text.Styles[ScintillaNET.Style.Json.Error].ForeColor = System.Drawing.Color.Red;
Text.Text = "[{ \"hello\":\"world\",\"lexer error\":true},{ \":)\":false}]";
}
}
}
`
you can see this result:
the boolean will be parsed as ScintillaNET.Style.Json.Error and will continue until a new line is found :(
I'd like to request the ability to customize modulePathScintilla and modulePathLexilla
Right now this isn't possible because the relevant parts in Scintilla.cs are marked as private (not protected)
Another option could be to allow us to define some configuration options, or just expose the statics and make them writeable
Describe the bug
When you try to add the ScintillaNet control to a Form in a WinForms app (.NET Framework 4.5+) you get an exception instead of the control being added.
Error Message
Failed to create component 'Scintilla'. The error message follows:
'System.ComponentModel.Win32Exception (0x80004005): Could not load the Scintilla module at the path 'C:\Users<UserName>\AppData\Local\Microsoft\VisualStudio\17.0_877463f4\ProjectAssemblies\pa0jc1fh.tmw01....\build\x64\Scintilla.dll'. ---> System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
at ScintillaNET.Scintilla.get_CreateParams()
at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
at ScintillaNET.Scintilla..ctor()'
To Reproduce
Expected behavior
The control is added to the form without any exception. This is the case with version 5.3.2.3 and older
Environment:
If I'm not mistaken, the two "change history" methods have yet to be implemented: https://www.scintilla.org/ScintillaDoc.html#SCI_SETCHANGEHISTORY
Hi, I'm trying to change the style to highlight some words in color and bold. So I use the code below. Color is changing fine, but words aren't bold.
scintilla1.Styles[ScintillaNET.Style.Sql.Identifier].ForeColor = Color.LightGray;
scintilla1.Styles[ScintillaNET.Style.Sql.Identifier].Bold = true;
I did further testing and bold, italic and size properties aren't changing visuals of the text. Am I doing something wrong or is it a bug?
scintilla1.Styles[ScintillaNET.Style.Sql.Identifier].Italic = true;
scintilla1.Styles[ScintillaNET.Style.Sql.Identifier].Size = 100;
You previously had a build that signed with a strong name key: https://www.nuget.org/packages/unofficial.ScintillaNET.Signed
It would be great if you create a signed build for the current version
Describe the bug
To Reproduce
Steps to reproduce the behavior:
when I set the line number margin as scintilla.Margins[0].Width= 20;
the cursor start position of all the text fields in the form move to 20 px from the left
Expected behavior
scintilla configuration should not impact to other components.
Desktop (please complete the following information):
Additional context
hope you can help to resolve this issue.
@lgaudouen wrote:
Appearance in design mode related to the CaretLineVisible, CaretLineVisibleAlways, CaretLineBackColor and CaretLineBackColorAlpha properties. When inserting a Scintilla.NET control, the name of the control appears clearly and the values of the CaretLineVisible, CaretLineVisibleAlways properties are set to False by default. If you close the form designer and reopen it, the CaretLineVisible property automatically changes to True.
I get this exception in" VisualStudio 2015" and a crash in "Visual Studio 2022" after changing the property "RightToLeft" (Me.Scintilla1.RightToLeft = System.Windows.Forms.RightToLeft.Yes).
In Windows EventViewer i get these entries:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ScintillaNET.Scintilla.DirectMessage(IntPtr, Int32, IntPtr, IntPtr)
at ScintillaNET.Scintilla.DirectMessage(Int32, IntPtr, IntPtr)
at ScintillaNET.Scintilla.DirectMessage(Int32, IntPtr)
at ScintillaNET.Scintilla.InitDocument(ScintillaNET.Eol, Boolean, Int32, Int32)
at ScintillaNET.Scintilla.OnHandleCreated(System.EventArgs)
at System.Windows.Forms.Control.WmCreate(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at ScintillaNET.Scintilla.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Design.ControlDesigner+DesignerWindowTarget.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Design.ControlDesigner.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Design.ControlDesigner+DesignerWindowTarget.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)
Name der fehlerhaften Anwendung: devenv.exe, Version: 14.0.25420.1, Zeitstempel: 0x57685d85
Name des fehlerhaften Moduls: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x0000016a
ID des fehlerhaften Prozesses: 0x3af8
Startzeit der fehlerhaften Anwendung: 0x01d84fc6e411fb12
Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Pfad des fehlerhaften Moduls: unknown
Berichtskennung: 2b4225c9-eb61-447d-8e05-6a952d6fdb6f
Vollständiger Name des fehlerhaften Pakets:
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
Hi! I'd like to use Scintilla.NET to be able to show colored git diff
results.
TortoiseGit uses scintilla to that effort so it should be possible in theory.
In SciTE, after adding a lexer.errorlist.escape.sequences=1
property in an options file, and setting the lexer to Errorlist via the Language menu, the escape codes are parsed fine.
git diff --color=always.txt
However, despite setting the property to 1 and using errorlist as our lexer, the escape codes are still shown as is, instead of being interpreted.
Am I missing something or is there something that could be improved to make them work?
Hello everyone, i have a small issue that is driving me crazy, i setup my styles like the example below now when i run the app and load a file everything shows ok an i intentionally want the editor font and the line number font to be different now when i change the font from a font dialog and save the value to a settings file i call for those 2 voids to update the fonts of the editor now what happens is both line numbers and editor font change together. so my question is does scintilla1.Styles[Style.Default].Font overwrite the line numbers font and why ?
how things are supposed to be when i first load the app ( excuse the crazy fonts, just to showcase the difference )
Here is how it becomes after changing the font
public void jsonStyling()
{
// scintilla1.StyleClearAll();
// Configure thejson style
scintilla1.StyleResetDefault();
string? tt = Properties.Settings1.Default.DeFont.OriginalFontName;
scintilla1.Styles[Style.Default].Font = tt;
scintilla1.Styles[Style.Default].SizeF = Properties.Settings1.Default.DeFont.Size;
scintilla1.Styles[Style.Default].Italic = Properties.Settings1.Default.DeFont.Italic;
scintilla1.Styles[Style.Default].Bold = Properties.Settings1.Default.DeFont.Bold;
scintilla1.Styles[Style.Default].ForeColor = Properties.Settings1.Default.Dforecolor;
scintilla1.Styles[Style.Default].BackColor = Properties.Settings1.Default.EditorBC;
cintilla1.StyleClearAll();
scintilla1.LexerName = "json";
scintilla1.SetKeywords(0, "false true");
scintilla1.SetProperty("lexer.json.allow.comments", "1");
scintilla1.SetProperty("lexer.json.escape.sequence", "1");
scintilla1.Styles[Style.Json.Default].ForeColor = Color.Turquoise;
scintilla1.Styles[Style.Json.LineComment].ForeColor = Color.FromArgb(0, 128, 0); // Green
scintilla1.Styles[Style.Json.Number].ForeColor = Color.OrangeRed;
scintilla1.Styles[Style.Json.String].ForeColor = Color.LightSkyBlue;
scintilla1.Styles[Style.Json.EscapeSequence].ForeColor = Color.LightBlue;
//Brackets colors
scintilla1.Styles[Style.Json.Operator].ForeColor = Color.Yellow;
scintilla1.Styles[Style.Json.Operator].Bold = true;
//property name
scintilla1.Styles[Style.Json.PropertyName].ForeColor = Color.AliceBlue;//LightBlue;
scintilla1.Styles[Style.Json.PropertyName].Italic = true;
//Keywords
scintilla1.Styles[Style.Json.Keyword].ForeColor = Color.Green;
//Errors
scintilla1.Styles[Style.Json.Error].ForeColor = Color.Red;
//Braces colors
scintilla1.Styles[Style.BraceLight].ForeColor = Color.Orange;
scintilla1.Styles[Style.BraceBad].ForeColor = Color.Red;
// Set the keywords
}
and
public void UiStyling()
{
scintilla1.CaretStyle = ScintillaNET.CaretStyle.Line;
string caretStyleValue = Properties.Settings1.Default.CaretStyle; // Get the value from the settings
switch (caretStyleValue)
{
case "Line":
scintilla1.CaretStyle = ScintillaNET.CaretStyle.Line;
break;
case "Block":
scintilla1.CaretStyle = ScintillaNET.CaretStyle.Block;
break;
case "Invisible":
scintilla1.CaretStyle = ScintillaNET.CaretStyle.Invisible;
break;
default:
scintilla1.CaretStyle = ScintillaNET.CaretStyle.Line; // Handle the case where the value is none of the expected options
break;
}
scintilla1.Margins[1].BackColor = Properties.Settings1.Default.MarginBackcolor;
scintilla1.Margins[0].Type = MarginType.Number;
scintilla1.Margins[0].BackColor = Properties.Settings1.Default.MarginBackcolor;
scintilla1.Styles[Style.LineNumber].BackColor = Properties.Settings1.Default.uLineNumBc; //Color.FromArgb(12, 12, 12);
scintilla1.Styles[Style.LineNumber].ForeColor = Properties.Settings1.Default.uLineNumFc; //Color.Red;
scintilla1.Styles[Style.LineNumber].Font = "Algerian"; //Properties.Settings1.Default.DeFont.OriginalFontName;
scintilla1.Styles[Style.LineNumber].SizeF = 16;
scintilla1.Styles[Style.IndentGuide].ForeColor = Color.Aquamarine;
}
public string LexerName
{
get => lexerName;
set
{
if (string.IsNullOrWhiteSpace(value))
{
lexerName = value;
return;
}
if (!SetLexerByName(value))
{
throw new InvalidOperationException(@$"Lexer with the name of '{value}' was not found.");
}
lexerName = value;
}
}
the line testing for if (string.IsNullOrWhiteSpace(value)) prevent from SetLexerByName being passed an empty string
Coming with Scite v 5.3.8, new versions for scintilla.dll and lexilla.dll (
Scintilla: 5.3.6 -> 5.3.7
Lexilla: 5.2.6 -> 5.2.7
Attached files dated 09/22/2023
dlls.zip
If SetLexerByName(value)
fails, then lexerName is not yet set, and so not reported (or the previous version is reported) in the exception message.
set
{
if (string.IsNullOrWhiteSpace(value))
{
lexerName = value;
return;
}
#if SCINTILLA5
if (!SetLexerByName(value))
{
throw new InvalidOperationException(@$"Lexer with the name of '{lexerName}' was not found.");
}
#elif SCINTILLA4
if (NativeMethods.NameConstantMap.ContainsValue(value))
{
Lexer = (ScintillaNET.Lexer) NativeMethods.NameConstantMap.First(f => f.Value == value)
.Key;
}
#endif
lexerName = value;
}
@VPKSoft
Terve!
I would like to ask if it would be possible to add support for the SCI_SETSELECTIONLAYER
native method. I was trying to make current line highlighting to work and I used this:
scintillaEditor.CaretLineVisible = true;
scintillaEditor.CaretLineBackColor = Color.Black;
scintillaEditor.CaretLineBackColorAlpha = 255;
The problem was that the line was painted full black over the text! After some trial and error I realized that SCI_SETSELECTIONLAYER
could do the trick. More details in scintilla documentation here. I searched for something similar in Scintilla.cs and NativeMethods.cs but I couldn't find anything so I suppose it's not implemented. For me it was as easy to get the desired result by writing
private const int SCI_SETCARETLINELAYER = 2765;
...
scintillaEditor.DirectMessage(SCI_SETCARETLINELAYER, new IntPtr(1), IntPtr.Zero);
But it might be more streamlined if the SC_LAYER_xyz
constants were an enum and there was a respective property to set.
I might be wrong though as I am really new to Scintilla(.net) and I might be missing something.
PS: If I'm right though, I could open a pull request if you lack the time.
I want to create a space between the lines and between the written characters, how can I do this?
I downloaded latest available source code. Took sample application provided within the repo, add Scintilla.Net control source code as project reference to solution. Program compiles fine and runs, but when in designer mode Scintilla control not visible neither on the form nor control toolbox. Usually I get it through nuget and no issues theres, only in this case when source code is used as part of solution.
Additional issue/request: by default current row is highlighted in black color, meaning you can not see what you type (as font by default is also black), neither caret is visible. Can be confusing for beginners, like it confused also me when switched to this project version - i thought something is wrong with control.
Environment is Win11, VS 17.8.3
Thx
Ivan
Hi!
Github issue from original branch
Step-by-step reproduction
Request failures: DesignerHosts/CreateComponent.
Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Method not found: 'Void System.Security.AccessControl.MutexAccessRule..ctor(System.Security.Principal.IdentityReference, System.Security.AccessControl.MutexRights, System.Security.AccessControl.AccessControlType)'.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
Detailed description of problem from Devexpress
I understand that you do not use commercial libraries, but please see what you can do
Thanks!
Well I'm trying to activate (show) the autocomplete list box always when the user hits CTRL+SPACE in the Scintilla edit control, independent of what was actually typed so far. (I'm using V5.3.2.9)
Here's my code:
private void edScintillaSql_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.Space && sender is Scintilla sc)
{
string s = "Some|Prepared|Entries";
if (!string.IsNullOrEmpty(s))
sc.AutoCShow(-1, s);
e.Handled = true;
}
}
This actually already works fine. But when the user hits that key combination (Control+Space), a space character is still inserted, even though I try to suppress it by setting e.Handled = true
. When the user then picks an entry from the list that space is removed again. But if he/she doesn't, the space input remains in the text.
How can I make it so the the space doesn't get instered at all?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.