Skip to content
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

GFM Improvements #94

Merged
merged 52 commits into from
Nov 19, 2013
Merged

GFM Improvements #94

merged 52 commits into from
Nov 19, 2013

Conversation

maliayas
Copy link
Member

This branch includes further improvements to PR #93. They are about GitHub flavored Markdown and many other details.

Inner highlighting of fenced code blocks implemented. Credit goes to https://github.com/aziz/knockdown/ Screenshot:

ekran grnts 2013 10 27 21_52_51

Fixes #12, #90, #91, #92

This will allow to grey out tags and make the content explicit (with black color).
Extra commas are there for a workaround of ST parsing bug. Without them, ST can't parse multiline scope list correctly.
This feature will be moved to a new syntax file spesific to GFM.
They were the same with the native Markdown plugin's UUDs
Symbol list is a quick TOC of the markdown document. Sublime Text syntax definition files doesn't allow to parse setext syle headers (`====` or `-----`). This makes symbol list non-reliable.

This commit makes a workaround. Instead of showing nothing about setext style headers in the symbol list, it shows `====` or `------` part of it. `-----` is displayed indented like `## ` header.
@ttscoff
Copy link
Contributor

ttscoff commented Oct 27, 2013

Any reason we don't just make this part of the default Markdown settings? I don't see it conflicting with existing stuff and anyone using fenced code blocks isn't going to mind highlighting. This is really good stuff…

@maliayas
Copy link
Member Author

Thanks.

GFM doesn't change much things, mostly add new things. "anyone using fenced code blocks isn't going to mind highlighting" approach applies to "anyone using GFM isn't going to mind highlighting", too. So this means we can just remove Markdown.tmLanguage file. I don't agree with this. Instead, maybe we should make GFM syntax default, so when the user installs the plugin, GFM one will be enabled. In fact I tried to do that but somehow wasn't able to do it. Markdown.tmLanguage file was mysteriously overriding Markdown GFM.tmLanguage

@ttscoff
Copy link
Contributor

ttscoff commented Oct 27, 2013

I think maybe we rename Markdown_GFM to Markdown, and Markdown to Markdown_noGFM or something, just to make it easy and avoid having people’s default syntaxes change. It also avoids issues where people who have their own syntax file extension settings that would make them miss the new features and never know it.

@maliayas
Copy link
Member Author

Good point. I agree. I'll add a new commit to PR in minutes.

`Markdown.tmLanguage` -> `Markdown (Standard).tmLanguage`
`Markdown GFM.tmLanguage` -> `Markdown.tmLanguage`

Diff looks terrible, don't mind it.
@maliayas
Copy link
Member Author

Weird. It still doesn't work. I'm trying on a freshly installed ST 3. Do you have time to try it?

@ttscoff
Copy link
Contributor

ttscoff commented Oct 27, 2013

Probably not tonight, but I’ll try to test in the morning.

@maliayas
Copy link
Member Author

Ok.

It seems the problem is with the native package. When I disable it, it works. Our Markdown.tmLanguage takes presedence over Markdown (Standard).tmLanguage; but native package wins over both. Too weird. Plugins are for overriding. I don't understand why we can't override.

@maliayas
Copy link
Member Author

I guess I've found the reason. ST matches .sublime-settings files to .tmLanguage files via their names (I knew this before). So our Packages/User/Markdown.sublime-settings file matches with native plugin's Markdown.tmLanguage file, too. And for some reason native one wins. I can't find a way to set ours as default while the native plugin is enabled.

I hope you can find a way. Otherwise, I guess we will have to write a small script that will run once on plugin update and disable the native plugin.

@maliayas
Copy link
Member Author

Last commit is an improvement but still doesn't solve the issue.

@CircleCode
Copy link

I think you forgot to reflect syntax files renaming into the readme: readme still references (GFM) syntax file.

Shorcut is changed, too. So, when a text is selected and <kbd>~</kbd> is pressed, text will be surrounded with `~~` instead of `<del>` tag.
@maliayas
Copy link
Member Author

maliayas commented Nov 3, 2013

How is it going? Are we ready to push the update to users?

@ttscoff
Copy link
Contributor

ttscoff commented Nov 3, 2013

Sorry, been a busier weekend than I expected. I'm sure it's all good,
but I'll try to do some testing by tomorrow.

@maliayas
Copy link
Member Author

maliayas commented Nov 3, 2013

Ok. I've locally created 14 more commits on a branch experiments. I'll publish them today or tomorrow. After we find a solution to overcome the native plugin, I guess we can push the plugin update.

