Skip to content
Myr

[vim] Automatically set RUNEWIDTH_EASTASIAN=1 when &ambiwidth == double

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent a6d6cdd · Browse files · 2 files+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−0 removed

  • other:+14 added−0 removed

2 files+14 added−0 removed

modified:plugin/fzf.vim+13 added
828 unmodified lines
829 tnoremap <silent> <Plug>(fzf-insert) <C-\><C-n>i830 tnoremap <silent> <Plug>(fzf-normal) <C-\><C-n>831endif832833let s:warned = 0834function! s:handle_ambidouble(dict)835 if &ambiwidth == 'double'836 let a:dict.env = { 'RUNEWIDTH_EASTASIAN': '1' }837 elseif !s:warned && $RUNEWIDTH_EASTASIAN == '1' && &ambiwidth !=# 'double'838 call s:warn("$RUNEWIDTH_EASTASIAN is '1' but &ambiwidth is not 'double'")839 2sleep840 let s:warned = 1841 endif842endfunction843844function! s:execute_term(dict, command, temps) abort845 let winrest = winrestcmd()846 let pbuf = bufnr('')847 let [ppos, winopts, is_popup] = s:split(a:dict)
61 unmodified lines
909 let command = a:command910 endif911 let command .= s:term_marker912 if has('nvim')913 call s:handle_ambidouble(fzf)914 call termopen(command, fzf)915 else916 let term_opts = {'exit_cb': function(fzf.on_exit)}917 if v:version >= 802
3 unmodified lines
921 let term_opts.hidden = 1922 else923 let term_opts.curwin = 1924 endif925 call s:handle_ambidouble(term_opts)926 let fzf.buf = term_start([&shell, &shellcmdflag, command], term_opts)927 if is_popup && exists('#TerminalWinOpen')928 doautocmd <nomodeline> TerminalWinOpen929 endif
147 unmodified lines
modified:CHANGELOG.md+1 added
90 unmodified lines
91- Added color name `preview-label` for `--preview-label` (defaults to `label`92 for `--border-label`)93- Better support for (Windows) terminals where each box-drawing character94 takes 2 columns. Set `RUNEWIDTH_EASTASIAN` environment variable to `1`.95 - On Vim, the variable will be automatically set if `&ambiwidth` is `double`96- Behavior changes97 - fzf will always execute the preview command if the command template98 contains `{q}` even when it's empty. If you prefer the old behavior,99 you'll have to check if `{q}` is empty in your command.
1416 unmodified lines