Skip to content
Merged

Next #791

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,12 @@
{ "key": "overlay_visible", "operator": "equal", "operand": false }
]
},
// Reset GFM tasks
{ "keys": ["alt+shift+x"], "command": "mde_reset_task_list_items", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
// Toggle GFM tasks
{ "keys": ["alt+x"], "command": "mde_toggle_task_list_item", "context":
[
Expand Down Expand Up @@ -1462,6 +1468,18 @@
]
},

// navigate between critics
{ "keys": ["alt+c", "alt+down"], "command": "mde_goto_next_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
{ "keys": ["alt+c", "alt+up"], "command": "mde_goto_prev_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},

//
// Wiki
//
Expand Down
18 changes: 18 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,12 @@
{ "key": "overlay_visible", "operator": "equal", "operand": false }
]
},
// Reset GFM tasks
{ "keys": ["alt+shift+x"], "command": "mde_reset_task_list_items", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
// Toggle GFM tasks
{ "keys": ["alt+x"], "command": "mde_toggle_task_list_item", "context":
[
Expand Down Expand Up @@ -1462,6 +1468,18 @@
]
},

// navigate between critics
{ "keys": ["super+alt+c", "super+alt+down"], "command": "mde_goto_next_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
{ "keys": ["super+alt+c", "super+alt+up"], "command": "mde_goto_prev_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},

//
// Wiki
//
Expand Down
18 changes: 18 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,12 @@
{ "key": "overlay_visible", "operator": "equal", "operand": false }
]
},
// Reset GFM tasks
{ "keys": ["alt+shift+x"], "command": "mde_reset_task_list_items", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
// Toggle GFM tasks
{ "keys": ["alt+x"], "command": "mde_toggle_task_list_item", "context":
[
Expand Down Expand Up @@ -1462,6 +1468,18 @@
]
},

// navigate between critics
{ "keys": ["alt+c", "alt+down"], "command": "mde_goto_next_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},
{ "keys": ["alt+c", "alt+up"], "command": "mde_goto_prev_critic", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }
]
},

//
// Wiki
//
Expand Down
30 changes: 30 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,23 @@
"command": "mde_switch_list_bullet_type"
},

//
// Tasks
//

{
"caption": "MarkdownEditing: Insert Task",
"command": "mde_insert_task_list_item"
},
{
"caption": "MarkdownEditing: Toggle Task",
"command": "mde_toggle_task_list_item"
},
{
"caption": "MarkdownEditing: Reset Tasks",
"command": "mde_reset_task_list_items"
},

//
// References
//
Expand Down Expand Up @@ -262,6 +279,19 @@
"command": "mde_reference_organize"
},

//
// CriticMarkup
//

{
"caption": "MarkdownEditing: Goto Next Critic",
"command": "mde_goto_next_critic"
},
{
"caption": "MarkdownEditing: Goto Previous Critic",
"command": "mde_goto_prev_critic"
},

//
// Wiki
//
Expand Down
21 changes: 19 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Further available key bindings:
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>,</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>,</kbd> | Decrease block quote level (remove a `> `)
| <kbd>Ctrl</kbd> + <kbd>Enter</kbd> | <kbd>⌘</kbd> + <kbd>Enterkbd> | Terminate block quote by adding two newline's.<br/>If the current line is empty, block quote signs are removed.

# Lists and Tasks
# Lists

List bullets are automatically changed when indenting or unindenting list items by default. This behaviour can be disabled via `"mde.list_indent_auto_switch_bullet": false`.

Expand All @@ -261,12 +261,24 @@ Following commands are provided via Command Palette:
* **Switch List Bullet Type**
Switches the highlighted list between numbered and bulleted style.

# Tasks

Following commands are provided via Command Palette to manage tasks:

* **Insert Task**
Creates new GFM task (`* [ ] task`)
* **Toggle Task**
Toggles GFM task check marks (`* [x] task`)
* **Reset Tasks**
Clear all task check boxes. If non-empty selection exists, only selected tasks are reset.

Following key bindings may be used to create or toggle tasks.

| Linux/Windows | MacOS | Description
|---------------|-------|-------------
| <kbd>Alt</kbd> + <kbd>t</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>t</kbd> | Creates new GFM task (`* [ ] task`)
| <kbd>Alt</kbd> + <kbd>x</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>x</kbd> | Toggles GFM task check marks (`* [x] task`)
| <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>x</kbd> | <kbd>⌥</kbd> + <kbd>⇧</kbd> + <kbd>x</kbd> | Clear GFM all (selected) task check marks (`* [0] task`)
| <kbd>Alt</kbd> + <kbd>x</kbd> | <kbd>⌥</kbd> + <kbd>x</kbd> | Toggles GFM task check marks (`* [x] task`)

# References

Expand Down Expand Up @@ -321,6 +333,11 @@ Important functions are bound to following keys by default:

MarkdownEditing supports document review by highlighting critic markup and enable adding critic or accepting and rejecting proposed changes via key bindings.

| Linux/Windows | MacOS | Description
|---------------|-------|-------------
| <kbd>Alt</kbd> + <kbd>c</kbd>, <kbd>Alt</kbd> + <kbd>down</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>c</kbd>, <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>down</kbd> | Jump to next critic marker.
| <kbd>Alt</kbd> + <kbd>c</kbd>, <kbd>Alt</kbd> + <kbd>up</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>c</kbd>, <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>up</kbd> | Jump to previous critic marker.

## Reviewer

