Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ac9fd9aaa | |||
| 5bbfb4606d | |||
| 37703e9bab |
@ -73,14 +73,16 @@ def show_html(md_view, preview):
|
|||||||
lambda href: sublime.run_command('open_url',
|
lambda href: sublime.run_command('open_url',
|
||||||
{'url': href}))
|
{'url': href}))
|
||||||
|
|
||||||
return
|
# get the "ratio" of the markdown view's position.
|
||||||
# set viewport position
|
|
||||||
# 0 < y < 1
|
# 0 < y < 1
|
||||||
y = md_view.text_to_layout(md_view.sel()[0].begin())[1] / md_view.layout_extent()[1]
|
y = md_view.text_to_layout(md_view.sel()[0].begin())[1] / md_view.layout_extent()[1]
|
||||||
|
# set the vector (position) for the preview
|
||||||
vector = [0, y * preview.layout_extent()[1]]
|
vector = [0, y * preview.layout_extent()[1]]
|
||||||
# remove half of the viewport_extent.y to center it on the screen (verticaly)
|
# remove half of the viewport_extent.y to center it on the screen (verticaly)
|
||||||
vector[1] -= preview.viewport_extent()[1] / 2
|
vector[1] -= preview.viewport_extent()[1] / 2
|
||||||
vector[1] = mini(vector[1], 0)
|
# make sure the minimum is 0
|
||||||
|
vector[1] = 0 if vector < 0 else vector[1]
|
||||||
|
# the hide the first line
|
||||||
vector[1] += preview.line_height()
|
vector[1] += preview.line_height()
|
||||||
preview.set_viewport_position(vector, animate=False)
|
preview.set_viewport_position(vector, animate=False)
|
||||||
|
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
"install": "messages/install.txt",
|
"install": "messages/install.txt",
|
||||||
"1.1.2": "messages/1.1.2.txt",
|
"1.1.2": "messages/1.1.2.txt",
|
||||||
"2.0.1": "messages/2.0.1.txt",
|
"2.0.1": "messages/2.0.1.txt",
|
||||||
"2.1.1": "messages/2.0.1.txt"
|
"2.2.0": "messages/2.2.0.txt"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,3 +3,6 @@ Sorry to interrupt you... :(
|
|||||||
A settings is now available: `markdown_live_preview_on_open`. If set to true,
|
A settings is now available: `markdown_live_preview_on_open`. If set to true,
|
||||||
it opens the window preview as soon as you open a markdown file. See the
|
it opens the window preview as soon as you open a markdown file. See the
|
||||||
README for more infos.
|
README for more infos.
|
||||||
|
|
||||||
|
Tip of the day: `ctrl+w`: closes the current file
|
||||||
|
`ctrl+shift+w`: closes the current window
|
||||||
|
|||||||
8
messages/2.2.0.txt
Normal file
8
messages/2.2.0.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Sorry to interrupt you... :(
|
||||||
|
|
||||||
|
Something changed on MarkdownLivePreview: the preview is now scrolled to where
|
||||||
|
you are editing your markdown file! It doesn't scroll back up all the time any
|
||||||
|
more!
|
||||||
|
|
||||||
|
Tip of the day: You can center the screen on your cursor by pressing:
|
||||||
|
`ctrl+k, ctrl+v` (on OSX `cmd+k, cmd+v`)
|
||||||
41
sample.md
41
sample.md
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
Hope you'll enjoy using MarkdownLivePreview!
|
Hope you'll enjoy using MarkdownLivePreview!
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
print('Hello world')
|
print('Hello world')
|
||||||
@ -13,3 +12,43 @@ if DEBUG:
|
|||||||
> Only a fool knows everything. A wise man knows how little he knows
|
> Only a fool knows everything. A wise man knows how little he knows
|
||||||
|
|
||||||
The only think I know right now is that Boxy Theme's just awesome.
|
The only think I know right now is that Boxy Theme's just awesome.
|
||||||
|
|
||||||
|
t
|
||||||
|
|
||||||
|
h
|
||||||
|
|
||||||
|
i
|
||||||
|
|
||||||
|
s
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
i
|
||||||
|
|
||||||
|
s
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
a
|
||||||
|
|
||||||
|
-
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
t
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
e
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
s
|
||||||
|
|
||||||
|
t
|
||||||
|
|
||||||
|
sdfsdfsdf
|
||||||
|
|||||||
Reference in New Issue
Block a user