|
1 | 1 | """API for working with a Nvim Buffer.""" |
2 | 2 | from .common import Remote |
3 | | -from ..compat import IS_PYTHON3 |
| 3 | +from ..compat import IS_PYTHON3, check_async |
4 | 4 |
|
5 | 5 |
|
6 | 6 | __all__ = ('Buffer') |
@@ -98,17 +98,19 @@ def range(self, start, end): |
98 | 98 | return Range(self, start, end) |
99 | 99 |
|
100 | 100 | def add_highlight(self, hl_group, line, col_start=0, |
101 | | - col_end=-1, src_id=-1, async=None): |
| 101 | + col_end=-1, src_id=-1, async_=None, |
| 102 | + **kwargs): |
102 | 103 | """Add a highlight to the buffer.""" |
103 | | - if async is None: |
104 | | - async = (src_id != 0) |
| 104 | + async_ = check_async(async_, kwargs, src_id != 0) |
105 | 105 | return self.request('nvim_buf_add_highlight', src_id, hl_group, |
106 | | - line, col_start, col_end, async=async) |
| 106 | + line, col_start, col_end, async_=async_) |
107 | 107 |
|
108 | | - def clear_highlight(self, src_id, line_start=0, line_end=-1, async=True): |
| 108 | + def clear_highlight(self, src_id, line_start=0, line_end=-1, async_=None, |
| 109 | + **kwargs): |
109 | 110 | """Clear highlights from the buffer.""" |
| 111 | + async_ = check_async(async_, kwargs, True) |
110 | 112 | self.request('nvim_buf_clear_highlight', src_id, |
111 | | - line_start, line_end, async=async) |
| 113 | + line_start, line_end, async_=async_) |
112 | 114 |
|
113 | 115 | @property |
114 | 116 | def name(self): |
|
0 commit comments