Thanks but I still don't understand it. No problem.
Hope I'll not have problems with `vim.current.buffer[linenr -1]`.
My experience with Python tells me that Python language is much easier then
vimscript. Things can be done easier with the many Python modules using less
code then in vimscript.
2016-03-08 14:03 GMT+03:00 rameo :
>> Better `vim.Function('getline')(linenr)
>
> You seems to know everything in every computer language :)
> Yes I use Pyth3 and many times also `vim.current.buffer[linenr-1]`
> or things like this `r = vim.current.buffer[startline:endline]`
>
> To avoid decoding e
> Better `vim.Function('getline')(linenr)
You seems to know everything in every computer language :)
Yes I use Pyth3 and many times also `vim.current.buffer[linenr-1]`
or things like this `r = vim.current.buffer[startline:endline]`
To avoid decoding errors it is better to switch all these stateme
2016-03-08 13:34 GMT+03:00 Nikolay Aleksandrovich Pavlov :
> 2016-03-08 13:22 GMT+03:00 rameo :
>> Thank you.
>> You're right. It is not a question of decoding a list but decoding a string.
>> Never did anything before with string encoding. I've got it: I cannot use
>> searchpos() to use with pyt
2016-03-08 13:22 GMT+03:00 rameo :
> Thank you.
> You're right. It is not a question of decoding a list but decoding a string.
> Never did anything before with string encoding. I've got it: I cannot use
> searchpos() to use with python. Searching positions must be done in python
> (p.e. finditer
Thank you.
You're right. It is not a question of decoding a list but decoding a string.
Never did anything before with string encoding. I've got it: I cannot use
searchpos() to use with python. Searching positions must be done in python
(p.e. finditer).
BTW I thought that ['encoding'] was a pl
2016-03-08 12:23 GMT+03:00 rameo :
> Can't find anything on the net about string.encode(vim.options[encoding]).
> No info either in Vim documentation: if_pyth
>
> Let say I create my list "MyPositions" with start/end position of matches
> using searchpos() in vim.
>
> Then in my python code I have
Can't find anything on the net about string.encode(vim.options[encoding]).
No info either in Vim documentation: if_pyth
Let say I create my list "MyPositions" with start/end position of matches using
searchpos() in vim.
Then in my python code I have to do something like this to convert it to byt
2016-03-08 1:32 GMT+03:00 rameo :
>
>> In Python you are not using *byte* counts, it indexes *unicode
>> codepoints*. You may convert unicode Python objects to bytes objects
>> by using `string.encode(vim.options['encoding'])`, use
>> `.decode(vim.options['encoding'])` to convert back. bytes object
> In Python you are not using *byte* counts, it indexes *unicode
> codepoints*. You may convert unicode Python objects to bytes objects
> by using `string.encode(vim.options['encoding'])`, use
> `.decode(vim.options['encoding'])` to convert back. bytes objects are
> indexed by bytes. You may also
2016-03-07 14:54 GMT+03:00 rameo :
> I use searchpos() to capture start/endcolumns of a matches.
> Then I use the results in Python code to transform the text.
>
> However I noted that latin characters as 'èéàòìù' are counted as 1 byte in
> Python but 2 bytes in Vim and the output is not as expect
I use searchpos() to capture start/endcolumns of a matches.
Then I use the results in Python code to transform the text.
However I noted that latin characters as 'èéàòìù' are counted as 1 byte in
Python but 2 bytes in Vim and the output is not as expected.
Is there any way to resolve this proble
12 matches
Mail list logo