New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colourful :digraphs output #3572
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3572 +/- ##
==========================================
- Coverage 77.33% 77.32% -0.02%
==========================================
Files 99 99
Lines 139172 139178 +6
==========================================
- Hits 107634 107621 -13
- Misses 31538 31557 +19
Continue to review full report at Codecov.
|
Marcin Szamotulski wrote:
This is a tiny patch, that makes the output of `:digraph` command more
readable by colouring the `:digraphs` output using the `WarningMsg`
highlight group.
Interesting idea. However, I would not highlight the character itself.
It actually gets another color when output in <00> form.
How about using the Line number highlight for the two typed characters
and for the character number?
p = buf;
*p++ = dp->char1;
*p++ = dp->char2;
*p++ = ' ';
*p = NUL;
msg_outtrans_attr(buf, HL_ATTR(HLF_N));
p = buf;
#ifdef FEAT_MBYTE
if (has_mbyte)
{
/* add a space to draw a composing char on */
if (enc_utf8 && utf_iscomposing(dp->result))
*p++ = ' ';
p += (*mb_char2bytes)(dp->result, p);
}
else
#endif
*p++ = (char_u)dp->result;
*p = NUL;
msg_outtrans(buf);
p = buf;
if (char2cells(dp->result) == 1)
*p++ = ' ';
vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result);
msg_outtrans_attr(buf, HL_ATTR(HLF_CLN));
…--
Error:015 - Unable to exit Windows. Try the door.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
I prefer my original proposition for three reasons:
* it just highlights the important colum, which makes it easier to focus on what one is searching for
* this is probably more opinionated, but current line number if it is differrent from line number color, I tend to have it quite distinct, which makes it the most important column when highlighted, which does not agree with the previous point
* I don't mind both `<..>` and other digraphs with the same colour, since in this list they have very similar meaning (`I am digraph`)
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Sunday, October 28, 2018 2:08 PM, Bram Moolenaar ***@***.***> wrote:
Marcin Szamotulski wrote:
> This is a tiny patch, that makes the output of `:digraph` command more
> readable by colouring the `:digraphs` output using the `WarningMsg`
> highlight group.
Interesting idea. However, I would not highlight the character itself.
It actually gets another color when output in <00> form.
How about using the Line number highlight for the two typed characters
and for the character number?
p = buf;
*p++ = dp->char1;
*p++ = dp->char2;
*p++ = ' ';
*p = NUL;
msg_outtrans_attr(buf, HL_ATTR(HLF_N));
p = buf;
#ifdef FEAT_MBYTE
if (has_mbyte)
{
/* add a space to draw a composing char on */
if (enc_utf8 && utf_iscomposing(dp->result))
*p++ = ' ';
p += (*mb_char2bytes)(dp->result, p);
}
else
#endif
*p++ = (char_u)dp->result;
*p = NUL;
msg_outtrans(buf);
p = buf;
if (char2cells(dp->result) == 1)
*p++ = ' ';
vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result);
msg_outtrans_attr(buf, HL_ATTR(HLF_CLN));
--
Error:015 - Unable to exit Windows. Try the door.
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.[https://github.com/notifications/beacon/AAqnYRXXxsHrNZPPZx8o_aHaZiFb4hNJks5upbpqgaJpZM4X9604.gif]
|
But maybe we should go even further: various digraphs groups could be highlighted with different colour, this would make searching for a given type of character event quicker. Let me try...
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Sunday, October 28, 2018 4:19 PM, Marcin Szamotulski ***@***.***> wrote:
I prefer my original proposition for three reasons:
* it just highlights the important colum, which makes it easier to focus on what one is searching for
* this is probably more opinionated, but current line number if it is differrent from line number color, I tend to have it quite distinct, which makes it the most important column when highlighted, which does not agree with the previous point
* I don't mind both `<..>` and other digraphs with the same colour, since in this list they have very similar meaning (`I am digraph`)
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, October 28, 2018 2:08 PM, Bram Moolenaar ***@***.***> wrote:
> Marcin Szamotulski wrote:
>
> > This is a tiny patch, that makes the output of `:digraph` command more
> > readable by colouring the `:digraphs` output using the `WarningMsg`
> > highlight group.
>
> Interesting idea. However, I would not highlight the character itself.
> It actually gets another color when output in <00> form.
>
> How about using the Line number highlight for the two typed characters
> and for the character number?
>
> p = buf;
> *p++ = dp->char1;
> *p++ = dp->char2;
> *p++ = ' ';
> *p = NUL;
> msg_outtrans_attr(buf, HL_ATTR(HLF_N));
> p = buf;
> #ifdef FEAT_MBYTE
> if (has_mbyte)
> {
> /* add a space to draw a composing char on */
> if (enc_utf8 && utf_iscomposing(dp->result))
> *p++ = ' ';
> p += (*mb_char2bytes)(dp->result, p);
> }
> else
> #endif
> *p++ = (char_u)dp->result;
> *p = NUL;
> msg_outtrans(buf);
> p = buf;
> if (char2cells(dp->result) == 1)
> *p++ = ' ';
> vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result);
> msg_outtrans_attr(buf, HL_ATTR(HLF_CLN));
>
> --
> Error:015 - Unable to exit Windows. Try the door.
>
> /// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\ an exciting new programming language -- http://www.Zimbu.org ///
> \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
>
> —
>
> You are receiving this because you authored the thread.
>
> Reply to this email directly, view it on GitHub, or mute the thread.[https://github.com/notifications/beacon/AAqnYRXXxsHrNZPPZx8o_aHaZiFb4hNJks5upbpqgaJpZM4X9604.gif]
|
@brammool I pushed a proof of concept, let me know what do you think. |
Marcin Szamotulski wrote:
@brammool I pushed a proof of concept, let me know what do you think.
Hmm, I still think that making the character itself colored makes it a
bit harder to recognize. Depending on the highlighting the contrast may
be insufficient.
I'm not sure how you decided about these groups. We could apply the
color like that to the two-character column only, that looks a bit
better. But it's still difficult to see where the group you are looking
for starts. Perhaps we should have headers (fake names):
Cyrillic
w! ẁ 7809 W' Ẃ 7810 w' ẃ 7811 W: Ẅ 7812 w: ẅ 7813 W. Ẇ 7814
w. ẇ 7815 X. Ẋ 7818 x. ẋ 7819 X: Ẍ 7820 x: ẍ 7821 Y. Ẏ 7822
y. ẏ 7823 Z> Ẑ 7824 z> ẑ 7825 Z_ Ẕ 7828 z_ ẕ 7829 h_ ẖ 7830
t: ẗ 7831 w0 ẘ 7832 y0 ẙ 7833 A2 Ả 7842 a2 ả 7843 E2 Ẻ 7866
e2 ẻ 7867 E? Ẽ 7868 e? ẽ 7869 I2 Ỉ 7880 i2 ỉ 7881 O2 Ỏ 7886
Graphics
o2 ỏ 7887 U2 Ủ 7910 u2 ủ 7911 Y! Ỳ 7922 y! ỳ 7923 Y2 Ỷ 7926
y2 ỷ 7927 Y? Ỹ 7928 y? ỹ 7929 ;' ἀ 7936 ,' ἁ 7937 ;! ἂ 7938
,! ἃ 7939 ?; ἄ 7940 ?, ἅ 7941 !: ἆ 7942 ?: ἇ 7943 1N 8194
1M 8195 3M 8196 4M 8197 6M 8198 1T 8201 1H 8202
Mathematical
-1 ‐ 8208 -N – 8211 -M — 8212 -3 ― 8213 !2 ‖ 8214 =2 ‗ 8215
'6 ‘ 8216 '9 ’ 8217 .9 ‚ 8218 9' ‛ 8219 "6 “ 8220 "9 ” 8221
:9 „ 8222 9" ‟ 8223 /- † 8224 /= ‡ 8225 .. ‥ 8229 ,. … 8230
%0 ‰ 8240 1' ′ 8242 2' ″ 8243 3' ‴ 8244 1" ‵ 8245 2" ‶ 8246
…--
The greatest lies of all time:
(1) The check is in the mail.
(2) We have a really challenging assignment for you.
(3) I love you.
(4) All bugs have been fixed.
(5) This won't hurt a bit.
(6) Honey, I just need to debug this program and be home in 5 minutes.
(7) I have just sent you an e-mail about that.
(8) Of course I'll respect you in the morning.
(9) I'm from the government, and I'm here to help you.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Having a dedicated highlight group will solve any contrast problems, more easily than using The boundaries were a bit arbitrary (proof of concept), and I agree that using headers would be a better option. |
I've been using the original patch for a long time, and this is how it
looks when the contrast is set right (though this is a personal thing)
![screenshot from 2018-10-28
19-31-04](https://user-images.githubusercontent.com/698209/47620220-b4c26100-dadf-11e8-8c4e-201b0d94b1cf.png)
I think the headers can work very well, if we can think of a good name.
O; Ǫ 490 o; ǫ 491 O1 Ǭ 492 o1 ǭ 493 EZ Ǯ 494 ez ǯ 495
j< ǰ 496 G' Ǵ 500 g' ǵ 501 ;S ʿ 703 '< ˇ 711 '( ˘ 728
'. ˙ 729 '0 ˚ 730 '; ˛ 731 '" ˝ 733 A% Ά 902 E% Έ 904
Y% Ή 905 I% Ί 906 O% Ό 908 U% Ύ 910 W% Ώ 911 i3 ΐ 912
A* Α 913 B* Β 914
Greek
G* Γ 915 D* Δ 916 E* Ε 917 Z* Ζ 918 Y* Η 919 H* Θ 920
I* Ι 921 K* Κ 922 L* Λ 923 M* Μ 924 N* Ν 925 C* Ξ 926
O* Ο 927 P* Π 928 R* Ρ 929 S* Σ 931 T* Τ 932 U* Υ 933
F* Φ 934 X* Χ 935 Q* Ψ 936 W* Ω 937 J* Ϊ 938 V* Ϋ 939
a% ά 940 e% έ 941 y% ή 942 i% ί 943 u3 ΰ 944 a* α 945
b* β 946 g* γ 947 d* δ 948 e* ε 949 z* ζ 950 y* η 951
h* θ 952 i* ι 953 k* κ 954 l* λ 955 m* μ 956 n* ν 957
We can use some highlight for the title.
The greek letters actually start with 902.
We probably need to do this on a category, since Greek letters appear in
more than one range.
…--
They now pass three KNIGHTS impaled to a tree. With their feet off the
ground, with one lance through the lot of them, they are skewered up
like a barbecue.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Are groups really that useful? (I also fear, that would break my unicode plugin). |
I'd rather not see Christian's Unicode plugin get broken (I use it a lot); but the Unicode Consortium already uses standardized names, such as:
When letters of a single script appear in more than one range, the subranges are given distinct names (as for Latin in 4 of the above 7 examples), and I think this matters less for Vim (which can show all the digraphs in answer to one command) than for the Unicode.org PDF charts themselves, where I sometimes have to try a handful of separate charts with "likely" names before I find out the exact Unicode codepoint number for the exotic character I want to type. Best regards, |
Are groups really that useful?
(I also fear, that would break my unicode plugin).
The problem is that the list of digraphs is very, very long. Searching for a
specific character is hard. Adding headers and grouping characters together,
E.g. Greek characters, makes it a lot more useful.
Not sure how your unicode plugin depends on the :digraph output?
…--
Facepalm statement #1: "I'm going to New York tomorrow, hopefully I have time
to visit the White House"
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Several of its functionalities are about digraph values, I suppose the plugin gets them from the
Digraphs are mentioned under 1 and 3, but all digraphs (if any) for the current character are also listed by the Best regards, |
There is no other way to get all digraphs than to parse the :digraph output. Adding section headers will break the current approach, however, I can fix this, so this is only a minor issue. I just need to be aware of it... |
Problem: :digraph output is not easy to read. Solution: Add highlighting for :digraphs. (Marcin Szamotulski, closes vim/vim#3572) Also add section headers for :digraphs!. vim/vim@eae8ae1
This is a tiny patch, that makes the output of
:digraph
command more readable by colouring the:digraphs
output using theWarningMsg
highlight group.