[vim/vim] Make links use color scheme colors in TOhtml (PR #10191)

35 views
Skip to first unread message

Max Bernstein

unread,
Apr 14, 2022, 2:58:29 PM4/14/22
to vim/vim, Subscribed

The browser-default dark blue/purple colors don't fit in with most color schemes and also are unreadable if the color scheme has a dark background.

Before:
Screenshot from 2022-04-14 11-56-42

After:
Screenshot from 2022-04-14 11-56-54

NB: I think I am adding this in the right place, but I have not rebuilt Vim to manually test this. Instead, I am adding the CSS manually to the output.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10191

Commit Summary

  • 71503d8 Make links use color scheme colors in TOhtml

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191@github.com>

Max Bernstein

unread,
Apr 14, 2022, 3:12:30 PM4/14/22
to vim/vim, Subscribed

Also, I feel the need to clarify: the "gross" footnote is not a judgement about stack-based VMs, but is a reference to Sam Gross's patchset to CPython that turns it into a register machine.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1099541605@github.com>

Bram Moolenaar

unread,
Apr 14, 2022, 4:54:34 PM4/14/22
to vim/vim, Subscribed

I suppose this depends on what you use TOhtml on. Can a few people that use TOhtml try out this change?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1099612435@github.com>

Christian Brabandt

unread,
Apr 17, 2022, 10:47:51 AM4/17/22
to vim/vim, Subscribed

ping @fritzophrenic


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1100893708@github.com>

fritzophrenic

unread,
Apr 17, 2022, 10:05:19 PM4/17/22
to vim/vim, Subscribed

Thanks, I'll try to take a look in the coming week. I had thought the links were already colored... maybe that was just a wishlist item.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1101023144@github.com>

Yegappan Lakshmanan

unread,
Aug 14, 2023, 12:58:06 AM8/14/23
to vim/vim, Subscribed

Any updates on this?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1676678868@github.com>

fritzophrenic

unread,
Aug 14, 2023, 10:42:04 PM8/14/23
to vim/vim, Subscribed

Not really. I confirmed the issue and entered a ticket for it. I think being able to specify color is better than always using a non-link color so I wrote it accordingly: https://sourceforge.net/p/vim-tohtml/issues/35/

It'll also need a test.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1678350311@github.com>

Max Bernstein

unread,
Aug 15, 2023, 10:50:18 AM8/15/23
to vim/vim, Subscribed

Unrelated, but I was looking at this again and LineNr should probably have user-select: none;, but that's a bigger, functionally different change


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1679069180@github.com>

Max Bernstein

unread,
Aug 15, 2023, 10:54:48 AM8/15/23
to vim/vim, Subscribed

Also, the URL parser seems to include trailing characters in it. For example, if you have

// Copyright Joseph Schmoe (https://schmoejoseph.com)
int main() {
  // ...
}

the trailing ) gets included in the href


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1679077550@github.com>

fritzophrenic

unread,
Aug 15, 2023, 2:48:10 PM8/15/23
to vim/vim, Subscribed

Unrelated, but I was looking at this again and LineNr should probably have user-select: none;, but that's a bigger, functionally different change

Good news!

You probably want to set g:html_prevent_copy as you desire and then set g:html_use_input_for_pc to "none".


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1679425900@github.com>

fritzophrenic

unread,
Aug 15, 2023, 2:54:04 PM8/15/23
to vim/vim, Subscribed

Also, the URL parser seems to include trailing characters in it. For example, if you have

// Copyright Joseph Schmoe (https://schmoejoseph.com)
int main() {
  // ...
}

the trailing ) gets included in the href

I'm not sure how this would be handled correctly, because parentheses are valid inside a URL. I could do something like this which I think looks for a URL that is directly surrounded by both an open and close parenthesis, but what if you did "You can check out my social media (or I blog at https.example.com/bloggy-blog-blog)"? It's probably better to manually correct the link or use the new option that prevents creating them altogether. I'm open to suggestions though. Please file a different issue for that. Bonus points if you do it on the sourceforge project but I can transfer it like I've been doing :)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1679432131@github.com>

Max Bernstein

unread,
Aug 15, 2023, 3:12:34 PM8/15/23
to vim/vim, Subscribed

I'm not sure how this would be handled correctly, because parentheses are valid inside a URL.

This is true. I think it would be interesting to look at how different widely-used auto linkification implementations do this because there is probably some amount of agreed-upon/expected behavior. But maybe not! I only know of Facebook's, since I briefly worked on it once upon a time.

Sorry about dumping everything into this issue. I had a couple idle ideas and no real complaints since this stuff works really well already.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c1679458753@github.com>

Christian Brabandt

unread,
Nov 2, 2024, 1:13:36 PM11/2/24
to vim/vim, Subscribed

@fritzophrenic @tekknolagi any updates here? Is this good to be included?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c2453051653@github.com>

fritzophrenic

unread,
Nov 2, 2024, 1:43:55 PM11/2/24
to vim/vim, Subscribed

@fritzophrenic @tekknolagi any updates here? Is this good to be included?

Sorry, I've been very inactive lately. I had to check, it looks like I haven't tried regression testing it or anything but I suppose it is low risk.

I wanted to add an option to allow specifying an override color before I merged it. I will try to hop back in and make another release with this included but don't really have a timeframe for it. If you want to merge it I can sync up later.

I just worry with this change people will have the opposite issue of "hey now I can't tell where any links are!"


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c2453059426@github.com>

Christian Brabandt

unread,
Nov 2, 2024, 1:48:33 PM11/2/24
to vim/vim, Subscribed

Thanks. Then let me include this now. If people complain we can always add another switch later.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/c2453060656@github.com>

Christian Brabandt

unread,
Nov 2, 2024, 1:50:40 PM11/2/24
to vim/vim, Subscribed

Closed #10191 via b256221.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10191/issue_event/15082329821@github.com>

Reply all
Reply to author
Forward
0 new messages