feat(ST2.EditorPackages): bump up all packages
- Refresh PackageCache with latest versions of everything
This commit is contained in:
@@ -22,5 +22,10 @@
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+enter"], "command": "smart_new_line", "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -22,5 +22,10 @@
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+enter"], "command": "smart_new_line", "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -22,5 +22,10 @@
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+enter"], "command": "smart_new_line", "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -1 +1 @@
|
||||
{"url": "https://github.com/demon386/SmartMarkdown", "version": "2013.03.23.12.24.10", "description": "A plugin for facilitating editing markdown in Sublime Text 2. Features are borrowed from Org mode of Emacs."}
|
||||
{"url": "https://github.com/demon386/SmartMarkdown", "version": "2013.06.16.12.00.50", "description": "A plugin for facilitating editing markdown in Sublime Text 2. Features are borrowed from Org mode of Emacs."}
|
@@ -5,6 +5,21 @@ Author: Muchenxuan Tong (demon386@gmail.com)
|
||||
## Introduction
|
||||
The plugin is aimed at making editing Markdown in Sublime Text 2 easier and more powerful. Ideally, I hope we can bring several amazing features of [Org-mode](http://org-mode.org) of Emacs into Sublime Text.
|
||||
|
||||
## What's new
|
||||
### v0.3: Adjust the position of folding mark to the end of headline. (added by [vovkkk](https://github.com/vovkkk) and [alehandrof](https://github.com/alehandrof))
|
||||
### v0.2: Support for Sublime Text 3 (added by [UNOwen](https://github.com/UNOwen).)
|
||||
### v0.1.6: Add support and bindings for headline level changing. (added by [David Smith](https://github.com/djs070).) The key bindings are: **Super+Shift+,** for decreasing and **Super+Shift+.** for increasing.
|
||||
### v0.1.5: Basic smart table (grid table) support added. Basic Pandoc intergration (added by [DanielMe](https://github.com/DanielMe/).)
|
||||
### v0.1.3: Add support for global headling folding / unfolding.
|
||||
### v0.1.2: Move between headlines supported!
|
||||
- Use **Ctrl+c Ctrl+n** to move to the next headline (any level); **Ctrl+c Ctrl+p** to the previous one.
|
||||
- Use **Ctrl+c Ctrl+f** to move to the next headline (same level or higher level); **Ctrl+c Ctrl+b** to the previous one.
|
||||
- Fixed a bug on bullet list. Thanks to quodlibet (fixed in v0.1.1).
|
||||
|
||||
### v0.1.0: Created!
|
||||
- Smart Headline folding / unfolding is supported.
|
||||
- Smart Lists is supported.
|
||||
|
||||
## Done
|
||||
- **Smart Headline folding / unfolding**. Right now you can fold / unfold headlines by pressing **TAB** on it. I assume you use the following formats: # Section; ## Subsection; ### Subsubsection ...
|
||||
- **Global Headline Folding / unfolding**. **Shift+Tab** to Fold / Unfold all at any position.
|
||||
@@ -27,19 +42,6 @@ The plugin is aimed at making editing Markdown in Sublime Text 2 easier and more
|
||||
- **Better Pandoc integration** Actual support for different Pandoc command line options etc.
|
||||
- ...
|
||||
|
||||
## What's new
|
||||
### v0.2: Support for Sublime Text 3 (added by [UNOwen](https://github.com/UNOwen).)
|
||||
### v0.1.6: Add support and bindings for headline level changing. (added by [David Smith](https://github.com/djs070).) The key bindings are: **Super+Shift+,** for decreasing and **Super+Shift+.** for increasing.
|
||||
### v0.1.5: Basic smart table (grid table) support added. Basic Pandoc intergration (added by [DanielMe](https://github.com/DanielMe/).)
|
||||
### v0.1.3: Add support for global headling folding / unfolding.
|
||||
### v0.1.2: Move between headlines supported!
|
||||
- Use **Ctrl+c Ctrl+n** to move to the next headline (any level); **Ctrl+c Ctrl+p** to the previous one.
|
||||
- Use **Ctrl+c Ctrl+f** to move to the next headline (same level or higher level); **Ctrl+c Ctrl+b** to the previous one.
|
||||
- Fixed a bug on bullet list. Thanks to quodlibet (fixed in v0.1.1).
|
||||
|
||||
### v0.1.0: Created!
|
||||
- Smart Headline folding / unfolding is supported.
|
||||
- Smart Lists is supported.
|
||||
|
||||
## For Developers
|
||||
- Whenever possible, please obey the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide. This can be checked easily with the plugin SublimeLinter.
|
||||
|
@@ -24,6 +24,25 @@ except ValueError:
|
||||
HEADLINE_PATTERN = re.compile(r'^(#+)\s.*')
|
||||
|
||||
|
||||
class SmartNewLineCommand(sublime_plugin.TextCommand):
|
||||
"""Changes behavior of default 'insert line after'
|
||||
Puts new line after folding mark if any.
|
||||
"""
|
||||
def run(self, edit):
|
||||
points = []
|
||||
for s in self.view.sel():
|
||||
r = self.view.full_line(s)
|
||||
if headline._is_region_folded(r.b + 1, self.view):
|
||||
i = headline.region_of_content_of_headline_at_point(self.view, s.b)
|
||||
else:
|
||||
i = sublime.Region(r.a, r.b - 1)
|
||||
points.append(i)
|
||||
self.view.insert(edit, i.b, '\n')
|
||||
self.view.sel().clear()
|
||||
for p in points:
|
||||
self.view.sel().add(p.b + 1)
|
||||
|
||||
|
||||
class SmartFoldingCommand(sublime_plugin.TextCommand):
|
||||
"""Smart folding is used to fold / unfold headline at the point.
|
||||
|
||||
@@ -65,7 +84,7 @@ class SmartFoldingCommand(sublime_plugin.TextCommand):
|
||||
if self.is_region_totally_folded(content_region):
|
||||
self.unfold_yet_fold_subheads(content_region, level)
|
||||
else:
|
||||
self.view.fold(content_region)
|
||||
self.view.fold(sublime.Region(content_region.a - 1, content_region.b))
|
||||
return True
|
||||
|
||||
def is_region_totally_folded(self, region):
|
||||
@@ -90,7 +109,7 @@ class SmartFoldingCommand(sublime_plugin.TextCommand):
|
||||
child_content_region = headline.region_of_content_of_headline_at_point(self.view,
|
||||
child_headline_region.a)
|
||||
if child_content_region is not None:
|
||||
self.view.fold(child_content_region)
|
||||
self.view.fold(sublime.Region(child_content_region.a - 1, child_content_region.b))
|
||||
search_start_point = child_content_region.b
|
||||
else:
|
||||
search_start_point = child_headline_region.b
|
||||
@@ -162,7 +181,7 @@ class GlobalFoldingCommand(SmartFoldingCommand):
|
||||
point)
|
||||
if not is_region_void(region):
|
||||
point = region.b
|
||||
self.view.fold(region)
|
||||
self.view.fold(sublime.Region(region.a - 1, region.b))
|
||||
region, level = headline.find_headline(self.view, point, \
|
||||
headline.ANY_LEVEL,
|
||||
True, \
|
||||
|
Reference in New Issue
Block a user