1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// vim:fileencoding=utf-8:noet
//! Port of `powerline/segments/vim/plugin/capslock.py`.
// from __future__ import (unicode_literals, division, absolute_import, print_function) // py:2
// try: import vim except ImportError: vim = object() // py:4-7
// from powerline.bindings.vim import vim_func_exists // py:9
// from powerline.theme import requires_segment_info // py:10
use crate;
/// Port of `capslock_indicator()` from
/// `powerline/segments/vim/plugin/capslock.py:14`.
///
/// Shows the indicator if tpope/vim-capslock plugin is enabled.
///
/// :param text: String to show when software capslock is active.
///
/// Rust port: without vim.eval, the `CapsLockStatusline()` call returns
/// empty. Returns `None` when the function isn't defined (matches py:25
/// short-circuit) or when the eval returns empty (py:28).