Michael Maurer wrote:
On Thu, Jan 7, 2010 at 2:34 PM, Stahlman Family
<brettstahl...@comcast.net> wrote:
Michael,
Although you may wish to customize the map sequence (as described in my
previous post) simply because Ctrl-Alt-ß is harder to type than Ctrl-\, I'm
wondering whether there could be something odd with your setup, as I don't
see this issue when I switch to a German keyboard layout. For me, typing the
sequence you described in insert mode brings up the "Enter a fmt / clr
string" prompt, just as <C-\><C-\> does on my US keyboard layout.

I'm wondering whether the <C-\><C-\> map is even defined for you. Does :imap
in a Txtfmt buffer display something like the following?
i  <C-\><C-\>   @<Plug>TxtfmtInsertTok_i

The only thing I know of that could prevent the map from being defined is a
conflict or ambiguity with a mapping defined by another plugin, but even
then, unless you've altered the default setting of the txtfmtMapwarn option,
the Txtfmt mapping will be defined anyway.

Brett Stahlman

No, you're right, <C-\><C-\> is not defined. Plus I've discovered some
other irregularities. In one document, typing Ä will result in
switching the format of the text to italics.

Hmmm... I have an idea what's happening there, at least... The character code for Ä is 196. Recall that the Txtfmt "tokens" that control highlighting are simply characters in the buffer, which are interpreted specially by the Txtfmt syntax. By default (if you don't override the tokrange option), Txtfmt locates the token range at a character code determined by 'encoding'. Ideally, the tokens would always go in the Unicode "Private Use Area", which begins at 0xE000 and is guaranteed never to be used for any standardized purpose. Of course, this ideal location is possible only if you're using a Unicode encoding (e.g., utf-8). If you're using latin1, the Txtfmt tokens will need to fit within a single byte, so there aren't as many choices of unused characters. The default is to locate the tokens beginning at 180. Unfortunately, as mentioned in the help, this is not ideal for non-English users who often use character codes above 180 for text! This default token location would make Ä (196) the "italic-underline" token. To see whether this is the case, you can run :ShowTokenMap in the buffer in question.

:help txtfmt-choosing-token-range
:help :ShowTokenMap

The bottom-line is, if you're using Unicode, tokens should be located in the "Private Use Area" automatically, unless you have used the tokrange option to specify a different location (e.g., in your .vimrc or in a file's Txtfmt modeline). Note: You can set the txtfmtTokrange option to an *expression* instead of a literal value. This could be useful if you use both utf-8 and latin1 at different times. The help gives the following example...

let g:txtfmtTokrange = '&enc == "utf-8" ? "0xE000X" : "180X"'

...which causes the tokens to be located at 0xE000 if encoding is utf-8 and at 180 otherwise. Personally, I prefer associating the tokrange option with the file itself by putting the setting in a Txtfmt modeline: e.g.,
        vim:ft=txtfmt
        txtfmt:tokrange=0xE000X

...but then, I always use Unicode...

:help txtfmtTokrange
:help txtfmt-'tokrange'-expr

If you have to use a non-Unicode encoding and you find a better place to locate the Txtfmt tokens than 180, you can use the :MoveStartTok command to translate all the tokens in an existing buffer to the new range.

:help :MoveStartTok

The :MakeTestPage command might aid you in finding that better location, since it creates a modifiable test buffer using the settings specified on the command line: e.g.,
:MakeTestPage tokrange=170X
:MakeTestPage tokrange=130S
.
.

:help :MakeTestPage

Note that if you wish to reduce the number of tokens required by Txtfmt, you can always use "short" formats (180S, 0xE000S, etc...) instead of "extended" formats (180X, 0xE000X, etc...) or "long" formats (180L, 0xE000L, etc...). The difference is that the short configuration supports only foreground colors, whereas extended supports both foreground and background colors. Long formats is the only one with support for standout, reverse and undercurl attributes, but note that for performance reasons, long formats are mutually exclusive with background colors. There's a useful chart illustrating the effects of the various "formats" suffixes in the help for the txtfmtTokrange option. A separate chart in the section on short/long/extended formats shows how many character codes are required for each configuration.

:help 'short'/'long'-formats

Sorry to bombard you with so much information. Let me know if anything is unclear...

Thanks,
Brett Stahlman


I'm thinking that there's
probably an open formatting tag somewhere, but I haven't found it yet.
In addition, I have a couple of plugins installed, not sure which one
is responsible. I guess I'll try switching them off one by one and see
if the problem persists.

Thanks for the support,
Michael

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to