Skip to content

Commit 2460336

Browse files
committed
update readme, and improve i/b a bit
1 parent 453cb42 commit 2460336

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

Default.sublime-keymap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
"key": "selection_empty",
2121
"operator": "equal",
2222
"operand": false
23+
},
24+
{
25+
"key": "selector",
26+
"operator": "not_equal",
27+
"operand": "markup.bold.markdown"
2328
}
2429
]
2530
},
@@ -31,6 +36,15 @@
3136
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\*" }
3237
]
3338
},
39+
// move the cursor forward too.
40+
{ "keys": ["*"], "command": "move", "args": { "by": "characters", "forward": true }, "context":
41+
[
42+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" },
43+
{ "key": "selector", "operator": "equal", "operand": "markup.bold.markdown" },
44+
{ "key": "selection_empty", "match_all": true, "operator": "equal", "operand": false }
45+
46+
]
47+
},
3448
{ "keys": ["*"], "command": "insert_snippet", "args": { "contents": "*" }, "context":
3549
[
3650
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\*" },

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ It auto insert prefixes in lists (`-`, `*`, `n.`). (reorganize automatically the
66

77
It also helps with italics and bold (only working with `*` for now).
88

9+
## A quick example
10+
11+
![a quick example of fast markdown.](fast-markdown.gif)
12+
13+
Sorry for the quality... :confused:
14+
15+
## Usage
16+
17+
The only thing you need to know is that when you want to insert an unordered nested list, just add at the end the line `- `. The `-` can be `+` or `*`. And if you want to insert an ordered list, add a `# `.
18+
19+
Otherwise, everything is just natural. :smirk:
20+
921
## Install
1022

1123
For now, **Fast Markdown** is not available on Package Control, so you're going to install it manually.
@@ -30,3 +42,5 @@ git clone "https://github.com/math2001/fast-markdown"
3042
3143
Done!
3244
```
45+
46+

fast-markdown.gif

101 KB
Loading

fast_markdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def list(self) -> None:
110110
list_prefix = str(int(list_prefix) + 1) + '.'
111111
replace(self.view, line.region, '{}{} '.format('\t' * (line.indentation - 1), list_prefix))
112112

113-
elif line.text[-1] in self.unordered_sign + self.ordered_sign:
113+
elif line.text[-1] in self.unordered_sign + self.ordered_sign and line.text[-2] == ' ':
114114
# insert a sub-list
115115
if line.text[-1] in self.ordered_sign:
116116
sign = '1.'

0 commit comments

Comments
 (0)