> There is a shadow tiddler "StyleSheetCodeMirror" that is there for this 
>>> reason. adjust this one.
>>> You should _not_ mess with tiddlywiki.css for compatibility reasons. It 
>>> comes from codemirror.net. use StyleSheetCodeMirror.
>>>
>> Actually, I didn't get how to apply Arial fonts only for 
>> "text/x-tiddlywiki" content. I can't see any difference between DOM of 
>> tiddlers with different content-type. What selector should I use instead of 
>> just
>>
>> .CodeMirror-lines { font-family: Arial; }
>>
>> to get this working for certain content-type?
>>
> OK. Now I understand, what you want. I think, there is no possibility at 
> the moment. As I wrote, for my editor I have been using a "monospace" font 
> since I discovered MPTW (Monky Pirate TW) and it probably will allways be a 
> monospace settings.
>
> I'm not sure if it is possible that every editor has its own theme. I 
> think this need is new even to the cm library folks. 
>
> Well, what I expected was that a tiddler element has an attribute, like 
"contentType". In this case, CSS can be composed just like tag-based CSS 
can be composed:

div[tags~="code"].editor     { font-family: monospace; }

I'm not sure about the hyphen in the "content-type", so I propose 
"contentType" so that

div[contentType="text/x-tiddlywiki"].editor     { font-family: Arial; }

is available. Or may be "codeMirrorContentType" or "mimeType" is better 
because doesn't imply someone knows this is for the CodeMirrorPackage.

>
> as you can see, there is a global section, that defines the default.
>>> Every mime section will overwrite the default setting.
>>>
>>
>> Right, this solved the issue. What are MIMEs and what are modes?
>>
> The internal library config structure accepts both. ... 
>>
>
> A mode is something that is stored in the git repo dir: 
> https://github.com/marijnh/CodeMirror/tree/master/mode
> One mode can be responsible for different MIME types (
> http://en.wikipedia.org/wiki/MIME and 
> http://en.wikipedia.org/wiki/Internet_media_type). File TW doesn't make 
> use of MIME types at the moment but TiddlyWeb/Space can use it per tiddler. 
>
> I've heard of MIMEs, but I mean the values: <<cmModes>> sais "null, ...", 
>> <<cmMimes>> sais "text/plain, ..."; in CodeMirrorConfig:
>>
>
> What confuses me here is..
 

> !!! null
> >default mode has an unlucky name
> {{{
> tags: 
> *mode: text/plain <-   should this be null? is this a mime or a mode?*(and 
> what about the section's name?)
>
> Here we have *mode* in the header and *mime* in the mode.. slice, I 
believe.
 

> That's why I wrote the "default mode has an unlucky name" comment. The 
> mode imo should be "default" or something like this. If you create a new 
> tiddler, it doesn't have a "custom filed" named: content-type. So it uses 
> the default settings, with the unlucky name "null" 
>
> !!! tiddlywiki
> {{{
> tags: 
> *mode: tiddlywiki <-  this makes me think that in the "null" section, 
> there's a mistake..*
>
> and here we have *mode* in *both* header and slice. "text/plain" is the 
name of the mime, not mode, isn't it? So why mime name in the mode "slice" 
(in the "null" section)?
 

> nope. The library takes / needs to be able to use both values. 
>
> eg the js mode: http://codemirror.net//mode/javascript/index.html
> defines: text/javascript, application/json, text/typescript, 
> application/typescript MIMEs
>
> If you don't tell the "mode library" which MIME it should use for 
> highlighting, it'll use "text/javascript" which most likely is what the 
> user wants. _But_ since the mode can also handle "text/typescript" which is 
> very similar but different, you'll need to initialize the mode in the right 
> way. 
>
> http://codemirror.net/2/doc/manual.html contains the docs for all 
>> possible parameters. 
>> See the "/2/" there!!
>>
>  
>
>> Is it ok that CodeMirrorConfig contains the 
>> http://codemirror.net/manual.html link, than?
>>
> good catch - fixed
>
> BTW
>> If you are in edit mode and hit <F11> the edit area will be adjusted to 
>> the browser viewport height. 
>> <F11> toggle height. The toggle status will be saved with the tiddler.
>>
>
> Hmm.. in both Opera and FireFox on pressing F11 I get browser's "full 
>> screen toggling" and the height is not changed.
>>
>
> If the cursor is inside the edit area <F11> is handled by ExtraKeysAddOn 
>
> Ah, ok, with the addon this does work. By the way, pushing F11 also causes 
the editor to think smth was edited. Yeah, well, like you said, if any key 
is pressed..

There's one more bug I've run into, rather complicated one. Previously I 
>> mentioned that I get the
>>
> "Are you sure you want to abandon your changes to '...'?"
>>>
>> dialogue in cmEdit when I changed something but in the end the content is 
>> the same. No I've found a situation when the dialogue appears even if I 
>> haven't done any changes literally, and not only in the cmEdit mode, but 
>> also in the edit mode! How to reproduce.. as far as I can tell those are 
>> tiddlers created in a tiddlywiki without CodeMirrorPlugin(s). That's a 
>> behaviour that tiddlers created before CodeMirror had, and they lose it 
>> after I "edit" and save with CodeMirror; such behaviour is given to 
>> tiddlers that I create when I disable CodeMirrorPlugin(s) (disable - 
>> restart - create - enable - restart - open to "edit" and cancel).
>>
>
> There is a TW2 option "chkForceMinorUpdate" in the "backstage: tweaks" 
> area. 
>
If this opton is set and you open a tiddler it will be marked as dirty. It 
> activates the dialog, even if you didn't change anything. In the background 
> modifier and modified are allready updated. 
>
 
No-no-no, this has nothing to do with chkForceMinorUpdate (it's unchecked). 
Like I said, the behaviour depends on when a tiddler was created/modified 
-- when CM plugins were enabled or disabled. As I can see, tiddlers created 
with disabled plugins are different from tiddlers with no content-type in 
terms of storage format: first ones have no "content-type" attribute in the 
storage divs, and second ones have 'content-type=""'. And so the tiddlers 
from the first group have such a behaviour -- the unnecessary dialogue 
appears even in the ordinary edit mode even if no key was pushed.

By the way, as content-type chooser appears in both edit and cmEdit mode 
anyway, may be you can add an option which causes to open ordinary edit 
mode (by cmEdit command) in tiddlers with no content-type? The idea is to 
allow "graduate" workflow -- tiddlers with no content-type open the edit 
mode on double-click and the ordinary "save" on ctrl+enter; tiddlers with 
content-type open the cmEdit mode and use cmSave on ctrl+enter. This seems 
to minimize different drawbacks.

Best regards,
Yakov.

hope this helps
> mario
> see: 
> https://groups.google.com/forum/?fromgroups#!topic/tiddlywikidev/HyxefoCToLgit
>  may answer some more question about update handling.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to