Selaa lähdekoodia

New option: g:startify_fortune_use_unicode

References #261.
Marco Hinz 9 vuotta sitten
vanhempi
sitoutus
89bf0a5c24
2 muutettua tiedostoa jossa 18 lisäystä ja 2 poistoa
  1. 1 1
      autoload/startify/fortune.vim
  2. 17 1
      doc/startify.txt

+ 1 - 1
autoload/startify/fortune.vim

@@ -127,7 +127,7 @@ endfunction
 " Function: s:draw_box {{{1
 function! s:draw_box(lines) abort
   let longest_line = max(map(copy(a:lines), 'len(v:val)'))
-  if &encoding == 'utf-8'
+  if &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
       let top_left_corner = '╭'
       let top_right_corner = '╮'
       let bottom_left_corner = '╰'

+ 17 - 1
doc/startify.txt

@@ -92,7 +92,6 @@ default values.
     |g:startify_custom_header|
     |g:startify_enable_special|
     |g:startify_list_order|
-    |g:startify_relative_path|
     |g:startify_skiplist|
     |g:startify_update_oldfiles|
 
@@ -104,7 +103,9 @@ default values.
     |g:startify_disable_at_vimenter|
     |g:startify_enable_unsafe|
     |g:startify_files_number|
+    |g:startify_fortune_use_unicode|
     |g:startify_padding_left|
+    |g:startify_relative_path|
     |g:startify_skiplist_server|
     |g:startify_use_env|
 
@@ -329,6 +330,21 @@ Example:
            \ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt',
            \ ]
 <
+------------------------------------------------------------------------------
+                                                *g:startify_fortune_use_unicode*
+>
+    let g:startify_fortune_use_unicode = 0
+<
+By default, the fortune header uses ASCII characters, because they work for
+everyone. If you set this option to 1 and your 'encoding' is "utf-8", Unicode
+box-drawing characters will be used instead.
+
+This is not the default, because users of East Asian languages often set
+'ambiwidth' to "double" or make their terminal emulator treat characters of
+ambiguous width as double width. Both would make the drawed box look funny.
+
+For more information: http://unicode.org/reports/tr11
+
 ------------------------------------------------------------------------------
                                                        *g:startify_padding_left*
 >