Ali Gholami Rudi wrote:

> Bram Moolenaar <[email protected]> wrote:
> > Ali Gholami Rudi wrote:
> > > was not what I expected.  So I think it is a better idea to call
> > > arabic_shape() directly from a C program:
> > > 
> > > 1. write a normal file containing some Arabic/Farsi text
> > > 2. obtain the expected output by reading the file and calling
> > >    arabic_shape() on its chars and write it to another file (arabic.c
> > >    not changed yet)
> > > 3. change arabic.c
> > > 4. test to see if applying arabic_shape() on the test input yields the
> > >    expected output
> > 
> > The arabic shaping also works when displaying a message on the command
> > line.  You could try using :redir to catch the output, something like:
> > 
> >     :redir >>test.out
> >     :call feedkeys("\<CR>")
> >     :call input(test_string)
> >     :redir END
> > 
> > I haven't tried it!
> 
> It seems calling input writes nothing to test.out but, for instance,
> ":p" output gets redirected as expected.  Am I doing something wrong?

OK, so the input() strings are not redirected.  This works:

        redir >> test.out
        call feedkeys("testing\<CR>")
        echo input("say ")
        redir END

But perhaps the echo command is sufficient to get arabic shaping?

        redir >> test.out
        echo "testing"
        redir END

-- 
Normal people believe that if it ain't broke, don't fix it.  Engineers believe
that if it ain't broke, it doesn't have enough features yet.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Raspunde prin e-mail lui