To give a clue, I've implemented an iA Writer feature: keeping current line always vertically centered.

Using Ctrl+B and Ctrl+I directly is not a bad idea if restricted only to markdown. It makes things simpler. I can't see any side effect.

OTOH, when a user makes a text bold, the next thing he will do is most of the time moving the cursor to the right of the bold text. This commit implements this. So there is no need of extra key strokes like `right arrow` or `end` keys. We need to keep the user focused on the text, not the key presses.

This commit also makes it possible to make a _word_ bold/italic without selecting it. Just move the cursor to the word (at the beginning, in the middle or at the and) and press <kbd>Ctrl</kbd> <kbd>B/I</kbd>. Voila! This makes this scenario possible:

* type a word
* press <kbd>Ctrl</kbd> <kbd>B</kbd> to make it bold
* type space
* type next word

This means no extra key strokes like <kbd>Left</kbd>, <kbd>Right</kbd>, <kbd>End</kbd>, <kbd>Tab</kbd>. Only relevant key strokes.
It causes some conflicts and doesn't have any improvements over MarkdownEditing plugin.
@maliayas
Copy link
Member Author

maliayas commented Nov 4, 2013

It's OK. I've completed my experiments branch and merged it here. I've also written the code to disable the native package. It works like a charm. After your review, you can merge this branch. Don't forget to read the commit descriptions when exists.

Some notes:

  1. Commit bc4a320 makes this possible: (If mentioned plugins are installed)

    ekran grnts 2013 10 29 02_50_23

  2. Commit 7002eaa makes this possible:

    ekran grnts 2013 10 30 01_16_54

    This is how GitHub does it:

    ekran grnts 2013 10 30 00_56_19

    This looks good with cheat sheets:

    ekran grnts 2013 10 30 01_30_54

  3. Commit 58f0ecf fixes this bug:

    ekran grnts 2013 11 03 17_43_55

    ... like this:

    ekran grnts 2013 11 03 17_44_23

  4. Commit 1cb52e0 makes it possible to keep current line vertically centered. As the user inserts new lines, current line will stay centered. Users can use this either always or in distraction free mode. It's adjustable in the options. Distraction free mode detection requires another plugin which I've just written for this purpose a few days ago. I believe this feature will improve focusing.

Feedback is always welcome.

Happy Markdown!

@maliayas
Copy link
Member Author

maliayas commented Nov 5, 2013

I'm planning to create a message file for the update. So users would know what has changed. I've 2 questions:

  1. What do you think the next version number should be? (It affects the file name)
  2. What is the purpose of the packages.json file? I guess package manager doesn't require it.

1. It wont re-apply bold/italic if it already is.
2. It will convert to italic with Ctrl+I even if it is bold at that moment and vice versa.
Background color is inspired from the PlainTasks plugin.
@maliayas
Copy link
Member Author

I've created a yellow theme. Here is the screenshot:

yellow

Its background color is inspired from the https://github.com/aziz/PlainTasks plugin. The rest is autogenerated by applying a yellow filter to the original grey theme.

@CircleCode
Copy link

any idea when this pull request could be merged?
I think that if it stays open, commits will always be added to it, since it is always possible to make MarkdownEditing better, but the changes in this PR are really interesting, and I can't wait to see them merged :-)

@maliayas
Copy link
Member Author

I was excited, too. But the author looks really really busy. Btw, when he has some time, he will transfer this repository to this organization: https://github.com/SublimeText-Markdown. At least this is what he said 11 days ago. I think an organization would be more productive. This PR is 23 days old, that's too much.

ttscoff added a commit that referenced this pull request Nov 19, 2013
@ttscoff ttscoff merged commit e8f7c7f into SublimeText-Markdown:master Nov 19, 2013
@maliayas maliayas deleted the gfm branch November 19, 2013 13:38
@maliayas
Copy link
Member Author

Welcome back @ttscoff. It's nice to see you :) I've prepared the plugin for the update and sent a pull request to the Package Control for the URL update.

@ttscoff
Copy link
Contributor

ttscoff commented Nov 19, 2013

Yeah, I've been working 13-15 hour days for a week and a half now. That sprint has cleared up, should be able to help out a little more now, but thanks for taking the reigns. Glad it's moving forward.

@oschrenk
Copy link

You guys are awesome! Thanks for the work!

@maliayas
Copy link
Member Author

Update is online now.

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.

Support for Fenced code blocks (GitHub)
5 participants