This function can have side-effects and alter some global states. So we run it on fzf.Run and not on ParseOptions.
(opts *Options)
| 3701 | // This function can have side-effects and alter some global states. |
| 3702 | // So we run it on fzf.Run and not on ParseOptions. |
| 3703 | func postProcessOptions(opts *Options) error { |
| 3704 | if opts.Ambidouble { |
| 3705 | uniseg.EastAsianAmbiguousWidth = 2 |
| 3706 | } |
| 3707 | |
| 3708 | if opts.BorderShape == tui.BorderUndefined { |
| 3709 | opts.BorderShape = tui.BorderNone |
| 3710 | } |
| 3711 | |
| 3712 | if opts.ListBorderShape == tui.BorderUndefined { |
| 3713 | opts.ListBorderShape = tui.BorderNone |
| 3714 | } |
| 3715 | |
| 3716 | if opts.InputBorderShape == tui.BorderUndefined { |
| 3717 | opts.InputBorderShape = tui.BorderNone |
| 3718 | } |
| 3719 | |
| 3720 | if opts.HeaderBorderShape == tui.BorderUndefined { |
| 3721 | opts.HeaderBorderShape = tui.BorderNone |
| 3722 | } |
| 3723 | |
| 3724 | if opts.FooterBorderShape == tui.BorderUndefined { |
| 3725 | opts.FooterBorderShape = tui.BorderLine |
| 3726 | } |
| 3727 | |
| 3728 | if opts.HeaderLinesShape == tui.BorderNone { |
| 3729 | opts.HeaderLinesShape = tui.BorderPhantom |
| 3730 | } |
| 3731 | |
| 3732 | if opts.Pointer == nil { |
| 3733 | defaultPointer := "▌" |
| 3734 | if !opts.Unicode { |
| 3735 | defaultPointer = ">" |
| 3736 | } |
| 3737 | opts.Pointer = &defaultPointer |
| 3738 | } |
| 3739 | |
| 3740 | if opts.GapLine == nil { |
| 3741 | defaultGapLine := "┈" |
| 3742 | if !opts.Unicode { |
| 3743 | defaultGapLine = "-" |
| 3744 | } |
| 3745 | opts.GapLine = &defaultGapLine |
| 3746 | } |
| 3747 | |
| 3748 | markerLen := 1 |
| 3749 | if opts.Marker == nil { |
| 3750 | if opts.MarkerMulti != nil && opts.MarkerMulti[0] == "" { |
| 3751 | empty := "" |
| 3752 | opts.Marker = &empty |
| 3753 | markerLen = 0 |
| 3754 | } else { |
| 3755 | // "▎" looks better, but not all terminals render it correctly |
| 3756 | defaultMarker := "┃" |
| 3757 | if !opts.Unicode { |
| 3758 | defaultMarker = ">" |
| 3759 | } |
| 3760 | opts.Marker = &defaultMarker |
searching dependent graphs…