Skip to content

Conversation

noborus
Copy link
Owner

@noborus noborus commented Jan 10, 2025

  • Upgraded tcell to version v2.8.0.
  • Added support for Underline style and color in ov.
  • Modified oviewer/convert_es.go to handle the new Underline styles and colors.
  • Updated oviewer/ovstyle.go to apply the new Underline styles and colors.
  • Upgraded other modules.

- Upgraded tcell to version v2.8.0.
- Added support for Underline style and color in ov.
- Modified oviewer/convert_es.go to handle the new Underline styles and colors.
- Updated oviewer/ovstyle.go to apply the new Underline styles and colors.
- Upgraded other modules.
@noborus noborus marked this pull request as ready for review January 10, 2025 03:15
Comment on lines 150 to 153
return 0
}
if tcell.UnderlineStyle(n) > tcell.UnderlineStyleDashed {
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no constants for this 0 ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is. I'll fix it, thanks.

Comment on lines 144 to 146
// underLineStyle sets the underline style.
// only support 0-5.
// 0: None, 1: Single, 2: Double, 3: Curly, 4: Dotted, 5: Dashed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About this

#680 (comment)

Maybe you could link the constants here with a godoc link

Something like this (pseudo code)

Suggested change
// underLineStyle sets the underline style.
// only support 0-5.
// 0: None, 1: Single, 2: Double, 3: Curly, 4: Dotted, 5: Dashed
// underLineStyle sets the underline style.
// only support 0-5.
// 0: [tview.WhateverNone], 1: [tview.WhateverSingle], 2: Double, 3: Curly, 4: Dotted, 5: Dashed

if err != nil {
return 0
}
if tcell.UnderlineStyle(n) > tcell.UnderlineStyleDashed {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange

I assume you only wanto support 0-5 range, but these are iota, I assume. So comparing them is a but strange

I would use a switch with the exact value you support in one case.

Also, if you only supports the value "0", "1", maybe you could avoid the string to int conversion

Copy link
Contributor

@ccoVeille ccoVeille Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw you added negative checks now

But what do you think about my comment just above this one?

EDIT @nobe4 wrong ping 😬😅
@noburus

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how to do the behavior of an unauthorized value outside the specifications.
The operation changes with Terminal-Emulator, so it may change in the future.

Originally, it is derived from the escape sequence specification, so it doesn't matter much whether it is an iota.

noburus is not a person concerned. 😥

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, a double wrong ping 🤦‍♂️

Bug fixes in tcell v2.8.0.
Update modules.
@noborus
Copy link
Owner Author

noborus commented Jan 12, 2025

The following is also displayed in Gnome-Terminal.

echo "\x1b[4:2m\x1b[58:5:1mHello"|./ov

Change to UnderlineStyle to match the tcell.
Add UnderlineStyle and UnderlineColor to config.yaml and README.md.
@noborus noborus merged commit 82139ea into master Jan 13, 2025
8 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [noborus/ov](https://github.com/noborus/ov) | minor | `v0.37.0` -> `v0.38.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>noborus/ov (noborus/ov)</summary>

### [`v0.38.0`](https://github.com/noborus/ov/releases/tag/v0.38.0)

[Compare Source](noborus/ov@v0.37.0...v0.38.0)

#### What's Changed

-   Improve escape sequence compatibility by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#656
    -   Add support for colon-separated values by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#657
    -   Change the range to csiParamStart/csiParamEnd  by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#659
    -   Add stdin specification by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#661
    -   Reimplemented osc hyperlink by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#664
    -   Fixed incompatibility in handling invalid osc by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#665

-   Upgrade tcell to v2.8.0 and add support for Underline style and color by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#680

-   Add EOF notification feature by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#683
    -   Add function to wait for EOF by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#673

-   Fix the first position of Follow and Followall by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#671

-   Fix DocumentLen() out-of-range checks by [@&#8203;noborus](https://github.com/noborus) in noborus/ov#675

**Full Changelog**: noborus/ov@v0.37.0...v0.38.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzcuMiIsInVwZGF0ZWRJblZlciI6IjM5LjEzNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
@noborus noborus deleted the tcell-v280 branch February 3, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants