diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e43b0f9..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store diff --git a/.no-sublime-package b/.no-sublime-package deleted file mode 100644 index e69de29..0000000 diff --git a/LICENSE b/LICENSE index 62e5ac5..6fff159 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,8 @@ The MIT License (MIT) + +Copyright (c) 2020 Clarence "Sparr" Risher Copyright (c) 2016 Carlos Aguilar +Copyright (c) 2016 Andrew Kvapil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/PICO-8.sublime-color-scheme b/PICO-8.sublime-color-scheme new file mode 100644 index 0000000..32ea499 --- /dev/null +++ b/PICO-8.sublime-color-scheme @@ -0,0 +1,239 @@ +{ + "name": "PICO-8", + "author": "Sparr and Overkill", + "variables": + { + // PICO-8 palette and UI colors + "pico8_background": "hsl(224, 48%, 22%)", + "pico8_palette_0_0_black": "hsl(0, 0%, 0%)", + "pico8_palette_1_1_darkblue": "hsl(216, 68%, 19%)", + "pico8_palette_2_2_darkred": "hsl(329, 55%, 32%)", + "pico8_palette_3_3_darkgreen": "hsl(156, 100%, 26%)", + "pico8_palette_4_4_brown": "hsl(14, 52%, 44%)", + "pico8_palette_5_5_darkgray": "hsl(30, 9%, 34%)", + "pico8_palette_6_6_lightgray": "hsl(228, 4%, 77%)", + "pico8_palette_7_7_white": "hsl(23, 100%, 95%)", + "pico8_palette_8_8_red": "hsl(342, 100%, 50%)", + "pico8_palette_9_9_orange": "hsl(38, 100%, 50%)", + "pico8_palette_A_10_yellow": "hsl(55, 100%, 58%)", + "pico8_palette_B_11_green": "hsl(134, 100%, 45%)", + "pico8_palette_C_12_blue": "hsl(203, 100%, 58%)", + "pico8_palette_D_13_purple": "hsl(261, 16%, 54%)", + "pico8_palette_E_14_pink": "hsl(338, 100%, 73%)", + "pico8_palette_F_15_peach": "hsl(24, 100%, 83%)", + // Palette colors shifted +/- 20% Value, half saturation + // Intended to be usd as foreground colors on palette backgrounds + "pico8_palette_0_0_valueshift": "hsl(0, 0%, 20%)", + "pico8_palette_1_1_valueshift": "hsl(216, 34%, 39%)", + "pico8_palette_2_2_valueshift": "hsl(329, 27%, 52%)", + "pico8_palette_3_3_valueshift": "hsl(156, 50%, 46%)", + "pico8_palette_4_4_valueshift": "hsl(14, 26%, 64%)", + "pico8_palette_5_5_valueshift": "hsl(30, 4%, 54%)", + "pico8_palette_6_6_valueshift": "hsl(228, 2%, 57%)", + "pico8_palette_7_7_valueshift": "hsl(23, 50%, 75%)", + "pico8_palette_8_8_valueshift": "hsl(342, 50%, 70%)", + "pico8_palette_9_9_valueshift": "hsl(38, 50%, 70%)", + "pico8_palette_A_10_valueshift": "hsl(55, 50%, 38%)", + "pico8_palette_B_11_valueshift": "hsl(134, 50%, 65%)", + "pico8_palette_C_12_valueshift": "hsl(203, 50%, 38%)", + "pico8_palette_D_13_valueshift": "hsl(261, 8%, 74%)", + "pico8_palette_E_14_valueshift": "hsl(338, 50%, 53%)", + "pico8_palette_F_15_valueshift": "hsl(24, 50%, 63%)", + // Other colors + "gray75": "hsl(0, 0%, 75%)", + "gray25": "hsl(0, 0%, 25%)", + }, + "globals": + { + "foreground": "var(pico8_palette_6_6_lightgray)", + "background": "var(pico8_background)", + "caret": "var(pico8_palette_8_8_red)", + "invisibles": "var(gray75)", + "line_highlight": "var(gray25)", + "selection": "var(pico8_palette_A_10_yellow)" + }, + "rules": + [ + { + "name": "Source", + "scope": "source", + "background": "var(pico8_background)" + }, + { + "name": "Comment", + "scope": "comment", + "foreground": "var(pico8_palette_D_13_purple)" + }, + { + "name": "Keyword", + "scope": "keyword, storage", + "foreground": "var(pico8_palette_E_14_pink)" + }, + { + "name": "Keyword operator", + "scope": "keyword.operator.logical", + "foreground": "var(pico8_palette_E_14_pink)" + }, + { + "name": "Keyword operator", + "scope": "keyword.operator", + "foreground": "var(pico8_palette_7_7_white)" + }, + { + "name": "Function (definition)", + "scope": "entity.name.function", + "foreground": "var(pico8_palette_6_6_lightgray)", + "font_style": "bold" + }, + { + "name": "Class (definition)", + "scope": "entity.name", + "foreground": "var(pico8_palette_6_6_lightgray)" + }, + { + "name": "Number", + "scope": "constant.numeric", + "foreground": "var(pico8_palette_C_12_blue)" + }, + { + "name": "Variable", + "scope": "variable.language, variable.other", + "foreground": "var(pico8_palette_6_6_lightgray)", + "font_style": "bold" + }, + { + "name": "Built-in constant", + "scope": "constant.language", + "foreground": "var(pico8_palette_C_12_blue)" + }, + { + "name": "String", + "scope": "string", + "foreground": "var(pico8_palette_C_12_blue)" + }, + { + "name": "Arrays brackets, Member dots, Method colons", + "scope": "punctuation.accessor", + "foreground": "var(pico8_palette_7_7_white)", + "font_style": "bold" + }, + { + "name": "Parentheses", + "scope": "punctuation.section.parens", + "foreground": "var(pico8_palette_7_7_white)", + "font_style": "bold" + }, + { + "name": "Braces", + "scope": "punctuation.section.braces", + "foreground": "var(pico8_palette_7_7_white)" + }, + { + "name": "Support function", + "scope": "support.function", + "foreground": "var(pico8_palette_B_11_green)" + }, + { + "name": "pico8 header \"doctype\"", + "scope": "source.p8 entity.name.tag.doctype", + "foreground": "var(pico8_palette_7_7_white)", + "font_style": "bold" + }, + { + "name": "GFX digit 0", + "scope": "pico8.gfx.digit.0", + "foreground": "var(pico8_palette_0_0_valueshift)", + "background": "var(pico8_palette_0_0_black)" + }, + { + "name": "GFX digit 1", + "scope": "pico8.gfx.digit.1", + "foreground": "var(pico8_palette_1_1_valueshift)", + "background": "var(pico8_palette_1_1_darkblue)" + }, + { + "name": "GFX digit 2", + "scope": "pico8.gfx.digit.2", + "foreground": "var(pico8_palette_2_2_valueshift)", + "background": "var(pico8_palette_2_2_darkred)" + }, + { + "name": "GFX digit 3", + "scope": "pico8.gfx.digit.3", + "foreground": "var(pico8_palette_3_3_valueshift)", + "background": "var(pico8_palette_3_3_darkgreen)" + }, + { + "name": "GFX digit 4", + "scope": "pico8.gfx.digit.4", + "foreground": "var(pico8_palette_4_4_valueshift)", + "background": "var(pico8_palette_4_4_brown)" + }, + { + "name": "GFX digit 5", + "scope": "pico8.gfx.digit.5", + "foreground": "var(pico8_palette_5_5_valueshift)", + "background": "var(pico8_palette_5_5_darkgray)" + }, + { + "name": "GFX digit 6", + "scope": "pico8.gfx.digit.6", + "foreground": "var(pico8_palette_6_6_valueshift)", + "background": "var(pico8_palette_6_6_lightgray)" + }, + { + "name": "GFX digit 7", + "scope": "pico8.gfx.digit.7", + "foreground": "var(pico8_palette_7_7_valueshift)", + "background": "var(pico8_palette_7_7_white)" + }, + { + "name": "GFX digit 8", + "scope": "pico8.gfx.digit.8", + "foreground": "var(pico8_palette_8_8_valueshift)", + "background": "var(pico8_palette_8_8_red)" + }, + { + "name": "GFX digit 9", + "scope": "pico8.gfx.digit.9", + "foreground": "var(pico8_palette_9_9_valueshift)", + "background": "var(pico8_palette_9_9_orange)" + }, + { + "name": "GFX digit a", + "scope": "pico8.gfx.digit.a", + "foreground": "var(pico8_palette_A_10_valueshift)", + "background": "var(pico8_palette_A_10_yellow)" + }, + { + "name": "GFX digit b", + "scope": "pico8.gfx.digit.b", + "foreground": "var(pico8_palette_B_11_valueshift)", + "background": "var(pico8_palette_B_11_green)" + }, + { + "name": "GFX digit c", + "scope": "pico8.gfx.digit.c", + "foreground": "var(pico8_palette_C_12_valueshift)", + "background": "var(pico8_palette_C_12_blue)" + }, + { + "name": "GFX digit d", + "scope": "pico8.gfx.digit.d", + "foreground": "var(pico8_palette_D_13_valueshift)", + "background": "var(pico8_palette_D_13_purple)" + }, + { + "name": "GFX digit e", + "scope": "pico8.gfx.digit.e", + "foreground": "var(pico8_palette_E_14_valueshift)", + "background": "var(pico8_palette_E_14_pink)" + }, + { + "name": "GFX digit f", + "scope": "pico8.gfx.digit.f", + "foreground": "var(pico8_palette_F_15_valueshift)", + "background": "var(pico8_palette_F_15_peach)" + } + ] +} \ No newline at end of file diff --git a/PICO-8.sublime-commands b/PICO-8.sublime-commands index fc39b69..1e77a47 100644 --- a/PICO-8.sublime-commands +++ b/PICO-8.sublime-commands @@ -11,11 +11,11 @@ }, { "caption": "PICO-8: Browse API Reference", "command": "open_url", - "args": { "url": "http://neko250.github.io/pico8-api" } + "args": { "url": "http://pico-8.github.io/pico8-api" } }, { "caption": "PICO-8: Download Font", "command": "open_url", - "args": { "url": "https://raw.githubusercontent.com/Neko250/sublime-PICO-8/master/font/PICO-8.ttf" } + "args": { "url": "https://raw.githubusercontent.com/sparr/sublime-PICO-8/master/font/PICO-8.ttf" } }, { "caption": "Preferences: PICO-8 - Default", "command": "open_file", diff --git a/PICO-8.sublime-syntax b/PICO-8.sublime-syntax new file mode 100644 index 0000000..35b610b --- /dev/null +++ b/PICO-8.sublime-syntax @@ -0,0 +1,204 @@ +%YAML 1.2 +--- +name: PICO-8 # by sparr +comment: "PICO-8 (lua syntax 0.9)" +file_extensions: + - p8 +first_line_match: 'pico-8 cartridge // http://www\.pico-8\.com' +scope: source.p8 + +variables: + hexdigit: '[a-fA-F\d]' + hexnumber: '0[xX](?:{{hexdigit}}+\.?{{hexdigit}}{0,4}|\.{{hexdigit}}+)' + decnumber: '(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)' + number: '(?8)$\n?' + scope: comment.line.double-dash.editor-tab.lua + captures: + 1: punctuation.definition.comment.lua + 2: meta.toc-list # maybe not useful since the text is always the same ">8" for pico8 editor tabs + - match: '(--)(?!\[\[).*$\n?' + scope: comment.line.double-dash.lua + captures: + 1: punctuation.definition.comment.lua + - match: '\b(local)\b' + scope: keyword.lua storage.modifier + - match: '(?=?' + scope: keyword.operator.comparison.lua + - match: '(?:\+|-|%|\*|\/)?=' # might need trailing (?!=) + scope: keyword.operator.assignment.lua + - match: '\+|-|%|\*|\/|\^' + scope: keyword.operator.arithmetic.lua + - match: '#|(? - - - - comment - PICO-8 (lua syntax 0.8) - fileTypes - - p8 - - foldingStartMarker - ^\s*\b(function|local\s+function|if|for)\b|{[ \t]*$|\[\[ - foldingStopMarker - \bend\b|^\s*}|\]\] - keyEquivalent - ^~L - name - PICO-8 - patterns - - - captures - - 1 - - name - keyword.control.lua - - 2 - - name - entity.name.function.scope.lua - - 3 - - name - entity.name.function.lua - - 4 - - name - punctuation.definition.parameters.begin.lua - - 5 - - name - variable.parameter.function.lua - - 6 - - name - punctuation.definition.parameters.end.lua - - - match - \b(function)\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*(\()([^)]*)(\)) - name - meta.function.lua - - - match - (?<![\d.])\b0x[a-fA-F\d]+|\b\d+(\.\d+)?([eE]-?\d+)?|\.\d+([eE]-?\d+)? - name - constant.numeric.lua - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.lua - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.lua - - - name - string.quoted.single.lua - patterns - - - match - \\. - name - constant.character.escape.lua - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.lua - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.lua - - - name - string.quoted.double.lua - patterns - - - match - \\. - name - constant.character.escape.lua - - - - - begin - (?<!--)\[(=*)\[ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.lua - - - end - \]\1\] - endCaptures - - 0 - - name - punctuation.definition.string.end.lua - - - name - string.quoted.other.multiline.lua - - - begin - --\[(=*)\[ - captures - - 0 - - name - punctuation.definition.comment.lua - - - end - \]\1\] - name - comment.block.lua - - - captures - - 1 - - name - punctuation.definition.comment.lua - - - match - (--)(?!\[\[).*$\n? - name - comment.line.double-dash.lua - - - match - \b(break|do|else|for|if|elseif|return|then|repeat|while|until|end|function|local|in|goto)\b - name - keyword.control.lua - - - match - (?<![^.]\.|:)\b(false|nil|true)\b - name - constant.language.lua - - - match - (?<![^.]\.|:)\b(self)\b - name - variable.language.self.lua - - - match - (?<![^.]\.|:)\b(_draw|_init|_update|_update60|abs|add|all|assert|atan2|band|bnot|bor|btn|btnp|bxor|camera|cartdata|cd|circ|circfill|clip|cls|cocreate|color|coresume|cos|costatus|count|cstore|cursor|del|dget|dir|dset|exit|export|extcmd|fget|flip|flr|folder|foreach|fset|help|holdframe|import|info|install_demos|install_games|keyconfig|line|load|ls|map|mapdraw|max|memcpy|memset|menuitem|mget|mid|min|mkdir|mset|music|pairs|pal|palt|peek|pget|poke|print|printh|pset|reboot|rect|rectfill|reload|resume|rnd|run|save|setmetatable|sfx|sget|sgn|shl|shr|shutdown|sin|splore|spr|sqrt|srand|sset|sspr|stat|sub|time|type|yield)\b - name - support.function.lua - - - match - \b(and|or|not)\b - name - keyword.operator.lua - - - match - \(|\)|\;|\+=?|-=?|%=?|#|\*=?|\/=?|\^=?|\[|\]|==?|~=|<=?|>=?|,|\.\.?\.?|(?<!\.)\.{2}(?!\.) - name - keyword.operator.punctuation.lua - - - scopeName - source.p8 - uuid - 93E017CC-6F27-11D9-90EB-000D93589AF7 - - diff --git a/PICO-8.tmTheme b/PICO-8.tmTheme deleted file mode 100644 index 207c0e7..0000000 --- a/PICO-8.tmTheme +++ /dev/null @@ -1,696 +0,0 @@ - - - - - name - PICO-8 - settings - - - settings - - background - #1D2B53 - caret - #FF004D - foreground - #C2C3C7 - invisibles - #BFBFBF - lineHighlight - #6F675F - selection - #FFEC27 - - - - name - Source - scope - source - settings - - background - #1D2B53 - - - - name - Comment - scope - comment - settings - - fontStyle - - foreground - #83769C - - - - name - Keyword - scope - keyword, storage - settings - - fontStyle - - foreground - #FF77A8 - - - - name - Keyword operator - scope - keyword.operator.assignment - settings - - fontStyle - - foreground - #FFF1E8 - - - - name - Keyword operator - scope - keyword.operator.punctuation - settings - - fontStyle - - foreground - #FFF1E8 - - - - name - keyword like new - scope - keyword.other.special-method - settings - - fontStyle - - foreground - #FF77A8 - - - - name - Function (definition) - scope - entity.name.function, keyword.other.name-of-parameter.objc - settings - - fontStyle - bold - foreground - #C2C3C7 - - - - name - Class (definition) - scope - entity.name - settings - - fontStyle - - foreground - #C2C3C7 - - - - name - Number - scope - constant.numeric - settings - - fontStyle - - foreground - #29ADFF - - - - name - Variable - scope - variable.language, variable.other - settings - - fontStyle - bold - foreground - #C2C3C7 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - - foreground - #FF77A8 - - - - name - Variable - scope - variable.other.constant.ruby - settings - - foreground - #0F8787 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - - foreground - #29ADFF - - - - name - String - scope - string - settings - - foreground - #29ADFF - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - - foreground - #0F87FF - - - - name - Inherited class seperator - scope - punctuation.separator.inheritance - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - punctuation block - scope - punctuation.separator.variable - settings - - fontStyle - bold - foreground - #FFf1E8 - - - - name - array brackets - scope - punctuation.section.array - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - hash separator - scope - punctuation.separator.key-value - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - () brackets - scope - punctuation.section.function, punctuation.definition.parameters - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - hash brackets - scope - punctuation.section.scope - settings - - fontStyle - - foreground - #FFF1E8 - - - - name - Special ruby method - scope - keyword.other.special-method.ruby - settings - - fontStyle - - - - - name - symbol - scope - constant.other.symbol - settings - - fontStyle - - foreground - #FF77A8 - - - - name - Support class - scope - support.class - settings - - fontStyle - - foreground - #00E756 - - - - name - Support type - scope - support.type - settings - - fontStyle - - foreground - #00E756 - - - - name - Support function - scope - support.function - settings - - fontStyle - - foreground - #00E756 - - - - name - String.regexp - scope - string.regexp - settings - - foreground - #29ADFF - - - - name - String embedded source - scope - string.quoted source - settings - - foreground - #29ADFF - - - - name - doctype punctation - scope - meta.tag.sgml.html - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - doctype declaration - scope - entity.name.tag.doctype - settings - - fontStyle - bold - foreground - #999999 - - - - name - doctype string - scope - string.quoted.double.doctype - settings - - fontStyle - bold - foreground - #29ADFF - - - - name - html tag punctuation - scope - punctuation.definition.tag - settings - - fontStyle - - foreground - #FF77A8 - - - - name - html tag punctuation - scope - entity.name.tag - settings - - fontStyle - bold - foreground - #FFF1E8 - - - - name - html attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #5577BB - - - - name - html attribute punctation - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #7799CC - - - - name - erb tags - scope - punctuation.section.embedded.ruby - settings - - fontStyle - bold - foreground - #999999 - - - - name - ruby string interpolation - scope - source.ruby.embedded.source punctuation.section.embedded.ruby - settings - - foreground - #CF1040 - - - - name - css brackets - scope - punctuation.section.property-list.css - settings - - fontStyle - - - - - name - css property - scope - support.type.property-name.css - settings - - fontStyle - bold - foreground - #994488 - - - - name - css property punctuation - scope - punctuation.separator.key-value.css - settings - - fontStyle - - foreground - #555555 - - - - name - css property value - scope - meta.property-value, constant.other.color - settings - - fontStyle - - foreground - #FF77A8 - - - - name - css ending - scope - punctuation.terminator.rule.css - settings - - fontStyle - - foreground - #555555 - - - - name - css font - scope - support.constant.font-name - settings - - fontStyle - - foreground - #FF77A8 - - - - name - css keyword - scope - keyword.other.unit - settings - - fontStyle - - foreground - #FF77A8 - - - - name - pseudo class - scope - entity.other.attribute-name.pseudo-class - settings - - fontStyle - - foreground - #8855CC - - - - name - css constant property value - scope - support.constant.property-value - settings - - fontStyle - bold - foreground - #8855CC - - - - name - css attribute class - scope - entity.other.attribute-name.class - settings - - fontStyle - bold - foreground - #3366CC - - - - name - css attribute id - scope - entity.other.attribute-name.id - settings - - fontStyle - bold - foreground - #990000 - - - - name - diff header from - scope - meta.diff.header.from-file - settings - - background - #FFDDDD - fontStyle - - foreground - #555555 - - - - name - diff header to - scope - meta.diff.header.to-file - settings - - background - #DDFFDD - fontStyle - - foreground - #555555 - - - - name - diff inserted - scope - markup.inserted.diff - settings - - background - #DDFFDD - fontStyle - - - - - name - diff deleted - scope - markup.deleted.diff - settings - - background - #FFDDDD - fontStyle - - foreground - #555555 - - - - uuid - 26786979-843B-4FE2-BCB6-4FCEC6F8FB58 - - diff --git a/README.md b/README.md index 6a85587..9619337 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ PICO-8 plugin for the [Sublime Text 3](https://www.sublimetext.com/) editor. -![sublime-PICO-8](https://raw.githubusercontent.com/Neko250/sublime-PICO-8/master/img/screenshot.png) +![sublime-PICO-8](https://raw.githubusercontent.com/sparr/sublime-PICO-8/master/img/screenshot.png) This package includes: -- `.p8` language definition (by [Overkill](http://www.lexaloffle.com/bbs/?uid=11331)). -- Syntax highlighting (by [Overkill](http://www.lexaloffle.com/bbs/?uid=11331)). +- `.p8` language definition (originally by [Overkill](http://www.lexaloffle.com/bbs/?uid=11331)). +- Syntax highlighting (originally by [Overkill](http://www.lexaloffle.com/bbs/?uid=11331)). - PICO-8 `.ttf` font (by [RhythmLynx](http://www.lexaloffle.com/bbs/?uid=11704)). - Cartridge runner to launch your cart right from Sublime Text. -- Code completion based on the official [PICO-8 API](http://neko250.github.io/pico8-api/). +- Code completion based on the official [PICO-8 API](http://pico-8.github.io/pico8-api/). - Code snippets. ---- @@ -31,7 +31,7 @@ This package includes: ```bash cd ~/.config/sublime-text-3/Packages rm -rf PICO-8 -git clone https://github.com/Neko250/sublime-PICO-8 PICO-8 +git clone https://github.com/sparr/sublime-PICO-8 PICO-8 ``` #### OSX @@ -39,7 +39,7 @@ git clone https://github.com/Neko250/sublime-PICO-8 PICO-8 ```bash cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages rm -rf PICO-8 -git clone https://github.com/Neko250/sublime-PICO-8 PICO-8 +git clone https://github.com/sparr/sublime-PICO-8 PICO-8 ``` #### Windows @@ -47,7 +47,7 @@ git clone https://github.com/Neko250/sublime-PICO-8 PICO-8 ```bash cd "%APPDATA%\Sublime Text 3\Packages" rd /s /q PICO-8 -git clone https://github.com/Neko250/sublime-PICO-8 PICO-8 +git clone https://github.com/sparr/sublime-PICO-8 PICO-8 ``` ### Manual Installation @@ -91,8 +91,20 @@ __IMPORTANT__: Remember using the escape character for the backslash (`\\`) inst ---- + ## Version History +- __v2020.02.10__: + - Initial fork and merge of Sublime PICO-8 and LuaExtended + - Remove inapplicable LuaExtended parts + - `added`: Add `goto` to list of completion keywords + - `added`: Add support for block comments + - `added`: Additional completion cancel triggers + - `changed`: Rearrange files from both sources + - `changed`: Reformat CDATA in snippets + - `fixed`: Restrict snippet/completion/etc scopes, exclude strings, comments, non-lua sections + - `removed`: Disable completion of `count()` and mapdraw`()`, both deprecated + - __v2017.3.14__: - `added`: automatically lowercase the file upon saving. - `added`: `extcmd` function (syntax and autocomplete). diff --git a/code/api.txt b/code/api.txt index 2dc5e4a..d48b06d 100644 --- a/code/api.txt +++ b/code/api.txt @@ -1,15 +1,25 @@ -# PICO-8 v0.1.10 API +# PICO-8 v0.1.12c API _draw +_get_menu_item_selected _init +_mark_cpu +_menuitem +_set_fps +_set_mainloop_exists +_set_paused +_startframe _update _update60 +_update_buttons +_update_framerate abs add all assert atan2 band +bbsreq bnot bor btn @@ -38,6 +48,7 @@ exit export extcmd fget +fillp flip flr folder @@ -53,6 +64,7 @@ keyconfig line load ls +lshr map mapdraw max @@ -69,19 +81,29 @@ pairs pal palt peek +peek2 +peek4 pget poke +poke2 +poke4 print printh pset +radio reboot rect rectfill reload resume rnd +rotl +rotr run save +scoresub +serial +set_draw_slice setmetatable sfx sget @@ -99,5 +121,7 @@ sspr stat sub time +tonum +tostr type yield diff --git a/code/api/api.sublime-completions b/code/api/api.sublime-completions deleted file mode 100644 index 8ede898..0000000 --- a/code/api/api.sublime-completions +++ /dev/null @@ -1,104 +0,0 @@ -{ - "scope": "source.p8", - - "completions": [ - { "trigger": "abs", "contents": "abs(${1:x})$0" }, - { "trigger": "add", "contents": "add(${1:t},${2:v})$0" }, - { "trigger": "all", "contents": "all(${1:t})$0" }, - { "trigger": "assert", "contents": "assert(${1:condition})$0" }, - { "trigger": "atan2", "contents": "atan2(${1:dx},${2:dy})$0" }, - { "trigger": "band", "contents": "band(${1:x},${2:y})$0" }, - { "trigger": "bnot", "contents": "bnot(${1:x})$0" }, - { "trigger": "bor", "contents": "bor(${1:x},${2:y})$0" }, - { "trigger": "btn", "contents": "btn(${1:i},${2:p})$0" }, - { "trigger": "btnp", "contents": "btnp(${1:i},${2:p})$0" }, - { "trigger": "bxor", "contents": "bxor(${1:x},${2:y})$0" }, - { "trigger": "camera", "contents": "camera(${1:x},${2:y})$0" }, - { "trigger": "cartdata", "contents": "cartdata(${1:id})$0" }, - { "trigger": "cd", "contents": "cd(${1:dir})$0" }, - { "trigger": "ceil", "contents": "-flr(-${1:x})$0" }, - { "trigger": "circ", "contents": "circ(${1:x},${2:y},${3:r},${4:col})$0" }, - { "trigger": "circfill", "contents": "circfill(${1:x},${2:y},${3:r},${4:col})$0" }, - { "trigger": "clip", "contents": "clip(${1:x},${2:y},${3:w},${4:h})$0" }, - { "trigger": "cls", "contents": "cls()$0" }, - { "trigger": "cocreate", "contents": "cocreate(${1:f})$0" }, - { "trigger": "color", "contents": "color(${1:col})$0" }, - { "trigger": "coresume", "contents": "coresume(${1:c})$0" }, - { "trigger": "cos", "contents": "cos(${1:x})$0" }, - { "trigger": "costatus", "contents": "costatus(${1:c})$0" }, - { "trigger": "count", "contents": "count(${1:t})$0" }, - { "trigger": "cstore", "contents": "cstore(${1:dest},${2:src},${3:len},${4:cart})$0" }, - { "trigger": "cursor", "contents": "cursor(${1:x},${2:y})$0" }, - { "trigger": "del", "contents": "del(${1:t},${2:v})$0" }, - { "trigger": "dget", "contents": "dget(${1:idx})$0" }, - { "trigger": "dir", "contents": "dir()$0" }, - { "trigger": "dset", "contents": "dset(${1:idx},${2:val})$0" }, - { "trigger": "exit", "contents": "exit()$0" }, - { "trigger": "export", "contents": "export(${1:file})$0" }, - { "trigger": "extcmd", "contents": "extcmd(\"${1:cmd}\")$0" }, - { "trigger": "fget", "contents": "fget(${1:n},${2:f})$0" }, - { "trigger": "flip", "contents": "flip()$0" }, - { "trigger": "flr", "contents": "flr(${1:x})$0" }, - { "trigger": "folder", "contents": "folder()$0" }, - { "trigger": "foreach", "contents": "foreach(${1:t},${2:f})$0" }, - { "trigger": "fset", "contents": "fset(${1:n},${2:f},${3:v})$0" }, - { "trigger": "help", "contents": "help()$0" }, - { "trigger": "holdframe", "contents": "holdframe()$0" }, - { "trigger": "import", "contents": "import(${1:file}.png)$0" }, - { "trigger": "info", "contents": "info()$0" }, - { "trigger": "install_demos", "contents": "install_demos()$0" }, - { "trigger": "install_games", "contents": "install_games()$0" }, - { "trigger": "keyconfig", "contents": "keyconfig()$0" }, - { "trigger": "line", "contents": "line(${1:x0},${2:y0},${3:x1},${4:y1},${5:col})$0" }, - { "trigger": "load", "contents": "load(${1:cart})$0" }, - { "trigger": "ls", "contents": "ls()$0" }, - { "trigger": "map", "contents": "map(${1:cel_x},${2:cel_y},${3:sx},${4:sy},${5:cel_w},${6:cel_h},${7:layer})$0" }, - { "trigger": "mapdraw", "contents": "mapdraw(${1:cel_x},${2:cel_y},${3:sx},${4:sy},${5:cel_w},${6:cel_h},${7:layer})$0" }, - { "trigger": "max", "contents": "max(${1:x},${2:y})$0" }, - { "trigger": "memcpy", "contents": "memcpy(${1:dest},${2:src},${3:len})$0" }, - { "trigger": "memset", "contents": "memset(${1:dest},${2:val},${3:len})$0" }, - { "trigger": "menuitem", "contents": "menuitem(${1:idx},${2:label},${3:callback})$0" }, - { "trigger": "mget", "contents": "mget(${1:x},${2:y})$0" }, - { "trigger": "mid", "contents": "mid(${1:x},${2:y},${3:z})$0" }, - { "trigger": "min", "contents": "min(${1:x},${2:y})$0" }, - { "trigger": "mkdir", "contents": "mkdir(${1:dir})$0" }, - { "trigger": "mset", "contents": "mset(${1:x},${2:y},${3:v})$0" }, - { "trigger": "music", "contents": "music(${1:n},${2:fade_len},${3:channel_mask})$0" }, - { "trigger": "pairs", "contents": "pairs(${1:t})$0" }, - { "trigger": "pal", "contents": "pal(${1:c0},${2:c1},${3:p})$0" }, - { "trigger": "palt", "contents": "palt(${1:col},${2:t})$0" }, - { "trigger": "peek", "contents": "peek(${1:addr})$0" }, - { "trigger": "pget", "contents": "pget(${1:x},${2:y})$0" }, - { "trigger": "poke", "contents": "poke(${1:addr},${2:val})$0" }, - { "trigger": "print", "contents": "print(${1:str},${2:x},${3:y},${4:col})$0" }, - { "trigger": "printh", "contents": "printh(${1:str},${2:filename},${3:overwrite})$0" }, - { "trigger": "pset", "contents": "pset(${1:x},${2:y},${3:col})$0" }, - { "trigger": "reboot", "contents": "reboot()$0" }, - { "trigger": "rect", "contents": "rect(${1:x0},${2:y0},${3:x1},${4:y1},${5:col})$0" }, - { "trigger": "rectfill", "contents": "rectfill(${1:x0},${2:y0},${3:x1},${4:y1},${5:col})$0" }, - { "trigger": "reload", "contents": "reload(${1:dest},${2:src},${3:len},${4:cart})$0" }, - { "trigger": "resume", "contents": "resume()$0" }, - { "trigger": "rnd", "contents": "rnd(${1:x})$0" }, - { "trigger": "run", "contents": "run()$0" }, - { "trigger": "save", "contents": "save(${1:cart})$0" }, - { "trigger": "setmetatable", "contents": "setmetatable(${1:t},${2:mt})$0" }, - { "trigger": "sfx", "contents": "sfx(${1:n},${2:channel},${3:offset})$0" }, - { "trigger": "sget", "contents": "sget(${1:x},${2:y})$0" }, - { "trigger": "sgn", "contents": "sgn(${1:x})$0" }, - { "trigger": "shl", "contents": "shl(${1:x},${2:y})$0" }, - { "trigger": "shr", "contents": "shr(${1:x},${2:y})$0" }, - { "trigger": "shutdown", "contents": "shutdown()$0" }, - { "trigger": "sin", "contents": "sin(${1:x})$0" }, - { "trigger": "splore", "contents": "splore()$0" }, - { "trigger": "spr", "contents": "spr(${1:n},${2:x},${3:y},${4:w},${5:h},${6:flip_x},${7:flip_y})$0" }, - { "trigger": "sqrt", "contents": "sqrt(${1:x})$0" }, - { "trigger": "srand", "contents": "srand(${1:x})$0" }, - { "trigger": "sset", "contents": "sset(${1:x},${2:y},${3:col})$0" }, - { "trigger": "sspr", "contents": "sspr(${1:sx},${2:sy},${3:sw},${4:sh},${5:dx},${6:dy},${7:dw},${8:dh},${9:flip_x},${10:flip_y})$0" }, - { "trigger": "stat", "contents": "stat(${1:x})$0" }, - { "trigger": "sub", "contents": "sub(${1:str},${2:from},${3:to})$0" }, - { "trigger": "time", "contents": "time()$0" }, - { "trigger": "type", "contents": "type(${1:v})$0" }, - { "trigger": "yield", "contents": "yield()$0" } - ] -} diff --git a/code/blocks/else.sublime-snippet b/code/blocks/else.sublime-snippet deleted file mode 100644 index dea7348..0000000 --- a/code/blocks/else.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - else - source.p8 - else - diff --git a/code/blocks/elseif.sublime-snippet b/code/blocks/elseif.sublime-snippet deleted file mode 100644 index 6c06dbf..0000000 --- a/code/blocks/elseif.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - elseif - source.p8 - elseif - diff --git a/code/blocks/for.sublime-snippet b/code/blocks/for.sublime-snippet deleted file mode 100644 index 3628423..0000000 --- a/code/blocks/for.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - for - source.p8 - for - diff --git a/code/blocks/forall.sublime-snippet b/code/blocks/forall.sublime-snippet deleted file mode 100644 index 369cbac..0000000 --- a/code/blocks/forall.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - forall - source.p8 - for-in-all - diff --git a/code/blocks/forpairs.sublime-snippet b/code/blocks/forpairs.sublime-snippet deleted file mode 100644 index c78adca..0000000 --- a/code/blocks/forpairs.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - forpairs - source.p8 - for-in-pairs - diff --git a/code/blocks/function.sublime-snippet b/code/blocks/function.sublime-snippet deleted file mode 100644 index e6d636e..0000000 --- a/code/blocks/function.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - func - source.p8 - function - diff --git a/code/blocks/if.sublime-snippet b/code/blocks/if.sublime-snippet deleted file mode 100644 index b62d6ef..0000000 --- a/code/blocks/if.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - if - source.p8 - if - diff --git a/code/blocks/main-loop.sublime-snippet b/code/blocks/main-loop.sublime-snippet deleted file mode 100644 index dd66263..0000000 --- a/code/blocks/main-loop.sublime-snippet +++ /dev/null @@ -1,18 +0,0 @@ - - - main - source.p8 - main loop - diff --git a/code/blocks/repeat.sublime-snippet b/code/blocks/repeat.sublime-snippet deleted file mode 100644 index 10f86c1..0000000 --- a/code/blocks/repeat.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - repeat - source.p8 - repeat - diff --git a/code/blocks/while.sublime-snippet b/code/blocks/while.sublime-snippet deleted file mode 100644 index 39c6b15..0000000 --- a/code/blocks/while.sublime-snippet +++ /dev/null @@ -1,10 +0,0 @@ - - - while - source.p8 - while - diff --git a/code/completions/api.sublime-completions b/code/completions/api.sublime-completions new file mode 100644 index 0000000..f77533a --- /dev/null +++ b/code/completions/api.sublime-completions @@ -0,0 +1,104 @@ +{ + "scope": "source.p8 source.lua - string - comment", + + "completions": [ + { "trigger": "abs", "contents": "abs(${1:x})" }, + { "trigger": "add", "contents": "add(${1:t}, ${2:v})" }, + { "trigger": "all", "contents": "all(${1:t})" }, + { "trigger": "assert", "contents": "assert(${1:condition})" }, + { "trigger": "atan2", "contents": "atan2(${1:dx}, ${2:dy})" }, + { "trigger": "band", "contents": "band(${1:x}, ${2:y})" }, + { "trigger": "bnot", "contents": "bnot(${1:x})" }, + { "trigger": "bor", "contents": "bor(${1:x}, ${2:y})" }, + { "trigger": "btn", "contents": "btn(${1:i}, ${2:p})" }, + { "trigger": "btnp", "contents": "btnp(${1:i}, ${2:p})" }, + { "trigger": "bxor", "contents": "bxor(${1:x}, ${2:y})" }, + { "trigger": "camera", "contents": "camera(${1:x}, ${2:y})" }, + { "trigger": "cartdata", "contents": "cartdata(${1:id})" }, + { "trigger": "cd", "contents": "cd(${1:dir})" }, + { "trigger": "ceil", "contents": "-flr(-${1:x})" }, + { "trigger": "circ", "contents": "circ(${1:x}, ${2:y}, ${3:r}, ${4:col})" }, + { "trigger": "circfill", "contents": "circfill(${1:x}, ${2:y}, ${3:r}, ${4:col})" }, + { "trigger": "clip", "contents": "clip(${1:x}, ${2:y}, ${3:w}, ${4:h})" }, + { "trigger": "cls", "contents": "cls()" }, + { "trigger": "cocreate", "contents": "cocreate(${1:f})" }, + { "trigger": "color", "contents": "color(${1:col})" }, + { "trigger": "coresume", "contents": "coresume(${1:c})" }, + { "trigger": "cos", "contents": "cos(${1:x})" }, + { "trigger": "costatus", "contents": "costatus(${1:c})" }, + // { "trigger": "count", "contents": "count(${1:t})" }, + { "trigger": "cstore", "contents": "cstore(${1:dest}, ${2:src}, ${3:len}, ${4:cart})" }, + { "trigger": "cursor", "contents": "cursor(${1:x}, ${2:y})" }, + { "trigger": "del", "contents": "del(${1:t}, ${2:v})" }, + { "trigger": "dget", "contents": "dget(${1:idx})" }, + { "trigger": "dir", "contents": "dir()" }, + { "trigger": "dset", "contents": "dset(${1:idx}, ${2:val})" }, + { "trigger": "exit", "contents": "exit()" }, + { "trigger": "export", "contents": "export(${1:file})" }, + { "trigger": "extcmd", "contents": "extcmd(\"${1:cmd}\")" }, + { "trigger": "fget", "contents": "fget(${1:n}, ${2:f})" }, + { "trigger": "flip", "contents": "flip()" }, + { "trigger": "flr", "contents": "flr(${1:x})" }, + { "trigger": "folder", "contents": "folder()" }, + { "trigger": "foreach", "contents": "foreach(${1:t}, ${2:f})" }, + { "trigger": "fset", "contents": "fset(${1:n}, ${2:f}, ${3:v})" }, + { "trigger": "help", "contents": "help()" }, + { "trigger": "holdframe", "contents": "holdframe()" }, + { "trigger": "import", "contents": "import(${1:file}.png)" }, + { "trigger": "info", "contents": "info()" }, + { "trigger": "install_demos", "contents": "install_demos()" }, + { "trigger": "install_games", "contents": "install_games()" }, + { "trigger": "keyconfig", "contents": "keyconfig()" }, + { "trigger": "line", "contents": "line(${1:x0}, ${2:y0}, ${3:x1}, ${4:y1}, ${5:col})" }, + { "trigger": "load", "contents": "load(${1:cart})" }, + { "trigger": "ls", "contents": "ls()" }, + { "trigger": "map", "contents": "map(${1:cel_x}, ${2:cel_y}, ${3:sx}, ${4:sy}, ${5:cel_w}, ${6:cel_h}, ${7:layer})" }, + // { "trigger": "mapdraw", "contents": "mapdraw(${1:cel_x}, ${2:cel_y}, ${3:sx}, ${4:sy}, ${5:cel_w}, ${6:cel_h}, ${7:layer})" }, + { "trigger": "max", "contents": "max(${1:x}, ${2:y})" }, + { "trigger": "memcpy", "contents": "memcpy(${1:dest}, ${2:src}, ${3:len})" }, + { "trigger": "memset", "contents": "memset(${1:dest}, ${2:val}, ${3:len})" }, + { "trigger": "menuitem", "contents": "menuitem(${1:idx}, ${2:label}, ${3:callback})" }, + { "trigger": "mget", "contents": "mget(${1:x}, ${2:y})" }, + { "trigger": "mid", "contents": "mid(${1:x}, ${2:y}, ${3:z})" }, + { "trigger": "min", "contents": "min(${1:x}, ${2:y})" }, + { "trigger": "mkdir", "contents": "mkdir(${1:dir})" }, + { "trigger": "mset", "contents": "mset(${1:x}, ${2:y}, ${3:v})" }, + { "trigger": "music", "contents": "music(${1:n}, ${2:fade_len}, ${3:channel_mask})" }, + { "trigger": "pairs", "contents": "pairs(${1:t})" }, + { "trigger": "pal", "contents": "pal(${1:c0}, ${2:c1}, ${3:p})" }, + { "trigger": "palt", "contents": "palt(${1:col}, ${2:t})" }, + { "trigger": "peek", "contents": "peek(${1:addr})" }, + { "trigger": "pget", "contents": "pget(${1:x}, ${2:y})" }, + { "trigger": "poke", "contents": "poke(${1:addr}, ${2:val})" }, + { "trigger": "print", "contents": "print(${1:str}, ${2:x}, ${3:y}, ${4:col})" }, + { "trigger": "printh", "contents": "printh(${1:str}, ${2:filename}, ${3:overwrite})" }, + { "trigger": "pset", "contents": "pset(${1:x}, ${2:y}, ${3:col})" }, + { "trigger": "reboot", "contents": "reboot()" }, + { "trigger": "rect", "contents": "rect(${1:x0}, ${2:y0}, ${3:x1}, ${4:y1}, ${5:col})" }, + { "trigger": "rectfill", "contents": "rectfill(${1:x0}, ${2:y0}, ${3:x1}, ${4:y1}, ${5:col})" }, + { "trigger": "reload", "contents": "reload(${1:dest}, ${2:src}, ${3:len}, ${4:cart})" }, + { "trigger": "resume", "contents": "resume()" }, + { "trigger": "rnd", "contents": "rnd(${1:x})" }, + { "trigger": "run", "contents": "run()" }, + { "trigger": "save", "contents": "save(${1:cart})" }, + { "trigger": "setmetatable", "contents": "setmetatable(${1:t}, ${2:mt})" }, + { "trigger": "sfx", "contents": "sfx(${1:n}, ${2:channel}, ${3:offset})" }, + { "trigger": "sget", "contents": "sget(${1:x}, ${2:y})" }, + { "trigger": "sgn", "contents": "sgn(${1:x})" }, + { "trigger": "shl", "contents": "shl(${1:x}, ${2:y})" }, + { "trigger": "shr", "contents": "shr(${1:x}, ${2:y})" }, + { "trigger": "shutdown", "contents": "shutdown()" }, + { "trigger": "sin", "contents": "sin(${1:x})" }, + { "trigger": "splore", "contents": "splore()" }, + { "trigger": "spr", "contents": "spr(${1:n}, ${2:x}, ${3:y}, ${4:w}, ${5:h}, ${6:flip_x}, ${7:flip_y})" }, + { "trigger": "sqrt", "contents": "sqrt(${1:x})" }, + { "trigger": "srand", "contents": "srand(${1:x})" }, + { "trigger": "sset", "contents": "sset(${1:x}, ${2:y}, ${3:col})" }, + { "trigger": "sspr", "contents": "sspr(${1:sx}, ${2:sy}, ${3:sw}, ${4:sh}, ${5:dx}, ${6:dy}, ${7:dw}, ${8:dh}, ${9:flip_x}, ${10:flip_y})" }, + { "trigger": "stat", "contents": "stat(${1:x})" }, + { "trigger": "sub", "contents": "sub(${1:str}, ${2:from}, ${3:to})" }, + { "trigger": "time", "contents": "time()" }, + { "trigger": "type", "contents": "type(${1:v})" }, + { "trigger": "yield", "contents": "yield()" } + ] +} diff --git a/code/snippets/++.sublime-snippet b/code/snippets/++.sublime-snippet new file mode 100644 index 0000000..97c31ae --- /dev/null +++ b/code/snippets/++.sublime-snippet @@ -0,0 +1,6 @@ + + + ++ + source.p8 source.lua - string - comment + x = x + 1 + diff --git a/code/snippets/dfor-generic-all.sublime-snippet b/code/snippets/dfor-generic-all.sublime-snippet new file mode 100644 index 0000000..af1d0bc --- /dev/null +++ b/code/snippets/dfor-generic-all.sublime-snippet @@ -0,0 +1,11 @@ + + + dfori + source.p8 source.lua - string - comment + Documented for i, v in all() + diff --git a/code/snippets/dfor-generic-pairs.sublime-snippet b/code/snippets/dfor-generic-pairs.sublime-snippet new file mode 100644 index 0000000..228fe17 --- /dev/null +++ b/code/snippets/dfor-generic-pairs.sublime-snippet @@ -0,0 +1,11 @@ + + + dforp + source.p8 source.lua - string - comment + Documented for k, v in pairs() + diff --git a/code/snippets/dfor-numeric.sublime-snippet b/code/snippets/dfor-numeric.sublime-snippet new file mode 100644 index 0000000..131ca11 --- /dev/null +++ b/code/snippets/dfor-numeric.sublime-snippet @@ -0,0 +1,11 @@ + + + dfor + source.p8 source.lua - string - comment + Documented for i = 1, 10 + diff --git a/code/snippets/dfun.sublime-snippet b/code/snippets/dfun.sublime-snippet new file mode 100644 index 0000000..74da42e --- /dev/null +++ b/code/snippets/dfun.sublime-snippet @@ -0,0 +1,12 @@ + + + dfun + source.p8 source.lua - string - comment + LDoc function + diff --git a/code/blocks/draw.sublime-snippet b/code/snippets/draw.sublime-snippet similarity index 60% rename from code/blocks/draw.sublime-snippet rename to code/snippets/draw.sublime-snippet index e7b023f..17eb13a 100644 --- a/code/blocks/draw.sublime-snippet +++ b/code/snippets/draw.sublime-snippet @@ -1,10 +1,10 @@ draw - source.p8 + source.p8 source.lua - string - comment _draw() diff --git a/code/snippets/else.sublime-snippet b/code/snippets/else.sublime-snippet new file mode 100644 index 0000000..2f02fc1 --- /dev/null +++ b/code/snippets/else.sublime-snippet @@ -0,0 +1,10 @@ + + + else + source.p8 source.lua - string - comment + else ... end + diff --git a/code/snippets/elseif.sublime-snippet b/code/snippets/elseif.sublime-snippet new file mode 100644 index 0000000..ce992c6 --- /dev/null +++ b/code/snippets/elseif.sublime-snippet @@ -0,0 +1,10 @@ + + + elseif + source.p8 source.lua - string - comment + elseif x then + diff --git a/code/snippets/elseif=.sublime-snippet b/code/snippets/elseif=.sublime-snippet new file mode 100644 index 0000000..ddffc84 --- /dev/null +++ b/code/snippets/elseif=.sublime-snippet @@ -0,0 +1,10 @@ + + + elseif= + source.p8 source.lua - string - comment + elseif a == b then + diff --git a/code/snippets/elseif~.sublime-snippet b/code/snippets/elseif~.sublime-snippet new file mode 100644 index 0000000..ff99930 --- /dev/null +++ b/code/snippets/elseif~.sublime-snippet @@ -0,0 +1,10 @@ + + + elseif~ + source.p8 source.lua - string - comment + elseif a ~= b then + diff --git a/code/snippets/for-generic-all.sublime-snippet b/code/snippets/for-generic-all.sublime-snippet new file mode 100644 index 0000000..b49f54d --- /dev/null +++ b/code/snippets/for-generic-all.sublime-snippet @@ -0,0 +1,10 @@ + + + fori + source.p8 source.lua - string - comment + for i, v in ipairs() + diff --git a/code/snippets/for-generic-pairs.sublime-snippet b/code/snippets/for-generic-pairs.sublime-snippet new file mode 100644 index 0000000..0165d12 --- /dev/null +++ b/code/snippets/for-generic-pairs.sublime-snippet @@ -0,0 +1,10 @@ + + + forp + source.p8 source.lua - string - comment + for k, v in pairs() + diff --git a/code/snippets/for-numeric.sublime-snippet b/code/snippets/for-numeric.sublime-snippet new file mode 100644 index 0000000..398f7cb --- /dev/null +++ b/code/snippets/for-numeric.sublime-snippet @@ -0,0 +1,10 @@ + + + for + source.p8 source.lua - string - comment + for i = 1, 10 + diff --git a/code/snippets/function.sublime-snippet b/code/snippets/function.sublime-snippet new file mode 100644 index 0000000..c9964c2 --- /dev/null +++ b/code/snippets/function.sublime-snippet @@ -0,0 +1,10 @@ + + + function + source.p8 source.lua - string - comment + function + diff --git a/code/blocks/goto.sublime-snippet b/code/snippets/goto.sublime-snippet similarity index 72% rename from code/blocks/goto.sublime-snippet rename to code/snippets/goto.sublime-snippet index bbf20f8..5ebff0f 100644 --- a/code/blocks/goto.sublime-snippet +++ b/code/snippets/goto.sublime-snippet @@ -4,6 +4,6 @@ goto ${1:label} ]]> goto - source.p8 + source.p8 source.lua - string - comment goto diff --git a/code/hacks/ghack.sublime-snippet b/code/snippets/hacks/ghack.sublime-snippet similarity index 89% rename from code/hacks/ghack.sublime-snippet rename to code/snippets/hacks/ghack.sublime-snippet index c8b299f..47b5781 100644 --- a/code/hacks/ghack.sublime-snippet +++ b/code/snippets/hacks/ghack.sublime-snippet @@ -10,6 +10,6 @@ -- poke(0x5f2c,7) -- mirror top-left quarter ]]> ghack - source.p8 + source.p8 source.lua - string - comment graphics hack diff --git a/code/hacks/gpio.sublime-snippet b/code/snippets/hacks/gpio.sublime-snippet similarity index 81% rename from code/hacks/gpio.sublime-snippet rename to code/snippets/hacks/gpio.sublime-snippet index fd2c167..3b8550f 100644 --- a/code/hacks/gpio.sublime-snippet +++ b/code/snippets/hacks/gpio.sublime-snippet @@ -5,6 +5,6 @@ poke(0x5f80, 255) -- send 255 to gpio0 peek(0x5f81) -- get value from gpio1 ]]> gpio - source.p8 + source.p8 source.lua - string - comment raspi/pchip gpio diff --git a/code/hacks/mouse.sublime-snippet b/code/snippets/hacks/mouse.sublime-snippet similarity index 66% rename from code/hacks/mouse.sublime-snippet rename to code/snippets/hacks/mouse.sublime-snippet index 8a2a018..367bb6b 100644 --- a/code/hacks/mouse.sublime-snippet +++ b/code/snippets/hacks/mouse.sublime-snippet @@ -1,11 +1,11 @@ mouse - source.p8 + source.p8 source.lua - string - comment mouse hack diff --git a/code/blocks/header.sublime-snippet b/code/snippets/header.sublime-snippet similarity index 73% rename from code/blocks/header.sublime-snippet rename to code/snippets/header.sublime-snippet index cb79c77..16c9c37 100644 --- a/code/blocks/header.sublime-snippet +++ b/code/snippets/header.sublime-snippet @@ -4,6 +4,6 @@ -- ${2:author} ]]> head - source.p8 + source.p8 source.lua - string - comment cart header diff --git a/code/blocks/if-short.sublime-snippet b/code/snippets/if-short.sublime-snippet similarity index 72% rename from code/blocks/if-short.sublime-snippet rename to code/snippets/if-short.sublime-snippet index fe73457..e0eb619 100644 --- a/code/blocks/if-short.sublime-snippet +++ b/code/snippets/if-short.sublime-snippet @@ -3,6 +3,6 @@ if (${1:condition}) ${2:-- code} ]]> if - source.p8 + source.p8 source.lua - string - comment if() diff --git a/code/snippets/if.sublime-snippet b/code/snippets/if.sublime-snippet new file mode 100644 index 0000000..5f555a2 --- /dev/null +++ b/code/snippets/if.sublime-snippet @@ -0,0 +1,10 @@ + + + if + source.p8 source.lua - string - comment + if x then + diff --git a/code/snippets/if=.sublime-snippet b/code/snippets/if=.sublime-snippet new file mode 100644 index 0000000..68453ce --- /dev/null +++ b/code/snippets/if=.sublime-snippet @@ -0,0 +1,10 @@ + + + if= + source.p8 source.lua - string - comment + if a == b then + diff --git a/code/blocks/ifelse.sublime-snippet b/code/snippets/ifelse.sublime-snippet similarity index 66% rename from code/blocks/ifelse.sublime-snippet rename to code/snippets/ifelse.sublime-snippet index e2d6cb1..7f11dea 100644 --- a/code/blocks/ifelse.sublime-snippet +++ b/code/snippets/ifelse.sublime-snippet @@ -1,12 +1,12 @@ ifelse - source.p8 + source.p8 source.lua - string - comment if-else diff --git a/code/snippets/if~.sublime-snippet b/code/snippets/if~.sublime-snippet new file mode 100644 index 0000000..66a923c --- /dev/null +++ b/code/snippets/if~.sublime-snippet @@ -0,0 +1,10 @@ + + + if~ + source.p8 source.lua - string - comment + if a ~= b then + diff --git a/code/blocks/init.sublime-snippet b/code/snippets/init.sublime-snippet similarity index 74% rename from code/blocks/init.sublime-snippet rename to code/snippets/init.sublime-snippet index bfa3202..13d5d79 100644 --- a/code/blocks/init.sublime-snippet +++ b/code/snippets/init.sublime-snippet @@ -5,6 +5,6 @@ function _init() end ]]> init - source.p8 + source.p8 source.lua - string - comment _init() diff --git a/code/snippets/local-x-=-1.sublime-snippet b/code/snippets/local-x-=-1.sublime-snippet new file mode 100644 index 0000000..5ffc726 --- /dev/null +++ b/code/snippets/local-x-=-1.sublime-snippet @@ -0,0 +1,8 @@ + + + local + source.p8 source.lua - string - comment + local x = 1 + diff --git a/code/snippets/mainloop.sublime-snippet b/code/snippets/mainloop.sublime-snippet new file mode 100644 index 0000000..7b5a9ca --- /dev/null +++ b/code/snippets/mainloop.sublime-snippet @@ -0,0 +1,18 @@ + + + mainloop + source.p8 source.lua - string - comment + mainloop functions + diff --git a/code/blocks/metatable.sublime-snippet b/code/snippets/metatable.sublime-snippet similarity index 91% rename from code/blocks/metatable.sublime-snippet rename to code/snippets/metatable.sublime-snippet index d5dc65e..70a9b4d 100644 --- a/code/blocks/metatable.sublime-snippet +++ b/code/snippets/metatable.sublime-snippet @@ -8,7 +8,6 @@ function ${1:mt}.__call() end ${1:mt}.__metatable={} function ${1:mt}.__tostring(t) end function ${1:mt}.__len(t) end -function ${1:mt}.__gc(userdata) end function ${1:mt}.__unm(a) end function ${1:mt}.__add(a,b) end function ${1:mt}.__sub(a,b) end @@ -22,6 +21,6 @@ function ${1:mt}.__lt(a,b) end function ${1:mt}.__le(a,b) end ]]> mt - source.p8 + source.p8 source.lua - string - comment metatable diff --git a/code/snippets/repeat.sublime-snippet b/code/snippets/repeat.sublime-snippet new file mode 100644 index 0000000..cb03b58 --- /dev/null +++ b/code/snippets/repeat.sublime-snippet @@ -0,0 +1,10 @@ + + + repeat + source.p8 source.lua - string - comment + repeat until false + diff --git a/code/blocks/update.sublime-snippet b/code/snippets/update.sublime-snippet similarity index 61% rename from code/blocks/update.sublime-snippet rename to code/snippets/update.sublime-snippet index f08906e..6ef76af 100644 --- a/code/blocks/update.sublime-snippet +++ b/code/snippets/update.sublime-snippet @@ -1,10 +1,10 @@ update - source.p8 + source.p8 source.lua - string - comment _update() diff --git a/code/blocks/update60.sublime-snippet b/code/snippets/update60.sublime-snippet similarity index 61% rename from code/blocks/update60.sublime-snippet rename to code/snippets/update60.sublime-snippet index 210e19c..44982b8 100644 --- a/code/blocks/update60.sublime-snippet +++ b/code/snippets/update60.sublime-snippet @@ -1,10 +1,10 @@ update - source.p8 + source.p8 source.lua - string - comment _update60() diff --git a/code/snippets/while.sublime-snippet b/code/snippets/while.sublime-snippet new file mode 100644 index 0000000..4a4b101 --- /dev/null +++ b/code/snippets/while.sublime-snippet @@ -0,0 +1,10 @@ + + + while + source.p8 source.lua - string - comment + while true do + diff --git a/comments.tmPreferences b/comments.tmPreferences index 15b80ba..9e49239 100644 --- a/comments.tmPreferences +++ b/comments.tmPreferences @@ -16,9 +16,42 @@ value -- + + name + TM_COMMENT_START_2 + value + --[[ + + + name + TM_COMMENT_END_2 + value + ]] + + + name + TM_COMMENT_START_3 + value + --[=[ + + + name + TM_COMMENT_END_3 + value + ]=] + + name + TM_COMMENT_START_4 + value + --[==[ + + + name + TM_COMMENT_END_4 + value + ]==] + - uuid - 7ECB64D3-77C6-43B2-A105-555AFAE640B3 diff --git a/completion_cancel.tmPreferences b/completion_cancel.tmPreferences new file mode 100644 index 0000000..42ea2de --- /dev/null +++ b/completion_cancel.tmPreferences @@ -0,0 +1,12 @@ + + + + scope + source.8 + settings + + cancelCompletion + ^(?:.*\b(?:break|then|end|do|else|local\s+\w*\s*=?\s*)|::.*)$ + + + diff --git a/Indent.tmPreferences b/indent.tmPreferences similarity index 57% rename from Indent.tmPreferences rename to indent.tmPreferences index 849a20e..773e9b8 100644 --- a/Indent.tmPreferences +++ b/indent.tmPreferences @@ -9,11 +9,10 @@ settings decreaseIndentPattern - ^\s*(elseif|else|end|until.+|\})\s*$ + (^(?!=.*(then|do).*).*\b(elseif|else|end|until)\b(?!.*(\"|\'|\[\=*\[)).*$|^((?!\{).)*\}\;?.*$) + increaseIndentPattern - ^\s*(else|elseif|for|(return\s+|local\s+|.+=)?function|if\s+.*\s+then|while|repeat)\b((?!end).)*$|\{\s*$ + (^.*\b((local\s+)?function|repeat)(?!.*(\"|\'|\[\=*\[))\b((?!\bend\b).)*$|^.*\b(do|then|else)(?!.*(\"|\'|\[\=*\[))\b((?!\bend\b).)*$|^.*\{((?!\}).)*$) - uuid - 411468A8-E0AC-415A-9E71-E2BD091EB571 - \ No newline at end of file + diff --git a/keywords.sublime-completions b/keywords.sublime-completions new file mode 100644 index 0000000..0bb9574 --- /dev/null +++ b/keywords.sublime-completions @@ -0,0 +1,27 @@ +{ + "scope" : "source.p8 - string - comment", + "completions": + [ + "and", + "break", + "do", + "else", + "elseif", + "end", + "false", + "for", + "function", + "if", + "in", + "local", + "nil", + "not", + "or", + "repeat", + "return", + "then", + "true", + "until", + "while", + ] +} diff --git a/messages.json b/messages.json index 5dc045a..2800576 100644 --- a/messages.json +++ b/messages.json @@ -2,5 +2,6 @@ "install": "messages/install.txt", "2016.6.30": "messages/2016.6.30.txt", "2016.7.1": "messages/2016.7.1.txt", - "2017.3.14": "messages/2017.3.14.txt" + "2017.3.14": "messages/2017.3.14.txt", + "2020.02.10": "messages/2020.02.10.txt" } diff --git a/messages/2020.02.10.txt b/messages/2020.02.10.txt new file mode 100644 index 0000000..56cd33b --- /dev/null +++ b/messages/2020.02.10.txt @@ -0,0 +1,14 @@ +Sublime PICO-8 v2020.02.10 + +Changelog +========= + +- Initial fork and merge of Sublime PICO-8 and LuaExtended +- Remove inapplicable LuaExtended parts +- added: Add "goto" to list of completion keywords +- added: Add support for block comments +- added: Additional completion cancel triggers +- changed: Rearrange files from both sources +- changed: Reformat CDATA in snippets +- fixed: Restrict snippet/completion/etc scopes, exclude strings, comments, non-lua sections +- removed: Disable completion of count() and mapdraw(), both deprecated diff --git a/messages/install.txt b/messages/install.txt index f369810..e32fae0 100644 --- a/messages/install.txt +++ b/messages/install.txt @@ -1,12 +1,18 @@ -Thanks for installing the PICO-8 plugin for the Sublime Text 3 editor. +Thanks for installing the PICO-8 Extended plugin for the Sublime Text 3 editor. Please, read this file to complete your installation. Font installation ================= -Before starting using this package, you'll need to install PICO-8.ttf to your system fonts. +For an authentic PICO-8 experience, you can install the PICO-8 font. To download the font, open the Command Palette in Sublime Text (ctrl+shift+p / cmd+shift+p) and run "PICO-8: Download Font". -Restart Sublime Text and test different font sizes until you find one that goes well with your screen resolution ! +Install the font to your system or user fonts in whatever way is appropriate for your OS. + +Alternately, other fonts with the PICO-8 glyphs are available online: +https://www.lexaloffle.com/bbs/?tid=3760 +https://github.com/juanitogan/p8-programming-fonts + +With a pixel-based font, you may need to experiment with font size to match your screen resolution. Cartridge runner setup ======================