A document reviewer can insert critic or propose changes for single words or selections with following key bindings:
Expand Down
26 changes: 3 additions & 23 deletions make.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,12 @@ goto :usage
:RELEASE
if "%2"== "" goto :usage

git checkout st3176 && git merge st3-develop --no-ff
if not errorlevel 0 (
echo Unable to merge st3-develop into st3176!
exit /b 1
)
git checkout master && git merge st4-develop --no-ff
if not errorlevel 0 (
echo Unable to merge st4-develop into master!
exit /b 1
)
echo Hit any key to push branches!
pause
call git push origin st3176
if not errorlevel 0 (
echo Failed to push st3176!
exit /b 1
)

call git push origin master
if not errorlevel 0 (
echo Failed to push master!
Expand All @@ -80,22 +69,13 @@ goto :usage

echo Createing assets for "%package%"...

:: create downloadable asset for ST4126+
set build=3176
set archive=%package%-%2-st%build%.sublime-package
set assets="%archive%#%archive%"
call git tag -f %build%-%2 st%build%
call git archive --format zip -o "%archive%" %build%-%2

:: create downloadable asset for ST4134+
set build=4107
set archive=%package%-%2-st%build%.sublime-package
set assets=%assets% "%archive%#%archive%"
call git tag -f %build%-%2 master
call git archive --format zip -o "%archive%" %build%-%2
set assets="%archive%#%archive%"
call git archive --format zip -o "%archive%" master

:: create the release
call git push --tags --force
gh release create --target master -t "%package% %2" "%build%-%2" %assets%
del /f /q *.sublime-package
git fetch
Expand Down
4 changes: 3 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@
"3.1.11": "messages/3.1.11.md",
"3.1.12": "messages/3.1.12.md",
"3.1.13": "messages/3.1.13.md",
"3.1.14": "messages/3.1.14.md"
"3.1.14": "messages/3.1.14.md",
"3.2.0": "messages/3.2.0.md",
"3.3.0": "messages/3.3.0.md"
}
17 changes: 17 additions & 0 deletions messages/3.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# MarkdownEditing 3.2.0 Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

## New Features

* add support for auto-folding headings when loading document
* add support for pandoc fenced divs

## Changes

* merge shellscript related fenced code block contexts

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
22 changes: 22 additions & 0 deletions messages/3.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MarkdownEditing 3.3.0 Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

* fix `==highlight==` not being scoped at beginning of paragraphs (#789)

## New Features

* add `Reset Task Items` (#786)
* add `Goto Next Critic` and `Goto Previous Critic` (#787)

## Changes

* drop support for ST3 (latest available version for ST3 is 3.2.0)
* align frontmatter punctuation scopes with ST's default Markdown syntax
* align code fence scopes with ST's default Markdown syntax
* optimize paragraph termination patterns to improve parsing performance

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
5 changes: 5 additions & 0 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
from .plugins.color_schemes import (
MdeSelectColorSchemeCommand,
)
from .plugins.critic import (
MdeGotoNextCriticCommand,
MdeGotoPrevCriticCommand
)
from .plugins.folding import (
MdeAutoFoldListener,
MdeFoldAllSectionsCommand,
Expand Down Expand Up @@ -63,6 +67,7 @@
MdeNumberListCommand,
MdeSwitchListBulletTypeCommand,
MdeInsertTaskListItemCommand,
MdeResetTaskListItemsCommand,
MdeToggleTaskListItemCommand,
MdeJoinLines,
)
Expand Down
36 changes: 36 additions & 0 deletions plugins/critic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from bisect import bisect_left, bisect_right
from .view import MdeTextCommand


class MdeGotoNextCriticCommand(MdeTextCommand):
def run(self, edit):
sel = self.view.sel()
if not sel:
return

critics = self.view.find_by_selector("markup.critic")
if not critics:
return

idx = bisect_right(critics, sel[0])
sel = critics[idx] if idx < len(critics) else critics[0]
self.view.sel().clear()
self.view.sel().add(sel)
self.view.show_at_center(sel)


class MdeGotoPrevCriticCommand(MdeTextCommand):
def run(self, edit):
sel = self.view.sel()
if not sel:
return

critics = self.view.find_by_selector("markup.critic")
if not critics:
return

idx = bisect_left(critics, sel[0]) - 1
sel = critics[idx] if idx >= 0 else critics[-1]
self.view.sel().clear()
self.view.sel().add(sel)
self.view.show_at_center(sel)
43 changes: 43 additions & 0 deletions plugins/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,49 @@ def run(self, edit):
self.view.insert(edit, sel.begin(), to_insert)


class MdeResetTaskListItemsCommand(MdeTextCommand):
"""
The `mde_reset_task_list_items` command resets check mark of all task list items.

It must be called in the line of the check mark.

**Examples:**

```markdown
# Ordered Task List

1. [ ] task 1
2. [x] task 2

# Unordered Task List

* [ ] task 1
- [x] task 2
+ [ ] task 3

# Quoted Task List

> * [ ] task 1
> * [x] task 2
```
"""

def run(self, edit):
sels = self.view.sel()
if not sels:
return

# list of non-empty selections
sels = [sel for sel in sels if not sel.empty()]

# replace all check marks by space
for mark in self.view.find_by_selector(
"text.html.markdown markup.list markup.checkbox.mark"
):
if not sels or any(mark in sel for sel in sels):
self.view.replace(edit, mark, " ")


class MdeToggleTaskListItemCommand(MdeTextCommand):
"""
The `mde_toggle_task_list_item` command toggles the check mark of task list items.
Expand Down
Loading