Permalink
Browse files

GoSublime needs you!

  • Loading branch information...
DisposaBoy committed Jul 12, 2018
1 parent 08861fd commit bbc88ccac101418698d5b3c831cc3ce7633f655b
Showing with 47 additions and 1 deletion.
  1. +8 −0 CHANGELOG.md
  2. +5 −0 README.md
  3. +1 −1 gosubl/about.py
  4. +33 −0 gsev.py
  5. BIN images/fight-the-future.png
@@ -1,3 +1,11 @@
Help shape the future of margo and GoSublime.
See https://margo.sh/gosublime-future for more details.
**Donate:**
If you find GoSublime useful and would like to support me and future development of GoSublime,
@@ -1,3 +1,6 @@
<a href="https://margo.sh/gosublime-future" target="_blank"><img src="https://margo.sh/gosublime/fight-the-future.png"></a>
<br><br>
[![Backers on Open Collective](https://opencollective.com/gosublime/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/gosublime/sponsors/badge.svg)](#sponsors) [![Build Status](https://travis-ci.org/DisposaBoy/GoSublime.svg?branch=master)](https://travis-ci.org/DisposaBoy/GoSublime)
@@ -6,6 +9,8 @@
GoSublime
=========
Intro
-----
@@ -1,7 +1,7 @@
import re
import sublime
ANN = 'a18.05.19-1'
ANN = 'a18.07.12-1'
VERSION = 'r18.05.19-1'
VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE)
DEFAULT_GO_VERSION = 'go?'
33 gsev.py
@@ -2,9 +2,41 @@
from . import gstest
import sublime
import sublime_plugin
import webbrowser
DOMAIN = 'GsEV'
class UncleSam(object):
def __init__(self):
self.phantoms = None
def on_load(self, view):
print('load', view.file_name())
if view.file_name() != gs.dist_path('CHANGELOG.md'):
return
self.phantoms = sublime.PhantomSet(view, 'gs.uncle-sam')
self.phantoms.update([sublime.Phantom(
sublime.Region(-1, -1),
'''
<body style="padding: 3rem 0">
<a href="{url}">
<img style="width: 338px; height: 197px" src="file://{src}"/>
</a>
</body>
'''.format(
url='https://margo.sh/gosublime-future',
src=gs.dist_path('images/fight-the-future.png')
),
sublime.LAYOUT_INLINE,
self._on_click
)])
def _on_click(self, url):
webbrowser.open_new_tab(url)
uncle_sam = UncleSam()
class EV(sublime_plugin.EventListener):
def on_pre_save(self, view):
view.run_command('gs_fmt')
@@ -24,6 +56,7 @@ def on_activated(self, view):
def on_load(self, view):
sublime.set_timeout(lambda: do_set_gohtml_syntax(view), 0)
sublime.set_timeout_async(lambda: uncle_sam.on_load(view), 0)
class GsOnLeftClick(sublime_plugin.TextCommand):
def run(self, edit):
Binary file not shown.

0 comments on commit bbc88cc

Please sign in to comment.