* Added [BOM] (byte-order-mark) text in file encoding info
Like in vim-airline
See https://github.com/vim-airline/vim-airline/pull/992 and fdb74f549d
Ref #2015
* Test with no text added, to check travis results
* make bom a sepaate segment
This commit is contained in:
parent
f4dfe39112
commit
589461e109
|
@ -5,6 +5,7 @@
|
||||||
"file_size": "information:unimportant",
|
"file_size": "information:unimportant",
|
||||||
"file_format": "information:unimportant",
|
"file_format": "information:unimportant",
|
||||||
"file_encoding": "file_format",
|
"file_encoding": "file_format",
|
||||||
|
"file_bom": "file_format",
|
||||||
"file_type": "file_format",
|
"file_type": "file_format",
|
||||||
"branch": "information:additional",
|
"branch": "information:additional",
|
||||||
"file_scheme": "file_name",
|
"file_scheme": "file_name",
|
||||||
|
|
|
@ -352,6 +352,18 @@ def file_encoding(pl, segment_info):
|
||||||
return vim_getbufoption(segment_info, 'fileencoding') or None
|
return vim_getbufoption(segment_info, 'fileencoding') or None
|
||||||
|
|
||||||
|
|
||||||
|
@requires_segment_info
|
||||||
|
@add_divider_highlight_group('background:divider')
|
||||||
|
def file_bom(pl, segment_info):
|
||||||
|
'''Return BOM of the current file
|
||||||
|
|
||||||
|
:return: Byte order mark or None if unknown or missing BOM
|
||||||
|
|
||||||
|
Divider highlight group used: ``background:divider``.
|
||||||
|
'''
|
||||||
|
return 'bom' if vim_getbufoption(segment_info, 'bomb') else None
|
||||||
|
|
||||||
|
|
||||||
@requires_segment_info
|
@requires_segment_info
|
||||||
@add_divider_highlight_group('background:divider')
|
@add_divider_highlight_group('background:divider')
|
||||||
def file_type(pl, segment_info):
|
def file_type(pl, segment_info):
|
||||||
|
|
Loading…
Reference in New Issue