( buffer_number,
line,
column,
prop_type,
extra_args )
| 345 | |
| 346 | |
| 347 | def AddTextProperty( buffer_number, |
| 348 | line, |
| 349 | column, |
| 350 | prop_type, |
| 351 | extra_args ): |
| 352 | if not VimIsNeovim(): |
| 353 | extra_args.update( { |
| 354 | 'type': prop_type, |
| 355 | 'bufnr': buffer_number |
| 356 | } ) |
| 357 | return GetIntValue( f'prop_add( { line }, ' |
| 358 | f'{ column }, ' |
| 359 | f'{ json.dumps( extra_args ) } )' ) |
| 360 | else: |
| 361 | extra_args[ 'hl_group' ] = prop_type |
| 362 | # Neovim uses 0-based offsets |
| 363 | if 'end_lnum' in extra_args: |
| 364 | extra_args[ 'end_line' ] = extra_args.pop( 'end_lnum' ) - 1 |
| 365 | if 'end_col' in extra_args: |
| 366 | extra_args[ 'end_col' ] = extra_args.pop( 'end_col' ) - 1 |
| 367 | line -= 1 |
| 368 | column -= 1 |
| 369 | return GetIntValue( f'nvim_buf_set_extmark( { buffer_number }, ' |
| 370 | f'{ YCM_NEOVIM_NS_ID }, ' |
| 371 | f'{ line }, ' |
| 372 | f'{ column }, ' |
| 373 | f'{ extra_args } )' ) |
| 374 | |
| 375 | |
| 376 | def RemoveDiagnosticProperty( buffer_number: int, prop: DiagnosticProperty ): |
nothing calls this directly
no test coverage detected