summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-19 18:42:29 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-19 18:42:29 +0100
commit3848e00e0177abdb31bc600234967863ec487233 (patch)
tree24e98aae0cf331b430e63f4dfb712dc161d2190d /runtime
parentbfb96c047b79b2aab5fd57a2472871508819f3ef (diff)
downloadvim-git-3848e00e0177abdb31bc600234967863ec487233.tar.gz
patch 7.4.1604v7.4.1604
Problem: Although emoji characters are ambiguous width, best is to treat them as full width. Solution: Update the Unicode character tables. Add the 'emoji' options. (Yasuhiro Matsumoto)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt35
-rw-r--r--runtime/optwin.vim2
-rw-r--r--runtime/tools/unicode.vim27
3 files changed, 51 insertions, 13 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 024e621e5..35cef9de6 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2016 Mar 08
+*options.txt* For Vim version 7.4. Last change: 2016 Mar 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -69,7 +69,7 @@ achieve special effects. These options come in three forms:
:se[t] {option}:{value}
Set string or number option to {value}.
For numeric options the value can be given in decimal,
- hex (preceded with 0x) or octal (preceded with '0').
+ hex (preceded with 0x) or octal (preceded with '0').
The old value can be inserted by typing 'wildchar' (by
default this is a <Tab> or CTRL-E if 'compatible' is
set). See |cmdline-completion|.
@@ -1002,7 +1002,7 @@ A jump table for the options with a short description can be found at |Q_op|.
- The backup file will be created in the first directory in the list
where this is possible. The directory must exist, Vim will not
create it for you.
- - Empty means that no backup file will be created ( 'patchmode' is
+ - Empty means that no backup file will be created ('patchmode' is
impossible!). Writing may fail because of this.
- A directory "." means to put the backup file in the same directory
as the edited file.
@@ -1792,7 +1792,7 @@ A jump table for the options with a short description can be found at |Q_op|.
when CTRL-P or CTRL-N are used. It is also used for whole-line
completion |i_CTRL-X_CTRL-L|. It indicates the type of completion
and the places to scan. It is a comma separated list of flags:
- . scan the current buffer ( 'wrapscan' is ignored)
+ . scan the current buffer ('wrapscan' is ignored)
w scan buffers from other windows
b scan other loaded buffers that are in the buffer list
u scan the unloaded buffers that are in the buffer list
@@ -2644,6 +2644,15 @@ A jump table for the options with a short description can be found at |Q_op|.
also 'gdefault' option.
Switching this option on is discouraged!
+ *'emoji'* *'emo'*
+'emoji' 'emo' boolean (default: on)
+ global
+ {not in Vi}
+ {only available when compiled with the |+multi_byte|
+ feature}
+ When on all Unicode emoji characters are considered to be full width.
+
+
*'encoding'* *'enc'* *E543*
'encoding' 'enc' string (default: "latin1" or value from $LANG)
global
@@ -3732,7 +3741,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The same applies to the modeless selection.
*'go-P'*
'P' Like autoselect but using the "+ register instead of the "*
- register.
+ register.
*'go-A'*
'A' Autoselect for the modeless selection. Like 'a', but only
applies to the modeless selection.
@@ -4841,7 +4850,7 @@ A jump table for the options with a short description can be found at |Q_op|.
reset this option. |-u| |--noplugin|
*'luadll'*
-'luadll' string (default depends on the build)
+'luadll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+lua/dyn|
@@ -5298,7 +5307,7 @@ A jump table for the options with a short description can be found at |Q_op|.
respectively; see |CTRL-A| for more info on these commands.
alpha If included, single alphabetical characters will be
incremented or decremented. This is useful for a list with a
- letter index a), b), etc. *octal-nrformats*
+ letter index a), b), etc. *octal-nrformats*
octal If included, numbers that start with a zero will be considered
to be octal. Example: Using CTRL-A on "007" results in "010".
hex If included, numbers starting with "0x" or "0X" will be
@@ -5328,7 +5337,7 @@ A jump table for the options with a short description can be found at |Q_op|.
relative to the cursor. Together with 'number' there are these
four combinations (cursor in line 3):
- 'nonu' 'nu' 'nonu' 'nu'
+ 'nonu' 'nu' 'nonu' 'nu'
'nornu' 'nornu' 'rnu' 'rnu'
|apple | 1 apple | 2 apple | 2 apple
@@ -5567,7 +5576,7 @@ A jump table for the options with a short description can be found at |Q_op|.
this doesn't work when $INCL contains a comma or white space.
*'perldll'*
-'perldll' string (default depends on the build)
+'perldll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+perl/dyn|
@@ -5704,7 +5713,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|ins-completion-menu|.
*'pythondll'*
-'pythondll' string (default depends on the build)
+'pythondll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+python/dyn|
@@ -5945,7 +5954,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'rightleft' option must be set for 'rightleftcmd' to take effect.
*'rubydll'*
-'rubydll' string (default: depends on the build)
+'rubydll' string (default: depends on the build)
global
{not in Vi}
{only available when compiled with the |+ruby/dyn|
@@ -7439,7 +7448,7 @@ A jump table for the options with a short description can be found at |Q_op|.
mapping which should not change the tagstack.
*'tcldll'*
-'tcldll' string (default depends on the build)
+'tcldll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+tcl/dyn|
@@ -7494,7 +7503,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
Encoding used for the terminal. This specifies what character
encoding the keyboard produces and the display will understand. For
- the GUI it only applies to the keyboard ( 'encoding' is used for the
+ the GUI it only applies to the keyboard ('encoding' is used for the
display). Except for the Mac when 'macatsui' is off, then
'termencoding' should be "macroman".
*E617*
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 46a5ee034..c44d73a34 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1254,6 +1254,8 @@ if has("multi_byte")
endif
call append("$", "ambiwidth\twidth of ambiguous width characters")
call <SID>OptionG("ambw", &ambw)
+ call append("$", "emoji\temoji characters are full width")
+ call <SID>BinOptionG("emo", &emo)
endif
diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim
index d733fe867..dfe9cef41 100644
--- a/runtime/tools/unicode.vim
+++ b/runtime/tools/unicode.vim
@@ -251,6 +251,27 @@ func! BuildWidthTable(pattern, tableName)
wincmd p
endfunc
+" Build the amoji width table in a new buffer.
+func! BuildEmojiTable(pattern, tableName)
+ let ranges = []
+ for line in map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~a:pattern'), 'matchstr(v:val,"^\\S\\+")')
+ let token = split(line, '\.\.')
+ if len(token) == 1
+ call add(token, token[0])
+ endif
+ call add(ranges, printf("\t{0x%04x, 0x%04x},", "0x".token[0], "0x".token[1]))
+ endfor
+
+ " New buffer to put the result in.
+ new
+ exe "file " . a:tableName
+ call setline(1, " static struct interval " . a:tableName . "[] =")
+ call setline(2, " {")
+ call append('$', ranges)
+ call setline('$', getline('$')[:-2]) " remove last comma
+ call setline(line('$') + 1, " };")
+ wincmd p
+endfunc
" Try to avoid hitting E36
set equalalways
@@ -290,3 +311,9 @@ call BuildWidthTable('[WF]', 'doublewidth')
" Build the ambiguous width table.
call BuildWidthTable('A', 'ambiguous')
+
+" Edit the emoji text file. Requires the netrw plugin.
+edit http://www.unicode.org/Public/emoji/3.0/emoji-data.txt
+
+" Build the emoji table. Ver. 1.0 - 6.0
+call BuildEmojiTable('; Emoji\s\+# [1-6]\.[0-9]', 'emoji')