Page 1 of 1
text editor with snippets
Posted: Wed Sep 04, 2013 5:43 pm
by TADS
Evening All.
i would like to make my own text editor that has "built in snippets".... i can do the highlighting etc i use ScintillaNET but unable to find any information on how i can use snippets, unless someone here has done this before? i have used this to make "keywords" but not full snippets.
or any ideas on how i could go about doing this sort of project? My mind is just "A Blank" atm and can not think of the best way to do it.
Hope someone has some ideas
Thanks
Kev
Re: text editor with snippets
Posted: Wed Sep 04, 2013 7:51 pm
by comathi
I'm not exactly sure what you mean by "snippets".
If you mean you want to insert code snippets and highlight them according to the language in which they're written, I would think that's done in the same way as individual tags, just multiple times inside the snippet... What I'm saying might be a little unclear as well lol :?
Re: text editor with snippets
Posted: Wed Sep 04, 2013 8:07 pm
by TADS
hi thanks for the reply.
yea i want to insert code snippets the highlight is done auto now anyways. i just can not think how i can "store" snippets and use them as i need them... it would be nice to start typing and you can select the snippet from the auto list that pops up.
codeview.jpg
as you see from the image i have "keywords" workiing, i just can not remember how to do the snippets! :(
Kev
Re: text editor with snippets
Posted: Wed Sep 04, 2013 8:41 pm
by comathi
Okay, I understand... Well you would first need to detect whether or not the code that has been typed is part of a snippet (this could be difficult if there are more than one syntaxes, or parameters within the snippet) and then display the snippets for which this is true.
As for storing them, you could probably have a plain text file somewhere where the snippets are written down and seperated by some special character chain. Moreover, this could enable the user to add custom snippets and have them displayed along with the built-in ones.
Re: text editor with snippets
Posted: Thu Sep 05, 2013 6:18 am
by Filip
I think you could use mysql database and store it on some web server. Then get the xml fe which would be cached for offline mode.
Re: text editor with snippets
Posted: Thu Sep 05, 2013 4:54 pm
by TADS
its ojk, i have worked out how to do it with ScintillaNET again.
Thanks for the replys