How can I disable that the : sense as separator of words?

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by ais
Version: 4.0.0242
Avatar
For example, method GetCurrentWordText() for word "ab:cd" resume "ad" or "cd", but I want get the "ad:cd".

Comments (4)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you are using a MergableSyntaxLanguage (dynamic languages included), it is using the DefaultWordBreakFinder in the WordBreakFinder property. Cast it to that and add ':' to its WordContainsAdditionalCharacters property.

Alternatively if you are using a dynamic language you can specify the WordContainsAdditionalCharacters right in the root SyntaxLanguage tag of your XML definition. The ActiproSoftware.SQL.xml sample shows an example.


Actipro Software Support

Posted 17 years ago by ais
Avatar
Both method doesn't work currect.
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DynamicSyntaxLanguage language = new DynamicSyntaxLanguage();
            language.DefinitionXml = Properties.Resources.ActiproSoftware_XML;
            syntaxEditor1.Document.Language = language;
            syntaxEditor1.Text = "<ab:cd test=\"ab:cd\">";
            syntaxEditor1.IntelliPrompt.MemberList.Add(new IntelliPromptMemberListItem("qw:er", 0));
            syntaxEditor1.IntelliPrompt.MemberList.Add(new IntelliPromptMemberListItem("as:df", 0));
            syntaxEditor1.KeyTyped += new KeyTypedEventHandler(syntaxEditor1_KeyTyped);
        }

        private void syntaxEditor1_KeyTyped(object sender, KeyTypedEventArgs e)
        {
            if (e.KeyChar == ' ')
            {
                syntaxEditor1.IntelliPrompt.MemberList.Show();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = syntaxEditor1.SelectedView.GetCurrentWordText();
        }
    }
Where Properties.Resources.ActiproSoftware_XML is ActiproSoftware.XML.xml with
WordContainsAdditionalCharacters="_:-"
.GetCurrentWordText() return :cd or :
And other problem, when I show IntelliPrompt.MemberList and try to type "as:df", when I press ':' the "qw:er" is chosen.
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry, you also need to remove ':' from the WordStandaloneCharacters.

So change your attributes to this:
WordContainsAdditionalCharacters=":" WordStandaloneCharacters=".,()&lt;&gt;[]{}?!\/;'&quot;"
For the member list, add ':' to the IntelliPrompt.MemberList.AllowedCharacters collection and that will resolve that.


Actipro Software Support

Posted 17 years ago by ais
Avatar
Thanks
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.