MCPcopy Index your code
hub / github.com/dzhou121/gonvim / highlightSet

Method highlightSet

editor/screen.go:418–448  ·  view source on GitHub ↗
(args []interface{})

Source from the content-addressed store, hash-verified

416}
417
418func (s *Screen) highlightSet(args []interface{}) {
419 for _, arg := range args {
420 hl := arg.([]interface{})[0].(map[string]interface{})
421 _, ok := hl["reverse"]
422 if ok {
423 highlight := Highlight{}
424 highlight.foreground = s.highlight.background
425 highlight.background = s.highlight.foreground
426 s.highlight = highlight
427 continue
428 }
429
430 highlight := Highlight{}
431 fg, ok := hl["foreground"]
432 if ok {
433 rgba := calcColor(reflectToInt(fg))
434 highlight.foreground = rgba
435 } else {
436 highlight.foreground = s.ws.foreground
437 }
438
439 bg, ok := hl["background"]
440 if ok {
441 rgba := calcColor(reflectToInt(bg))
442 highlight.background = rgba
443 } else {
444 highlight.background = s.ws.background
445 }
446 s.highlight = highlight
447 }
448}
449
450func (s *Screen) setScrollRegion(args []interface{}) {
451 arg := args[0].([]interface{})

Callers 1

handleRedrawMethod · 0.80

Calls 2

calcColorFunction · 0.85
reflectToIntFunction · 0.70

Tested by

no test coverage detected