Skip to content

Commit

Permalink
Merge branch 'master' of github.com:borela/naomi
Browse files Browse the repository at this point in the history
  • Loading branch information
borela committed Oct 18, 2018
2 parents dc7f5d3 + 19e9cb6 commit e7c7ac2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
13 changes: 12 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
"profile": "https://github.com/StreetStrider",
"contributions": [
"bug",
"ideas"
"ideas",
"code"
]
},
{
Expand Down Expand Up @@ -210,6 +211,16 @@
"contributions": [
"bug"
]
},
{
"login": "YuriGor",
"name": "YuriGor",
"avatar_url": "https://avatars0.githubusercontent.com/u/6861317?v=4",
"profile": "http://yurigor.com/",
"contributions": [
"bug",
"ideas"
]
}
]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Sublime version](https://img.shields.io/badge/sublime-%E2%89%A53126-orange.svg?style=flat-square)][sublime]
[![Platforms](https://img.shields.io/badge/platforms-Windows%20%7C%20Linux%20%7C%20OSX-ff4081.svg?style=flat-square)][naomi]
[![License](https://img.shields.io/badge/license-Apache%202.0%20%7C%20BSD%20%7C%20MIT-ba68c8.svg?style=flat-square)][naomi]
[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors)
[![Downloads](https://img.shields.io/packagecontrol/dt/Naomi.svg?style=flat-square)][package-control]

Enhanced syntax definitions for Sublime Text 3.
Expand Down Expand Up @@ -105,7 +105,8 @@ Thanks goes to these wonderful people ([emoji legend][emoji-legend]):
| [<img src="https://avatars3.githubusercontent.com/u/11317458?v=4" width="100px;"/><br /><sub><b>Alexandre Borela</b></sub>](https://github.com/borela)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aborela "Bug reports") [💻](https://github.com/borela/naomi/commits?author=borela "Code") [🎨](#design-borela "Design") [📖](https://github.com/borela/naomi/commits?author=borela "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1581943?v=4" width="100px;"/><br /><sub><b>C.J. Winslow</b></sub>](http://cjwinslow.com)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AWhoaa512 "Bug reports") [💻](https://github.com/borela/naomi/commits?author=Whoaa512 "Code") [🤔](#ideas-Whoaa512 "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/744114?v=4" width="100px;"/><br /><sub><b>faiwer</b></sub>](https://faiwer.ru)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Afaiwer "Bug reports") [🤔](#ideas-faiwer "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/208149?v=4" width="100px;"/><br /><sub><b>Francisco Lourenço</b></sub>](https://www.betafabric.com/francisco/)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Afranciscolourenco "Bug reports") [💻](https://github.com/borela/naomi/commits?author=franciscolourenco "Code") | [<img src="https://avatars0.githubusercontent.com/u/9534622?v=4" width="100px;"/><br /><sub><b>Tomas Barry</b></sub>](https://butternutbox.com/)<br />[💻](https://github.com/borela/naomi/commits?author=TomasBarry "Code") | [<img src="https://avatars2.githubusercontent.com/u/1147704?v=4" width="100px;"/><br /><sub><b>crapthings</b></sub>](https://github.com/crapthings)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Acrapthings "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/1213198?v=4" width="100px;"/><br /><sub><b>Max Mykhailenko</b></sub>](http://memcrab.com)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Amax-mykhailenko "Bug reports") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/4757944?v=4" width="100px;"/><br /><sub><b>Marko Žarković</b></sub>](https://github.com/2Pacalypse-)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3A2Pacalypse- "Bug reports") [🤔](#ideas-2Pacalypse- "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/3423750?v=4" width="100px;"/><br /><sub><b>James Wilson</b></sub>](http://neaumusic.github.io)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aneaumusic "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/253298?v=4" width="100px;"/><br /><sub><b>ericbiewener</b></sub>](https://github.com/ericbiewener)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aericbiewener "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/13142923?v=4" width="100px;"/><br /><sub><b>Matt Le</b></sub>](https://lematt1991.github.io/)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Alematt1991 "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/1161431?v=4" width="100px;"/><br /><sub><b>Clark Pan</b></sub>](https://github.com/clark-pan)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aclark-pan "Bug reports") [🤔](#ideas-clark-pan "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/7884558?v=4" width="100px;"/><br /><sub><b>Nick K.</b></sub>](https://octetstream.me)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aoctet-stream "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/4448627?v=4" width="100px;"/><br /><sub><b>Alex Cavazos</b></sub>](https://eventa.mx)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AAlexKvazos "Bug reports") |
| [<img src="https://avatars3.githubusercontent.com/u/6924108?v=4" width="100px;"/><br /><sub><b>Enrique Ballesté</b></sub>](https://divisionof.com)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aeballeste "Bug reports") [🤔](#ideas-eballeste "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/120596?v=4" width="100px;"/><br /><sub><b>David Calhoun</b></sub>](http://themaingate.net)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Adavidcalhoun "Bug reports") [🤔](#ideas-davidcalhoun "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/2124761?v=4" width="100px;"/><br /><sub><b>Strider</b></sub>](https://github.com/StreetStrider)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AStreetStrider "Bug reports") [🤔](#ideas-StreetStrider "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/4704508?v=4" width="100px;"/><br /><sub><b>Mauricio Andrades</b></sub>](http://mauricioandrades.com/)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AMauricioAndrades "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/44148?v=4" width="100px;"/><br /><sub><b>Gerard Roche</b></sub>](http://blog.gerardroche.com)<br />[💻](https://github.com/borela/naomi/commits?author=gerardroche "Code") | [<img src="https://avatars1.githubusercontent.com/u/9801624?v=4" width="100px;"/><br /><sub><b>Ihor Oleksandrov</b></sub>](https://github.com/ihodev)<br />[💻](https://github.com/borela/naomi/commits?author=ihodev "Code") [🎨](#design-ihodev "Design") | [<img src="https://avatars0.githubusercontent.com/u/2849183?v=4" width="100px;"/><br /><sub><b>Sean Miller</b></sub>](https://github.com/seanders)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aseanders "Bug reports") |
| [<img src="https://avatars3.githubusercontent.com/u/6924108?v=4" width="100px;"/><br /><sub><b>Enrique Ballesté</b></sub>](https://divisionof.com)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aeballeste "Bug reports") [🤔](#ideas-eballeste "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/120596?v=4" width="100px;"/><br /><sub><b>David Calhoun</b></sub>](http://themaingate.net)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Adavidcalhoun "Bug reports") [🤔](#ideas-davidcalhoun "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/2124761?v=4" width="100px;"/><br /><sub><b>Strider</b></sub>](https://github.com/StreetStrider)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AStreetStrider "Bug reports") [🤔](#ideas-StreetStrider "Ideas, Planning, & Feedback") [💻](https://github.com/borela/naomi/commits?author=StreetStrider "Code") | [<img src="https://avatars0.githubusercontent.com/u/4704508?v=4" width="100px;"/><br /><sub><b>Mauricio Andrades</b></sub>](http://mauricioandrades.com/)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AMauricioAndrades "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/44148?v=4" width="100px;"/><br /><sub><b>Gerard Roche</b></sub>](http://blog.gerardroche.com)<br />[💻](https://github.com/borela/naomi/commits?author=gerardroche "Code") | [<img src="https://avatars1.githubusercontent.com/u/9801624?v=4" width="100px;"/><br /><sub><b>Ihor Oleksandrov</b></sub>](https://github.com/ihodev)<br />[💻](https://github.com/borela/naomi/commits?author=ihodev "Code") [🎨](#design-ihodev "Design") | [<img src="https://avatars0.githubusercontent.com/u/2849183?v=4" width="100px;"/><br /><sub><b>Sean Miller</b></sub>](https://github.com/seanders)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3Aseanders "Bug reports") |
| [<img src="https://avatars0.githubusercontent.com/u/6861317?v=4" width="100px;"/><br /><sub><b>YuriGor</b></sub>](http://yurigor.com/)<br />[🐛](https://github.com/borela/naomi/issues?q=author%3AYuriGor "Bug reports") [🤔](#ideas-YuriGor "Ideas, Planning, & Feedback") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors][all-contributors] specification.
Expand Down
17 changes: 12 additions & 5 deletions plugin/commands/ToggleJsxComment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,20 @@


def can_comment(view, region):
# If the beginning of the region is a string but not the beginning of the
# string, it’ll not be possible to comment this region.
scopes = view.scope_name(region.begin())
region = region.begin()
scopes = view.scope_name(region)

while 'string' in scopes:
region = region - 1

if region < 0:
return False

if view.substr(region) == '\n':
return False

if 'string' in scopes:
if 'punctuation.definition.string.begin' not in scopes:
return False
return True
return True


Expand Down
2 changes: 1 addition & 1 deletion syntaxes/fjsx15/comment/line.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contexts:
- meta_scope: comment.line.js.fjsx15
- include: email-no-pop
- include: link-no-pop
- match: (?=$)
- match: \n|$
pop: true

email-no-pop:
Expand Down
7 changes: 6 additions & 1 deletion syntaxes/fjsx15/literal/object/property.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ contexts:
{{keyIdentifier}}
\s*:\s*
(?:async\b\s+)?
function\s
function\b
)
set: [
function-declaration,
meta-declaration-function,
function-keyword,
meta-key,
method-identifier
Expand Down Expand Up @@ -256,6 +257,10 @@ contexts:
- meta_scope: meta.object-literal.key.computed.js.fjsx15
- include: pop-now

meta-declaration-function:
- meta_scope: meta.declaration.function.js.fjsx15
- include: pop-now

meta-key:
- meta_scope: meta.object-literal.key.js.fjsx15
- include: pop-now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ scope: ...

contexts:
main:
- match: \.
scope: constant.other.character-class.regexp.js.fjsx15
pop: true
- match: ((\[)(\^)?)
captures:
1: constant.other.character-class.regexp.js.fjsx15
Expand Down

0 comments on commit e7c7ac2

Please sign in to comment.