comparison runtime/doc/eval.txt @ 4051:42edc5dac33c v7.3.780

updated for version 7.3.780 Problem: char2nr() and nr2char() always use 'encoding'. Solution: Add argument to use utf-8 characters. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Wed, 23 Jan 2013 17:17:10 +0100
parents b3f3237a3d72
children e362db8b2d7b
comparison
equal deleted inserted replaced
4050:25e5c2ec157a 4051:42edc5dac33c
1714 byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr} 1714 byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
1715 call( {func}, {arglist} [, {dict}]) 1715 call( {func}, {arglist} [, {dict}])
1716 any call {func} with arguments {arglist} 1716 any call {func} with arguments {arglist}
1717 ceil( {expr}) Float round {expr} up 1717 ceil( {expr}) Float round {expr} up
1718 changenr() Number current change number 1718 changenr() Number current change number
1719 char2nr( {expr}) Number ASCII value of first char in {expr} 1719 char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
1720 cindent( {lnum}) Number C indent for line {lnum} 1720 cindent( {lnum}) Number C indent for line {lnum}
1721 clearmatches() none clear all matches 1721 clearmatches() none clear all matches
1722 col( {expr}) Number column nr of cursor or mark 1722 col( {expr}) Number column nr of cursor or mark
1723 complete( {startcol}, {matches}) none set Insert mode completion 1723 complete( {startcol}, {matches}) none set Insert mode completion
1724 complete_add( {expr}) Number add completion match 1724 complete_add( {expr}) Number add completion match
1871 mkdir( {name} [, {path} [, {prot}]]) 1871 mkdir( {name} [, {path} [, {prot}]])
1872 Number create directory {name} 1872 Number create directory {name}
1873 mode( [expr]) String current editing mode 1873 mode( [expr]) String current editing mode
1874 mzeval( {expr}) any evaluate |MzScheme| expression 1874 mzeval( {expr}) any evaluate |MzScheme| expression
1875 nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} 1875 nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
1876 nr2char( {expr}) String single char with ASCII value {expr} 1876 nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
1877 or( {expr}, {expr}) Number bitwise OR 1877 or( {expr}, {expr}) Number bitwise OR
1878 pathshorten( {expr}) String shorten directory names in a path 1878 pathshorten( {expr}) String shorten directory names in a path
1879 pow( {x}, {y}) Float {x} to the power of {y} 1879 pow( {x}, {y}) Float {x} to the power of {y}
1880 prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} 1880 prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
1881 printf( {fmt}, {expr1}...) String format text 1881 printf( {fmt}, {expr1}...) String format text
2292 with the |:undo| command. 2292 with the |:undo| command.
2293 When a change was made it is the number of that change. After 2293 When a change was made it is the number of that change. After
2294 redo it is the number of the redone change. After undo it is 2294 redo it is the number of the redone change. After undo it is
2295 one less than the number of the undone change. 2295 one less than the number of the undone change.
2296 2296
2297 char2nr({expr}) *char2nr()* 2297 char2nr({expr}[, {utf8}]) *char2nr()*
2298 Return number value of the first char in {expr}. Examples: > 2298 Return number value of the first char in {expr}. Examples: >
2299 char2nr(" ") returns 32 2299 char2nr(" ") returns 32
2300 char2nr("ABC") returns 65 2300 char2nr("ABC") returns 65
2301 < The current 'encoding' is used. Example for "utf-8": > 2301 < When {utf8} is omitted or zero, the current 'encoding' is used.
2302 Example for "utf-8": >
2302 char2nr("á") returns 225 2303 char2nr("á") returns 225
2303 char2nr("á"[0]) returns 195 2304 char2nr("á"[0]) returns 195
2304 < A combining character is a separate character. 2305 < With {utf8} set to 1, always treat as utf-8 characters.
2306 A combining character is a separate character.
2305 |nr2char()| does the opposite. 2307 |nr2char()| does the opposite.
2306 2308
2307 cindent({lnum}) *cindent()* 2309 cindent({lnum}) *cindent()*
2308 Get the amount of indent for line {lnum} according the C 2310 Get the amount of indent for line {lnum} according the C
2309 indenting rules, as with 'cindent'. 2311 indenting rules, as with 'cindent'.
4369 if getline(nextnonblank(1)) =~ "Java" 4371 if getline(nextnonblank(1)) =~ "Java"
4370 < When {lnum} is invalid or there is no non-blank line at or 4372 < When {lnum} is invalid or there is no non-blank line at or
4371 below it, zero is returned. 4373 below it, zero is returned.
4372 See also |prevnonblank()|. 4374 See also |prevnonblank()|.
4373 4375
4374 nr2char({expr}) *nr2char()* 4376 nr2char({expr}[, {utf8}]) *nr2char()*
4375 Return a string with a single character, which has the number 4377 Return a string with a single character, which has the number
4376 value {expr}. Examples: > 4378 value {expr}. Examples: >
4377 nr2char(64) returns "@" 4379 nr2char(64) returns "@"
4378 nr2char(32) returns " " 4380 nr2char(32) returns " "
4379 < The current 'encoding' is used. Example for "utf-8": > 4381 < When {utf8} is omitted or zero, the current 'encoding' is used.
4382 Example for "utf-8": >
4380 nr2char(300) returns I with bow character 4383 nr2char(300) returns I with bow character
4381 < Note that a NUL character in the file is specified with 4384 < With {utf8} set to 1, always return utf-8 characters.
4385 Note that a NUL character in the file is specified with
4382 nr2char(10), because NULs are represented with newline 4386 nr2char(10), because NULs are represented with newline
4383 characters. nr2char(0) is a real NUL and terminates the 4387 characters. nr2char(0) is a real NUL and terminates the
4384 string, thus results in an empty string. 4388 string, thus results in an empty string.
4385 4389
4386 *getpid()* 4390 *getpid()*