GNU nano - Bugs: bug #58130, [Wish] extra syntax highlighting...
You are not allowed to post comments on this tracker with your current authentication level.
bug #58130: [Wish] extra syntax highlighting files -- Haskell and Markdown
Submitter: | Ryan Westlund <yujiri> | ||
Submitted: | Mon 06 Apr 2020 09:08:00 PM UTC | ||
Severity: | 1 - Wish | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Wed 16 Sep 2020 05:41:26 PM UTC, comment #34: |
Benno Schulenberg <bens> |
Mon 14 Sep 2020 08:02:30 PM UTC, comment #33: I agree that the new syntax bring improvements as Hussam mentioned, including the highlighting of "error", the fixes to comments and character literals and the separation of the contextual keywords "as", "qualified", and "hiding" which are not reserved as identifiers. I did approve of it. I didn't notice the problem with using white because I tested it on a black terminal. |
Ryan Westlund <yujiri> |
Mon 14 Sep 2020 07:22:42 AM UTC, comment #32: Ryan? Do you think the newly proposed Haskell syntax is better than the current one? |
Benno Schulenberg <bens> |
Thu 30 Jul 2020 07:13:13 AM UTC, comment #31: Released in nano-5.0. |
Benno Schulenberg <bens> |
Tue 26 May 2020 03:00:00 PM UTC, comment #30: (Issues get closed when the relevant fixes/changes have been released. That will still take some weeks.) |
Benno Schulenberg <bens> |
Mon 25 May 2020 02:12:47 PM UTC, comment #29: I believe this can be marked as closed now, given the last comment. |
Ryan Westlund <yujiri> |
Thu 14 May 2020 01:23:58 PM UTC, comment #28: If there are any other syntaxes you would like to see added in nano's tarball, then please post a new issue. |
Benno Schulenberg <bens> |
Tue 21 Apr 2020 10:05:21 AM UTC, comment #27: Thanks. Pushed to master in commit 36e22c99, with a few tweaks.
|
Benno Schulenberg <bens> |
Tue 21 Apr 2020 01:08:11 AM UTC, comment #26: Ah, I assumed the file was written by Scopatz. Having received the go-ahead from Alex Taber, I'll attach a new version with the undefined thing fixed.
|
Ryan Westlund <yujiri> |
Mon 20 Apr 2020 04:49:24 PM UTC, comment #25: Thanks for the full patch. However, when I look at the history of that haskell syntax file [1], it was authored by astronautlevel2 (Alex Taber). So, we will have to ask him directly whether it is okay if we include his file into nano, under the GPL version 3. Please send him an email (aft.pokemon (at) gmail.com) and CC me.
|
Benno Schulenberg <bens> |
Mon 20 Apr 2020 02:26:06 PM UTC, comment #24: Ah, thanks. Attaching patch file. |
Ryan Westlund <yujiri> |
Mon 20 Apr 2020 11:48:27 AM UTC, comment #23: Thanks. I've changed also the regex for strikethrough, to avoid coloring the text between two stricken-through words. Pushe to master in commit c859fd40.
|
Benno Schulenberg <bens> |
Sun 19 Apr 2020 01:51:57 PM UTC, comment #22: Ah. I should've tested with text.md.
|
Ryan Westlund <yujiri> |
Sun 19 Apr 2020 09:05:59 AM UTC, comment #21: Your description of what is needed is good: forbid whitespace immediately after the leading asterisk. But your implementation forbids /any/ space between the asterisks. Look at text.md and see that This text will be italic is not green.
(where the \t is a literal tab). |
Benno Schulenberg <bens> |
Fri 17 Apr 2020 07:43:17 PM UTC, comment #20: Ah, indeed! Requiring not a space after the opening emphasis character for italics also solves the problem of `**bold** normal *bold*` coloring the text intended as normal as italics. I had assumed that was unsolvable, like the similar one with Python or Javascript strings, but this seems to fix it without causing additional issues. I'm going to attach a patch that has this change applied. |
Ryan Westlund <yujiri> |
Fri 17 Apr 2020 07:31:12 PM UTC, comment #19: Ah, I'm surprised I didn't notice the issue with list items and italics. I wonder if changing the italics regex from `\*[^*]+\*|_[^_]+_` to `\*[^* ]+\*|_[^_]+_` would work, making it not match if there's a space immediately after the first asterisk. |
Ryan Westlund <yujiri> |
Fri 17 Apr 2020 05:42:43 PM UTC, comment #18: My criterium for adding syntaxes is roughly: files to which the syntax applies can be found on an average default install of a Unixy system or in an average software package. Man files are there for sure, and some people edit them. PO files are in many tarballs, and translators want to edit them. On my system there are some awk and tcl files too. But indeed, I would think that asm, fortran, and groff files are rare enough that those syntaxes can be pushed down to extra/.
|
Benno Schulenberg <bens> |
Fri 17 Apr 2020 02:25:23 PM UTC, comment #17: Patch files for Markdown and Haskell added. Good catch noticing my plusses were pointless. But it looks like you added a ^ for the starting regex for fenced code blocks in the last upload. I didn't include this in the patch because it meant in fenced code blocks that were also indented under a list item, content starting with > would be seen as a block quote (I found this because I'm using it for a Python REPL excerpt in a list) and colored as that.
|
Ryan Westlund <yujiri> |
Fri 17 Apr 2020 10:21:41 AM UTC, comment #16: (When improving a file, please use the last version that I posted, otherwise it's extra work for me to figure out what you changed.)
|
Benno Schulenberg <bens> |
Thu 16 Apr 2020 10:41:00 PM UTC, comment #15: Oh! I can't believe I forgot this: trailing whitespace should be colored because two spaces at the end of a line render as a <br>. I'll attach a new nanorc file with a line for that added.
|
Ryan Westlund <yujiri> |
Thu 16 Apr 2020 05:49:37 PM UTC, comment #14: I just came across an issue with the markdown one: indented code blocks require a blank line after them or else they color the paragraph after them as code. The regex for terminating an indented code block was only satisfied by a blank line, and not by an unindented line.
|
Ryan Westlund <yujiri> |
Tue 14 Apr 2020 02:56:44 PM UTC, comment #13: Scopatz does have a systemd file, but I can't comment on it since I run FreeBSD. I would like to see the Haskell one added, even if it goes to extra/. (My PR to improve it got merged a few days ago.)
|
Ryan Westlund <yujiri> |
Tue 14 Apr 2020 02:19:21 PM UTC, comment #12: Thanks. The markdown syntax has been pushed to master, commit fb53ad9c.
|
Benno Schulenberg <bens> |
Mon 13 Apr 2020 01:45:51 PM UTC, comment #11: Ah, I see. Okay. I found two more things:
|
Ryan Westlund <yujiri> |
Sun 12 Apr 2020 05:31:38 PM UTC, comment #10: In email a tab may get converted to spaces, but if you download file #48801, it should contain two real tabs.
|
Benno Schulenberg <bens> |
Sun 12 Apr 2020 01:27:45 PM UTC, comment #9: It looks like the tab characters got replaced with 8 spaces? I don't think this is the intended effect since each `[ ]` in regex is identical to `[ ]` as far as I know. The previous version had `[ ]` (matching either a space or a tab). Markdown normally allows either four spaces or a tab as indentation for list item levels or code blocks, so I think `^( | )*` (either four spaces or a tab, any number of levels) is the proper regex for both. (I realize now that my original file allowed only one space, which it shouldn't. I've heard some implementations treat that as indentation but the standard says it has to be four or a tab.) |
Ryan Westlund <yujiri> |
Fri 10 Apr 2020 08:55:53 AM UTC, comment #8: Attached version colors blue anything between parentheses after a pair or square brackets. This also means that anything between square brackets becomes magenta even when not followed by something between parentheses, but.. the other markdown syntaxes I've seen do that too, so...
|
Benno Schulenberg <bens> |
Fri 10 Apr 2020 01:41:31 AM UTC, comment #7: Your syntax seems really good! I'm not sure if it's a good idea to have inline code after headings, and I'm a little put off by how link hrefs are only colored blue if they're a full URL, meaning for example that relative path links (which I use a lot) stay magenta. But there might not be a good way around that, and I see the usefulness of having URLs highlighted outside of `[]()` links since some Markdown implementations turn a standalone URL into a link automatically. |
Ryan Westlund <yujiri> |
Thu 09 Apr 2020 12:39:07 PM UTC, comment #6: Thanks. Here is a further developed version, made while looking at https://en.wikipedia.org/wiki/Markdown#Example and using the attached text.md as a test file.
|
Benno Schulenberg <bens> |
Wed 08 Apr 2020 06:04:54 PM UTC, comment #5: His markdown file might be better than mine; I left some features out of mine because the markdown processor I'm currently using (mistune) doesn't have them. (No strikethrough, etc.)
|
Ryan Westlund <yujiri> |
Wed 08 Apr 2020 06:02:42 PM UTC, comment #4: Alright, I wasn't sure if it made sense to post the files here since this thread isn't a patch.
|
Ryan Westlund <yujiri> |
Wed 08 Apr 2020 05:33:08 PM UTC, comment #3: Please post your self-constructed markdown.nanorc. We can built it up from there, and include it as a main syntax.
|
Benno Schulenberg <bens> |
Wed 08 Apr 2020 01:00:42 PM UTC, comment #2: Nginx and CSV are things that seem like good includes (although on testing them out, I've noticed the Nginx one has an issue that makes comments invisible on a black terminal). I would personally benefit from the Fish one. Markdown also seems like an excellent idea (although I've already half-written my own for that which is very different).
|
Ryan Westlund <yujiri> |
Tue 07 Apr 2020 10:21:37 AM UTC, comment #1: Yes, those files have been there for a long time. The author(s) never submitted any of them upstream.
|
Benno Schulenberg <bens> |
Mon 06 Apr 2020 09:08:00 PM UTC, original submission:
I recently came across a whole bunch of syntax highlighting files at https://github.com/scopatz/nanorc, many for things Nano doesn't already come with a file for. How about pulling some of these?
|
Ryan Westlund <yujiri> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 25 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-09-16 | bens | Open/Closed | Open | Closed | |
2020-09-14 | bens | Open/Closed | Closed | Open | |
2020-07-30 | bens | Open/Closed | Open | Closed | |
2020-05-14 | bens | Status | In Progress | Fixed | |
Summary | [Wish] extra syntax highlighting files | [Wish] extra syntax highlighting files -- Haskell and Markdown | |||
2020-04-21 | yujiri | Attached File | - | Added 0002-syntax-new-file-Haskell.patch, #48888 | |
2020-04-20 | yujiri | Attached File | - | Added 0001-syntax-new-file-Haskell.patch, #48880 | |
2020-04-20 | bens | Status | None | In Progress | |
2020-04-19 | yujiri | Attached File | - | Added markdown-comment22.patch, #48870 | |
2020-04-17 | yujiri | Attached File | - | Added markdown-comment20.patch, #48861 | |
2020-04-17 | bens | Attached File | - | Added psmisc-README.md, #48859 | |
Attached File | - | Added simple-resume.md, #48860 | |||
2020-04-17 | yujiri | Attached File | - | Added markdown.patch, #48855 | |
Attached File | - | Added haskell.patch, #48856 | |||
2020-04-17 | bens | Attached File | - | Added markdown.nanorc, #48854 | |
2020-04-16 | yujiri | Attached File | - | Added markdown.nanorc, #48853 | |
2020-04-16 | yujiri | Attached File | - | Added haskell.nanorc, #48849 | |
Attached File | - | Added markdown.nanorc, #48850 | |||
Attached File | - | Added test.md, #48851 | |||
2020-04-13 | yujiri | Attached File | - | Added markdown.nanorc, #48828 | |
2020-04-12 | bens | Attached File | - | Added markdown.nanorc, #48824 | |
2020-04-10 | bens | Attached File | - | Added markdown.nanorc, #48801 | |
Attached File | - | Added text.md, #48802 | |||
2020-04-09 | bens | Attached File | - | Added markdown.nanorc, #48791 | |
Attached File | - | Added text.md, #48792 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Thanks for the confirmation. Now waiting for Hussam to repost.