PDA

View Full Version : Syntax Highlighting


seanferns
07-04-2012, 02:19 AM
I was trying to get syntax highlighting working for SQL files and came across this thread: http://www.kinook.com/Forum/showthread.php?t=4780

I need to be able to create sql docs with syntax highlighting just like creating text so I followed what the 4th post says:
Another option is to import a source code file as a template in UR and use UR's text file syntax highlighting.
http://www.kinook.com/UltraRecall/Ma...itordialog.htm


Here is the problem: I created a template based on a dummy.sql file and while importing, selected to move the file. I then create an item based on this template and get syntax highlighting. Now if I have two or more such items and do a sync even by mistake I would lose all but the last sql. The thing is that although the data is stored in UR it still has a URL and that is the same across the items created ( if this was an expression pointing to ItemID it might resolve this). Also, to get the highlighting effect, the extension is picked from the URL. If the content-type was editable or if there was some other field to denote it that might be a better solution.
One minor point is that when changing the title of a stored item, the "[Stored]" next to the name disappears. Going to another item and then back works.

kinook
07-04-2012, 08:41 AM
Works ok in my tests. See http://www.kinook.com/Download/Temp/SQL.zip (you will need a recent version of WinZip or 7-Zip to extract).

seanferns
07-04-2012, 10:17 AM
Subsequent to the last step in your video just click on either abc.sql or def.sql, and press Ctrl-F5. The thing is that these two sqls could be placed at different places in the Data Explorer and either one could be refreshed along with other items resulting in unknowingly destroying the data elsewhere.

Separate from the above, I am trying to get a hang of the synchronization mechanism.
1. Import a folder called testUR (initially empty)
2. then create a temp.txt in Windows Explorer(WE).
3. Next press Ctrl-F5 in Data Explorer(DE), temp.txt is added.
4. Now in DE create a folder "test" below "testUR" and sync again on testUR. "test" in now visible in WE.
5. Now in WE delete the test folder and press Ctrl-F5 in DE. "test" is now recreated in WE. Why ?
6. delete "test" in DE and sync "testUR", and "test" is recreated. Why ?
Points 5 and 6 seem to be in conflict. What are the rules for sync when data could be modified in both places ?

kinook
07-04-2012, 11:11 AM
I don't think creating stored items within UR and then syncing them is very common, but yes, you would want to make each item's URL attribute unique if you will be doing that.

Syncing is two-way, non-destructive (UR won't delete items/files on either end of a sync operation).