Thursday, June 29, 2006

Video: HTML Snippets

In previous post I was writing about snippets' syntax. Now it's time to show you how it works in practice. Video shows building HTML structure with simple tag snippets. Enjoy:

6 Comments:

Anonymous Michel said...

Wow looks good. Im a textmate user, but im forced to work on windows.
This looks like it could be my new texteditor on the windows platform.
Keep up the good work!

3:59 AM

 
Anonymous Joseph said...

Keep up the excelent work on this editor. I can't wait when you worked out all the instabilities.

Great video by the way, verry powerful.

Greets

3:52 PM

 
Anonymous Anonymous said...

Hello Martin, this looks very interesting. I'm curious how the live mirroring works. Is it implemented in Lua? Or is it in Scintilla's C++ or even another
language? I have tried live updating snippets (http://caladbolg.net/scite.php#snippets) with Lua, but there were too many
variables (especially deleting typed text).

12:58 PM

 
Anonymous mitchell said...

Sorry about the anonymous comment, as the options weren't saved when I previewed it.

1:08 PM

 
Blogger Martin Cohen said...

mitchell: It's C++. And the answer for this is rather complex.

In implementation, tabstop is called "input placeholder" and mirror "output placeholder". Placeholders are in fact ranges of text organized in a tree (something like AST).

Input has zero or more outputs. When you change tabstop's value, the change is distributed to it's output phs. There is a controller which is taking care of putting the values into right places and synchronizing ranges with changes. It doesn't care of if you are inserting or deleting text. Unless you are outside of any active placeholder. And if you are outside, it simply renders (deactivates) a relevant subtree of placeholders in the tree.

There is some other functionality that allows user to move caret by arrows or mouse to another (non-ambigious) placeholder.

2:37 AM

 
Anonymous Anonymous said...

Your article is very informative and helped me further.

Thanks, David

2:04 PM

 

Post a Comment

<< Home