Perfecto working liek a  charm.
Thanks
I have put this in my after/ftplugin/txtfmt.vim

" Disable txtfmt formating if we aren't in gui mode
if !has("gui_running")
    call tdvim#StripTxtfmtTokens("help")
endif

" Enable refresh if coor scheme changes:
autocmd ColorScheme <buffer> :Refresh

Which seems to work nice.
Thansk for your help!

2010/6/8 Stahlman Family <brettstahl...@comcast.net>

>
>
> Brett Stahlman wrote:
>
>>
>> On Jun 4, 10:18 am, Pablo Giménez <pablog...@gmail.com> wrote:
>> ...[snip]...
>>
>>  Well I have solved the token range problem and now I am using utf-8
>>> rather
>>> than latin1.
>>> My trim function can also detect it ans apply a different regular
>>> expression
>>> depending the encoding.
>>> I converted my file from latin1 to utf-8 and cleaned all the chracter
>>> used
>>> by txtfmt. Then I formatted it again to begin from scratch with an utf-8
>>> file.
>>>
>>
>> I suppose I should have mentioned that Txtfmt provides a command that
>> will translate all the tokens for you.
>>
>> :help txtfmt-:MoveStartTok
>>
>> You run the command from within a Txtfmt buffer to move all the tokens
>> to a new location. For example... Assuming you want to change the
>> start token of the current Txtfmt buffer from 180 to 0xE000... you
>> would simply run...
>>
>> :MoveStartTok 0xE000
>>
>> Note that this command even handles token escaping properly.
>>
>
>
>>
>>  The problem is that if I have in my modeline:
>>> ft=help.txtfmt
>>> I got the next errors when loading the help file as help, I mean using
>>> the
>>> :h command:
>>> "tdvim_houdini.txt" [readonly] 85L, 3547C
>>> Error detected while processing function
>>> <SNR>78_Define_syntax..<SNR>78_Is_match_offset_char_based:
>>> line    8:
>>> E21: Cannot make changes, 'modifiable' is off
>>> Error detected while processing function tdvim#StripTxtfmtTokens:
>>> line   17:
>>> E194: No alternate file name to substitute for '#':     :r #
>>> line   28:
>>> E516: No buffers were deleted:     :bd #
>>> "/user_data/ARCHIVE/TDVim/doc/tdvim_houdini.txt" [readonly] 85 lines
>>> --51%--
>>>
>>>
>> I can reproduce this. I believe it may be a Vim issue, because
>> Is_match_offset_char_based attempts to modify *only* a scratch buffer
>> the plugin has created -- not the Vim help buffer that has
>> 'nomodifiable' set. Still, there's a simple workaround I can add to
>> the Txtfmt plugin that will fix it. I'll probably release an update
>> this weekend. In the meantime, if you don't mind modifying the syntax/
>> txtfmt.vim file yourself, you could simply add the following line...
>>
>> set modifiable
>>
>> ...just below the `call s:Create_scratch_buffer()' on line 133 of
>> syntax/txtfmt.vim.
>>
>> This fixes it for me... I'll do more testing later though...
>>
>
> Pablo,
> I've released a new version of Txtfmt (v2.3), which should prevent E21
> errors when the help.txtfmt file is loaded as a Vim help file (i.e., with
> the :help command). Please let me know if you experience any issues.
>
> Incidentally, if you decide to revert to a latin1 encoding and wish to
> convert your help.txtfmt files from using a start token of 0xE000 to a start
> token of 180, simply do the following:
>
> Open the file to be converted (with encoding still equal to utf-8)
> :MoveStartTok 180
>
> Note that the MoveStartTok command updates the modeline for you and
> executes a :Refresh after modifying the tokens, so you shouldn't notice any
> change in the buffer's appearance when you run the command. You can test it
> on a "Txtfmt Test Page" first, if you like.
> :help txtfmt-:MakeTestPage
>
> E.g.,
> :MakeTestPage tokrange=0xE000
> :MoveStartTok 180
> Hit [a or ]a (to jump to a token)
> Use ga to verify that the token is in the range beginning at 180
>
> Hope it helps...
> Brett Stahlman
>
>
>
>> Sincerely,
>> Brett Stahlman
>>
>>  I guess the errors in tdvim#StripTxtfmtTokens are because of the previous
>>> errors, which seems to be problem loading the syntax for txtfmt
>>> The interesting thing is if I delete the txtfmt from the modeline and the
>>> when loading the help I manually set the filetype to hrlp.txtfmt it loads
>>> perfectly.
>>> So I have the problem with the modeline.
>>> I have attached the offending file if it can helps.
>>> Thanks for the info about the token range now I initialize it properly.
>>> Cheers
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  ...[snip]...
>>
>>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>



-- 
Un saludo
Best Regards
Pablo Giménez

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to