├── dependencies.json ├── resources ├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap └── SnAPI.sublime-commands ├── api ├── sublime_plugin.txt ├── edit.txt ├── textchange.txt ├── historicposition.txt ├── phantomset.txt ├── sheet.txt ├── index.txt ├── phantom.txt ├── settings.txt ├── applicationcommand.txt ├── windowcommand.txt ├── completion.txt ├── textcommand.txt ├── completionlist.txt ├── selection.txt ├── textinputhandler.txt ├── listinputhandler.txt ├── region.txt ├── completion_kind.txt ├── completionitem.txt ├── general.txt ├── vieweventlistener.txt ├── sublime.txt ├── eventlistener.txt ├── window.txt ├── view.txt └── hyperhelp.json ├── colorscheme ├── example.txt ├── index.txt ├── variables.txt ├── customization.txt ├── rules.txt ├── colors.txt ├── global.txt └── hyperhelp.json ├── LICENSE ├── README.md └── SnAPI.py /dependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "*": { 3 | "*": [ 4 | "hyperhelpcore" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /resources/Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | // Open the help index on SnAPI, to browse the API 3 | { 4 | "keys": ["super+shift+h"], "command": "snapi_lookup" 5 | } 6 | ] -------------------------------------------------------------------------------- /resources/Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | // Open the help index on SnAPI, to browse the API 3 | { 4 | "keys": ["super+shift+h"], "command": "snapi_lookup" 5 | } 6 | ] -------------------------------------------------------------------------------- /resources/Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | // Open the help index on SnAPI, to browse the API 3 | { 4 | "keys": ["super+shift+h"], "command": "snapi_lookup" 5 | } 6 | ] -------------------------------------------------------------------------------- /resources/SnAPI.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "SnAPI: View Sublime API", "command": "hyperhelp_topic", "args": {"package": "SublimeAPI", "topic": "index.txt" } }, 3 | { "caption": "SnAPI: Search Sublime API", "command": "hyperhelp_index", "args": {"package": "SublimeAPI" } }, 4 | ] -------------------------------------------------------------------------------- /api/sublime_plugin.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin Module" date="2020-05-06" 2 | 3 | 4 | # sublime_plugin:sublime_plugin Module 5 | ======================= 6 | 7 | This module has no direct methods; it contains the following classes: 8 | 9 | |EventListener| 10 | |ViewEventListener| 11 | |ApplicationCommand| 12 | |WindowCommand| 13 | |TextCommand| 14 | |TextInputHandler| `[>=3154]` 15 | |ListInputHandler| `[>=3154]` 16 | 17 | 18 | -------------------------------------------------------------------------------- 19 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/edit.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Edit Class" date="2020-05-06" 2 | 3 | 4 | # edit:Edit Class 5 | ============ 6 | 7 | Edit objects have no functions, they exist to group buffer modifications. 8 | 9 | Edit objects are passed to |:textcommand:TextCommands|, and can not be created by the user. 10 | Using an invalid Edit object, or an Edit object from a different |View|, will 11 | cause the functions that require them to fail. 12 | 13 | This class is contained in the |sublime| module. 14 | 15 | 16 | -------------------------------------------------------------------------------- 17 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/textchange.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.TextChange Class" date="2020-05-06" 2 | 3 | 4 | # textchange:TextChange Class 5 | ============== 6 | 7 | Represents a change that occurred to the text of a |View|. This is primarily 8 | useful for replaying changes to a document. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | Availability: `[>=4050]` 13 | 14 | 15 | ## _none:Properties 16 | ------------- 17 | 18 | *textchange.a* 19 | Type: |HistoricPosition| 20 | 21 | The beginning point of the region that was modified 22 | 23 | 24 | *textchange.b* 25 | Type: |HistoricPosition| 26 | 27 | The ending point of the region that was modified 28 | 29 | 30 | *textchange.str* 31 | Type: str 32 | 33 | A unicode string of the new contents of the region specified by `.a` and 34 | `.b`. 35 | 36 | 37 | -------------------------------------------------------------------------------- 38 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/historicposition.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.HistoricPosition Class" date="2020-05-06" 2 | 3 | 4 | # historicposition:HistoricPosition Class 5 | ============== 6 | 7 | Provides a snapshot of the row and column info for a point, before 8 | changes were made to a |View|. This is primarily useful for replaying 9 | changes to a document. 10 | 11 | This class is contained in the |sublime| module. 12 | 13 | Availability: `[>=4050]` 14 | 15 | 16 | ## _none:Properties 17 | ------------- 18 | 19 | *historicposition.pt* 20 | Type: |point| 21 | 22 | The unicode character offset from the beginning of the |View| 23 | 24 | 25 | *historicposition.row* 26 | Type: int 27 | 28 | TThe row the `.pt` was in when the `HistoricPosition` was recorded 29 | 30 | 31 | *historicposition.col* 32 | Type: int 33 | 34 | The column the `.pt` was in when the `HistoricPosition` was recorded 35 | 36 | 37 | -------------------------------------------------------------------------------- 38 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/phantomset.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.PhantomSet Class" date="2020-05-06" 2 | 3 | 4 | # phantomset:PhantomSet Class 5 | ================== 6 | 7 | A collection that manages |:phantom:Phantoms| and the process of adding them, updating 8 | them and removing them from the |View|. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | 13 | ## _none:Constructors 14 | -------------- 15 | 16 | *phantomset_constructor:PhantomSet*(view, ) 17 | 18 | Creates a PhantomSet attached to a `view`. `key` is a string to group 19 | Phantoms together. 20 | 21 | 22 | ## _none:Methods 23 | --------- 24 | 25 | *PhantomSet.update*(new_phantoms) 26 | Returns: None 27 | 28 | `new_phantoms` should be a list of phantoms. 29 | 30 | The `.region` attribute of each existing phantom in the set will be 31 | updated. New phantoms will be added to the view and phantoms not in 32 | `new_phantoms` list will be deleted. 33 | 34 | 35 | -------------------------------------------------------------------------------- 36 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/sheet.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Sheet Class" date="2020-05-06" 2 | 3 | 4 | # sheet:Sheet Class 5 | ============= 6 | 7 | Represents a content container, i.e. a tab, within a window. Sheets may contain 8 | a |View|, or an image preview. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | 13 | *sheet.id*() 14 | Returns: int 15 | 16 | Returns a number that uniquely identifies this sheet. 17 | 18 | 19 | *sheet.window*() 20 | Returns: |Window| or None 21 | 22 | Returns the window containing the sheet. May be `None` if the sheet has 23 | been closed. 24 | 25 | 26 | *sheet.view*() 27 | Returns: |View| or None 28 | 29 | Returns the view contained within the sheet. May be `None` if the sheet is 30 | an image preview, or the view has been closed. 31 | 32 | 33 | *sheet.file_name*() `[>=4050]` 34 | Returns: str or None 35 | 36 | The full name file the file associated with the buffer, or None if it 37 | doesn't exist on disk. 38 | 39 | 40 | -------------------------------------------------------------------------------- 41 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /colorscheme/example.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Example" date="2020-05-07" 2 | 3 | 4 | The following is an example of the format of a .sublime-color-scheme file. A 5 | complete color scheme will have many more rules to cover the standard scope 6 | names. 7 | 8 | 9 | 10 | ```json 11 | { 12 | "name": "Example Color Scheme", 13 | "globals": 14 | { 15 | "background": "rgb(34, 34, 34)", 16 | "foreground": "#EEEEEE", 17 | "caret": "white" 18 | }, 19 | "rules": 20 | [ 21 | { 22 | "name": "Comment", 23 | "scope": "comment", 24 | "foreground": "#888888" 25 | }, 26 | { 27 | "name": "String", 28 | "scope": "string", 29 | "foreground": "hsla(50, 100%, 50%, 1)", 30 | }, 31 | { 32 | "name": "Number", 33 | "scope": "constant.numeric", 34 | "foreground": "#7F00FF", 35 | "font_style": "italic", 36 | } 37 | ] 38 | } 39 | ``` 40 | 41 | 42 | -------------------------------------------------------------------------------- 43 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /colorscheme/index.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Sublime Text Color Schemes" date="2020-05-07" 2 | 3 | 4 | The highlighting of source code and prose in Sublime Text is controlled by a 5 | color scheme. A color scheme assigns colors and font styles to scopes, which 6 | are assigned to the text by the syntax. The rest of the look of the user 7 | interface is controlled by the theme. The |theme| controls such elements as 8 | buttons select lists, the sidebar and tabs. 9 | 10 | Sublime Text color schemes are implemented using `.sublime-color-scheme` files, 11 | containing JSON. Sublime Text also supports a subset of features using the 12 | TextMate |:tmTheme:tmTheme| format. 13 | 14 | Before Sublime Text 3.1, only the .tmTheme format was supported. 15 | 16 | 17 | * |Example| 18 | * |Colors| 19 | * |Variables| 20 | * |Global Settings| 21 | * |Accents| 22 | * |CSS| 23 | * |Gutters| 24 | * |Diff| 25 | * |Selection| 26 | * |Find| 27 | * |Guides| 28 | * |Brackets| 29 | * |Tags| 30 | * |Shadows| 31 | * |Scope Rules| 32 | * |Matching| 33 | * |Naming| 34 | * |Style Rules| 35 | * |Hashed Syntax Highlighting| 36 | * |Examples| 37 | * |Customization| 38 | * |:appendix:Appendix: CSS Colors| 39 | 40 | 41 | -------------------------------------------------------------------------------- 42 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Note that the license below *DOES NOT* include any of the help files, which are 4 | taken from the official Sublime Text documentation at 5 | http://www.sublimetext.com/docs/ and are Copyright © Sublime HQ Pty Ltd. 6 | 7 | All other content in this package are licensed under the MIT License: 8 | 9 | Copyright 2017-2020 Terence Martin 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy of 12 | this software and associated documentation files (the "Software"), to deal in 13 | the Software without restriction, including without limitation the rights to 14 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 15 | of the Software, and to permit persons to whom the Software is furnished to do 16 | so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | -------------------------------------------------------------------------------- /api/index.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Sublime Text API Documentation" date="2020-05-06" 2 | 3 | 4 | *|_none:General Information|* *|_none:Core Components|* *|_none:Plugin Extension Points|* 5 | ------------------- --------------- ----------------------- 6 | |Example Plugins| |sublime| module |sublime_plugin| Module 7 | |Plugin Lifecycle| |Sheet| Class |EventListener| Class 8 | |Threading| |View| Class |ViewEventListener| Class 9 | |Units and Coordinates| |Selection| Class |ApplicationCommand| Class 10 | |Types| |Region| Class |WindowCommand| Class 11 | |Phantom| Class |TextCommand| Class 12 | |PhantomSet| Class |TextInputHandler| Class ** 13 | |Edit| Class |ListInputHandler| Class ** 14 | |TextChange| Class * 15 | |HistoricPosition| Class * 16 | |completion| Value 17 | |CompletionItem| Class * 18 | |completion_kind| tuple * 19 | |CompletionList| Class * 20 | |Window| Class 21 | |Settings| Class 22 | 23 | * - Available since build 4050 24 | ** - Available since build 3154 25 | 26 | 27 | -------------------------------------------------------------------------------- 28 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /colorscheme/variables.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Variables" date="2020-05-07" 2 | 3 | 4 | Reusable color definitions may be created in the variables key. The names may 5 | be any string utilizing the characters `a-z`, `A-Z`, `0-9`, `_` and `-`. The 6 | values may be any valid color format. 7 | 8 | Variables may be referenced in the global settings and rules, via the syntax 9 | `var(example_var_name)`. The following example shows basic variable usage: 10 | 11 | ```json 12 | { 13 | "name": "Example Color Scheme", 14 | "variables": 15 | { 16 | "green": "hsla(153, 80%, 40%, 1)", 17 | "black": "#111", 18 | "white": "rgb(242, 242, 242)" 19 | }, 20 | "globals": 21 | { 22 | "background": "var(black)", 23 | "foreground": "var(white)", 24 | "caret": "color(var(white) alpha(0.8))" 25 | }, 26 | "rules": 27 | [ 28 | { 29 | "name": "Comment", 30 | "scope": "comment", 31 | "foreground": "color(var(black) blend(#fff 50%))" 32 | }, 33 | { 34 | "name": "String", 35 | "scope": "string", 36 | "foreground": "var(green)", 37 | }, 38 | { 39 | "name": "Number", 40 | "scope": "constant.numeric", 41 | "foreground": "#7F00FF", 42 | "font_style": "italic", 43 | } 44 | ] 45 | } 46 | ``` 47 | 48 | 49 | -------------------------------------------------------------------------------- 50 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /colorscheme/customization.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Customization" date="2020-05-07" 2 | 3 | 4 | Color schemes based on the `.sublime-color-scheme` format are specified by 5 | filename only, not a package-based file path. This allows users to customize a 6 | color scheme by overriding variables or globals, and adding rules. 7 | 8 | To create a user-specific customization of a color scheme, create a new file 9 | with the same filename as the color scheme, but save it in the `Packages/User/` 10 | directory. 11 | 12 | For example, to customize the default Monokai color scheme, create a file named 13 | `Packages/User/Monokai.sublime-color-scheme`. The following settings will 14 | change the background color to be a fully-desaturated grey, the yellow to be 15 | more vibrant, and will add a new rule change Python docstrings to be colored 16 | the same as strings. 17 | 18 | ```json 19 | { 20 | "variables": 21 | { 22 | "yellow": "hsl(54, 100%, 50%)", 23 | }, 24 | "globals": 25 | { 26 | "background": "hsl(70, 0%, 15%)", 27 | }, 28 | "rules": 29 | [ 30 | { 31 | "name": "Python docstrings", 32 | "scope": "comment.block.documentation.python", 33 | "foreground": "var(yellow)" 34 | }, 35 | ] 36 | } 37 | ``` 38 | 39 | The contents of the `"variables"` and `"globals"` objects are merged, with the 40 | user's copy overwriting keys with the same name. For the `"rules"` list, the 41 | user's rules are appended. 42 | 43 | 44 | -------------------------------------------------------------------------------- 45 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /api/phantom.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Phantom Class" date="2020-05-06" 2 | 3 | 4 | # phantom:Phantom Class 5 | =============== 6 | 7 | Represents an HTML-based decoration to display non-editable content 8 | interspersed in a View. Used with |PhantomSet| to actually add the phantoms to 9 | the View. Once a Phantom has been constructed and added to the |View|, changes 10 | to the attributes will have no effect. 11 | 12 | This class is contained in the |sublime| module. 13 | 14 | 15 | ## _none:Constructors 16 | --------------- 17 | 18 | *phantom_constructor:Phantom*(region, content, layout, ) 19 | 20 | Creates a phantom attached to a region. The content is HTML to be processed 21 | by |minihtml|. 22 | 23 | layout must be one of: 24 | 25 | * `sublime.LAYOUT_INLINE`: Display the phantom in between the `region` and 26 | the point following. 27 | 28 | * `sublime.LAYOUT_BELOW`: Display the phantom in space below the current 29 | line, left-aligned with the `region`. 30 | 31 | * `sublime.LAYOUT_BLOCK`: Display the phantom in space below the current 32 | line, left-aligned with the beginning of the line. 33 | 34 | `on_navigate` is an optional callback that should accept a single string 35 | parameter, that is the `href` attribute of the link clicked. 36 | 37 | 38 | ## _none:Methods 39 | ---------- 40 | 41 | *phantom.__eq__*(rhs) `[UNDOCUMENTED]` 42 | Returns: value 43 | 44 | Determines if the `Phantom` in `rhs` is identical to this one; that is that 45 | it was created with the same `region`, `content`, `layout` and 46 | `on_navigate` arguments. 47 | 48 | 49 | -------------------------------------------------------------------------------- 50 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/settings.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Settings Class" date="2020-05-06" 2 | 3 | 4 | # settings:Settings Class 5 | ================ 6 | 7 | Represents settings as set in a file |view| or stored in a `sublime-settings` 8 | file. This class acts like a `dict`, but is not iterable. 9 | 10 | In `[>=4050]` the `dict` nature of settings objects is enhanced with the 11 | introduction of `__getitem__`, `__setitem__` and `__contains__` methods, 12 | allowing you to get and set settings as if the settings object was truly a 13 | `dict`. 14 | 15 | 16 | *settings.get*(name, ) 17 | Returns: |value| 18 | 19 | Returns the named setting, or `default` if it's not defined. If not passed, 20 | `default` will have a value of `None`. 21 | 22 | 23 | *settings.set*(name, value) 24 | Returns: None 25 | 26 | Sets the named setting. Only primitive types, `list`s, and `dict`s are 27 | accepted. 28 | 29 | 30 | *settings.setdefault*(name, default) `[UNDOCUMENTED]` `[>=4050]` 31 | Returns: |value| 32 | 33 | Returns the named setting, or `default` if it's not defined. In the case 34 | where the setting was not previously set, the provided `default` value is 35 | used to set the setting prior to return. 36 | 37 | 38 | *settings.erase*(name) 39 | Returns: None 40 | 41 | Removes the named setting. Does not remove it from any parent Settings. 42 | 43 | 44 | *settings.has*(name) 45 | Returns: bool 46 | 47 | Returns `True` iff the named option exists in this set of Settings or one 48 | of its parents. 49 | 50 | 51 | *settings.add_on_change*(key, on_change) 52 | Returns: None 53 | 54 | Register a callback to be run whenever a setting in this object is changed. 55 | 56 | 57 | *settings.clear_on_change*(key) 58 | Returns: None 59 | 60 | Remove all callbacks registered with the given `key`. 61 | 62 | 63 | -------------------------------------------------------------------------------- 64 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/applicationcommand.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.ApplicationCommand Class" date="2020-05-06" 2 | 3 | 4 | # applicationcommand:ApplicationCommand Class 5 | ========================== 6 | 7 | ApplicationCommands are instantiated only once. 8 | 9 | This class is contained in the |sublime_plugin| module. 10 | 11 | 12 | *ApplicationCommand.run*() 13 | Returns: None 14 | 15 | Called when the command is run. 16 | 17 | 18 | *ApplicationCommand.is_enabled*() 19 | Returns: bool 20 | 21 | Returns `True` if the command is able to be run at this time. The default 22 | implementation simply always returns `True`. 23 | 24 | 25 | *ApplicationCommand.is_visible*() 26 | Returns: bool 27 | 28 | Returns `True` if the command should be shown in the menu at this time. The 29 | default implementation always returns `True`. 30 | 31 | 32 | *ApplicationCommand.is_checked*() 33 | Returns: bool 34 | 35 | Returns `True` if a checkbox should be shown next to the menu item. The 36 | `.sublime-menu` file must have the checkbox attribute set to `true` for 37 | this to be used. 38 | 39 | 40 | *ApplicationCommand.description*() 41 | Returns: str 42 | 43 | Returns a description of the command with the given arguments. Used in the 44 | menu, if no caption is provided. Return `None` to get the default 45 | description. 46 | 47 | 48 | *ApplicationCommand.input*() `[>=3154]` 49 | Returns: |CommandInputHandler| or None 50 | 51 | If this returns something other than None, the user will be prompted for an 52 | input before the command is run in the Command Palette. 53 | 54 | 55 | *ApplicationCommand.input_description*() `[>=3154]` 56 | Returns: |CommandInputHandler| or None 57 | 58 | Allows a custom name to be show to the left of the cursor in the input box, 59 | instead of the default one generated from the command name 60 | 61 | 62 | -------------------------------------------------------------------------------- 63 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/windowcommand.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.WindowCommand Class" date="2020-05-06" 2 | 3 | 4 | # windowcommand:WindowCommand Class 5 | ====================== 6 | 7 | WindowCommands are instantiated once per window. The Window object may be 8 | retrieved via `self.window` 9 | 10 | This class is contained in the |sublime_plugin| module. 11 | 12 | 13 | *WindowCommand.run*() 14 | Returns: None 15 | 16 | Called when the command is run. 17 | 18 | 19 | *WindowCommand.is_enabled*() 20 | Returns: bool 21 | 22 | Returns `True` if the command is able to be run at this time. The default 23 | implementation simply always returns `True`. 24 | 25 | 26 | *WindowCommand.is_visible*() 27 | Returns: bool 28 | 29 | Returns `True` if the command should be shown in the menu at this time. The 30 | default implementation always returns `True`. 31 | 32 | 33 | *WindowCommand.is_checked*() `[UNDOCUMENTED]` 34 | Returns: bool 35 | 36 | Returns `True` if a checkbox should be shown next to the menu item. The 37 | `.sublime-menu` file must have the checkbox attribute set to `true` for 38 | this to be used. 39 | 40 | 41 | *WindowCommand.description*() 42 | Returns: str 43 | 44 | Returns a description of the command with the given arguments. Used in the 45 | menu, if no caption is provided. Return `None` to get the default 46 | description. 47 | 48 | 49 | *WindowCommand.input*() `[>=3154]` 50 | Returns: |CommandInputHandler| or None 51 | 52 | If this returns something other than None, the user will be prompted for an 53 | input before the command is run in the Command Palette. 54 | 55 | 56 | *WindowCommand.input_description*() `[>=3154]` 57 | Returns: |CommandInputHandler| or None 58 | 59 | Allows a custom name to be show to the left of the cursor in the input box, 60 | instead of the default one generated from the command name 61 | 62 | 63 | -------------------------------------------------------------------------------- 64 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/completion.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="completion Value" date="2020-05-06" 2 | 3 | 4 | # completion:completion Value 5 | ================== 6 | 7 | Represents an available auto-completion item. `completion` values may be 8 | of several formats. The term trigger refers to the text matched against 9 | the user input, replacement is what is inserted into the view if the 10 | item is selected. An annotation is a unicode string hint displayed to 11 | the right-hand side of the trigger. 12 | 13 | ## _none:str 14 | 15 | A unicode string that is both the trigger and the replacement 16 | 17 | ```python 18 | return [ 19 | "method1()", 20 | "method2()" 21 | ] 22 | ``` 23 | 24 | 25 | ## _none: 2-element `list`/`tuple` 26 | 27 | A pair of unicode strings, the trigger and the replacement. 28 | 29 | ```python 30 | return [ 31 | ["me1", "method1()"], 32 | ["me2", "method2()"] 33 | ] 34 | ``` 35 | 36 | If a `\t` is present in the trigger, all subsequent text is treated as an 37 | annotation. 38 | 39 | ```python 40 | return [ 41 | ["me1\tmethod", "method1()"], 42 | ["me2\tmethod", "method2()"] 43 | ] 44 | ``` 45 | 46 | The replacement text may contain dollar-numeric fields such as a snippet 47 | does, e.g. `$0`, `$1`. 48 | 49 | ```python 50 | return [ 51 | ["fn", "def ${1:name}($2) { $0 }"], 52 | ["for", "for ($1; $2; $3) { $0 }"] 53 | ] 54 | ``` 55 | 56 | 57 | ## _none: CompletionItem object `[>=4050]` 58 | 59 | A |CompletionItem| object containing trigger, replacement, annotation, and 60 | kind metadata 61 | 62 | ```python 63 | return [ 64 | sublime.CompletionItem( 65 | "fn", 66 | annotation="def", 67 | completion="def ${1:name}($2) { $0 }", 68 | completion_format=sublime.COMPLETION_FORMAT_SNIPPET, 69 | kind=sublime.KIND_SNIPPET 70 | ), 71 | sublime.CompletionItem( 72 | "for", 73 | completion="for ($1; $2; $3) { $0 }", 74 | completion_format=sublime.COMPLETION_FORMAT_SNIPPET, 75 | kind=sublime.KIND_SNIPPET 76 | ), 77 | ] 78 | ``` 79 | 80 | 81 | -------------------------------------------------------------------------------- 82 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/textcommand.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.TextCommand Class" date="2020-05-06" 2 | 3 | 4 | # textcommand:TextCommand Class 5 | =================== 6 | 7 | TextCommands are instantiated once per view. The View object may be retrieved 8 | via `self.view` 9 | 10 | This class is contained in the |sublime_plugin| module. 11 | 12 | 13 | *TextCommand.run*(edit, ) 14 | Returns: None 15 | 16 | Called when the command is run. 17 | 18 | 19 | *TextCommand.is_enabled*() 20 | Returns: bool 21 | 22 | Returns `True` if the command is able to be run at this time. The default 23 | implementation simply always returns `True`. 24 | 25 | 26 | *TextCommand.is_visible*() 27 | Returns: bool 28 | 29 | Returns `True` if the command should be shown in the menu at this time. The 30 | default implementation always returns `True`. 31 | 32 | 33 | *TextCommand.is_checked*() `[UNDOCUMENTED]` 34 | Returns: bool 35 | 36 | Returns `True` if a checkbox should be shown next to the menu item. The 37 | `.sublime-menu` file must have the checkbox attribute set to `true` for 38 | this to be used. 39 | 40 | 41 | *TextCommand.description*() 42 | Returns: str 43 | 44 | Returns a description of the command with the given arguments. Used in the 45 | menus, and for Undo / Redo descriptions. Return `None` to get the default 46 | description. 47 | 48 | 49 | *TextCommand.want_event*() 50 | Returns: bool 51 | 52 | Return `True` to receive an `event` argument when the command is triggered 53 | by a mouse action. The event information allows commands to determine which 54 | portion of the view was clicked on. The default implementation returns 55 | `False`. 56 | 57 | 58 | *TextCommand.input*() `[>=3154]` 59 | Returns: |CommandInputHandler| or None 60 | 61 | If this returns something other than None, the user will be prompted for an 62 | input before the command is run in the Command Palette. 63 | 64 | 65 | *TextCommand.input_description*() `[>=3154]` 66 | Returns: |CommandInputHandler| or None 67 | 68 | Allows a custom name to be show to the left of the cursor in the input box, 69 | instead of the default one generated from the command name 70 | 71 | 72 | -------------------------------------------------------------------------------- 73 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/completionlist.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.CompletionList Class" date="2020-05-19" 2 | 3 | 4 | # completionlist:CompletionList Class 5 | ====================== 6 | 7 | Represents a list of completions, some of which may be in the process of being 8 | asynchronously fetched. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | Availability: `[>=4050]` 13 | 14 | 15 | ## _none:Constructors 16 | --------------- 17 | 18 | *completionlist_constructor:CompletionList*(, ) 19 | 20 | * `completions` 21 | An optional list of |:completion:completion values|. If `None` is passed, the method 22 | |:completionlist.set_completions:set_completions()| must be called before the completions will be displayed 23 | to the user. 24 | 25 | * `flags` 26 | A bitwise OR of: 27 | 28 | * `sublime.INHIBIT_WORD_COMPLETIONS` 29 | prevent Sublime Text from showing completions based on the contents 30 | of the view 31 | 32 | * `sublime.INHIBIT_EXPLICIT_COMPLETIONS` 33 | prevent Sublime Text from showing completions based on 34 | `.sublime-completions` files 35 | 36 | * `sublime.DYNAMIC_COMPLETIONS` `[>=4057]` 37 | if completions should be re-queried as the user types 38 | 39 | * `sublime.INHIBIT_REORDER` `[>=4074]` 40 | prevent Sublime Text from changing the completion order 41 | 42 | 43 | ## _none:Methods 44 | ---------- 45 | 46 | *completionlist.set_completions*(completions, ) 47 | Returns: None 48 | 49 | Sets the list of completions, allowing the list to be displayed to the 50 | user. 51 | 52 | The parameter flags may be a bitwise OR of: 53 | 54 | * `sublime.INHIBIT_WORD_COMPLETIONS` 55 | prevent Sublime Text from showing completions based on the contents 56 | of the view 57 | 58 | * `sublime.INHIBIT_EXPLICIT_COMPLETIONS` 59 | prevent Sublime Text from showing completions based on 60 | `.sublime-completions` files 61 | 62 | * `sublime.DYNAMIC_COMPLETIONS` `[>=4057]` 63 | if completions should be re-queried as the user types 64 | 65 | * `sublime.INHIBIT_REORDER` `[>=4074]` 66 | prevent Sublime Text from changing the completion order 67 | 68 | 69 | -------------------------------------------------------------------------------- 70 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/selection.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Selection Class" date="2020-05-06" 2 | 3 | 4 | # selection:Selection Class 5 | ================= 6 | 7 | Maintains a set of Regions, ensuring that none overlap. The regions are kept in 8 | sorted order. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | 13 | *selection.__len__*() `[UNDOCUMENTED]` 14 | Returns: int 15 | 16 | Returns the number of selection `Regions` that exist in this selection 17 | object. Always >= 0. 18 | 19 | 20 | *selection.__getitem__*(index) `[UNDOCUMENTED]` 21 | Returns: |Region| 22 | 23 | Returns the `Region` that represents the selection at the given index. 24 | 25 | 26 | *selection.__delitem__*(index) `[UNDOCUMENTED]` 27 | Returns: None 28 | 29 | Removes the selection `Region` at the given index, removing the caret that 30 | is associated with that selection. 31 | 32 | 33 | *selection.__eq__*(rhs) `[UNDOCUMENTED]` 34 | Returns: value 35 | 36 | Determines if this list of selection regions is identical the list of 37 | selection regions provided in `rhs`. 38 | 39 | 40 | *selection.__lt__*(rhs) `[UNDOCUMENTED]` 41 | Returns: value 42 | 43 | Determines if this list of selections is lexically ordered prior to the 44 | list of selection regions in `rhs`. 45 | 46 | 47 | *selection.__bool__*() `[UNDOCUMENTED]` 48 | Returns: bool 49 | 50 | Returns `True` if the |:view.id:view.id()| of this selection is not 0 or `False` 51 | otherwise. 52 | 53 | 54 | *selection.clear*() 55 | Returns: None 56 | 57 | Removes all regions. 58 | 59 | 60 | *selection.add*(region) 61 | Returns: None 62 | 63 | Adds the given `region`. It will be merged with any intersecting regions 64 | already contained within the set. 65 | 66 | 67 | *selection.add_all*(regions) 68 | Returns: None 69 | 70 | Adds all regions in the given `list` or `tuple`. 71 | 72 | 73 | *selection.subtract*(region) 74 | Returns: None 75 | 76 | Subtracts the `region` from all regions in the set. 77 | 78 | 79 | *selection.contains*(region) 80 | Returns: bool 81 | 82 | Returns True iff the given `region` is a subset. 83 | 84 | 85 | *selection.is_valid*() `[UNDOCUMENTED]` 86 | Returns: bool 87 | 88 | Returns a boolean indicating if this selection object is valid or not. A 89 | selection becomes invalid if it is no longer attached to a buffer. 90 | 91 | 92 | -------------------------------------------------------------------------------- 93 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/textinputhandler.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.TextInputHandler Class" date="2020-05-06" 2 | 3 | 4 | # textinputhandler:TextInputHandler Class 5 | ======================== 6 | 7 | TextInputHandlers can be used to accept textual input in the Command Palette. 8 | Return a subclass of this from the `input()` method of a command. 9 | 10 | This class is contained in the |sublime_plugin| module. 11 | 12 | Availability: `[>=3154]` 13 | 14 | 15 | *TextInputHandler.name*() 16 | Returns: str 17 | 18 | The command argument name this input handler is editing. Defaults to 19 | `foo_bar` for an input handler named `FooBarInputHandler` 20 | 21 | 22 | *TextInputHandler.placeholder*() 23 | Returns: str 24 | 25 | Placeholder text is shown in the text entry box before the user has entered 26 | anything. Empty by default. 27 | 28 | 29 | *TextInputHandler.initial_text*() 30 | Returns: str 31 | 32 | Initial text shown in the text entry box. Empty by default. 33 | 34 | 35 | *TextInputHandler.preview*(text) 36 | Returns: str or sublime.Html 37 | 38 | Called whenever the user changes the text in the entry box. The returned 39 | value (either plain text or HTML) will be shown in the preview area of the 40 | Command Palette. 41 | 42 | 43 | *TextInputHandler.validate*(text) 44 | Returns: bool 45 | 46 | Called whenever the user presses enter in the text entry box. Return 47 | `False` to disallow the current value. 48 | 49 | 50 | *TextInputHandler.cancel*() 51 | Returns: None 52 | 53 | Called when the input handler is canceled, either by the user pressing 54 | backspace or escape. 55 | 56 | 57 | *TextInputHandler.confirm*(text) 58 | Returns: None 59 | 60 | Called when the input is accepted, after the user has pressed enter and the 61 | text has been validated. 62 | 63 | 64 | *TextInputHandler.next_input*() 65 | Returns: |CommandInputHandler| or None 66 | 67 | Returns the next input after the user has completed this one. May return 68 | `None` to indicate no more input is required, or 69 | `sublime_plugin.BackInputHandler()` to indicate that the input handler 70 | should be popped off the stack instead. 71 | 72 | 73 | *TextInputHandler.description*(text) 74 | Returns: str 75 | 76 | The text to show in the Command Palette when this input handler is not at 77 | the top of the input handler stack. Defaults to the text the user entered. 78 | 79 | 80 | -------------------------------------------------------------------------------- 81 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SnAPI 2 | ===== 3 | 4 | SnAPI is a simple package that provides a local copy of the Sublime Text 5 | [documentation](http://www.sublimetext.com/docs/) directly 6 | from within Sublime, using the [hyperhelp](https://github.com/STealthy-and-haSTy/hyperhelpcore) 7 | help system for navigation. 8 | 9 | > ***Note:*** Currently only the Sublime Text API, build system and color 10 | > theme documentation is in place in SnAPI. Other reference help from the 11 | > official documentation set is still forthcoming. 12 | 13 | SnAPI is pronounced "Snappy", as having API documentation readily available from 14 | directly within Sublime keeps you focused on your coding. Also it was a name 15 | suggested to me that stuck in my head. Please blame @kingkeith for suggesting 16 | the name and my brain for latching onto it so completely. 17 | 18 | Also, please note that all help text and documentation is taken directly from 19 | the above linked official API reference and is Copyright © Sublime HQ Pty Ltd. 20 | 21 | ------------------------------------------------------------------------------- 22 | 23 | 24 | **NOTE:** Although there is only help contained within the package, it is still 25 | in active development and as such everything is subject to change. 26 | 27 | 28 | ------------------------------------------------------------------------------- 29 | 30 | 31 | ## License ## 32 | 33 | Note that the license below *DOES NOT* include any of the help files, which are 34 | taken from the official Sublime Text documentation at 35 | http://www.sublimetext.com/docs/ and are Copyright © Sublime HQ Pty Ltd. 36 | 37 | All other content in this package are licensed under the MIT License: 38 | 39 | Copyright 2017-2020 Terence Martin 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining a copy of 42 | this software and associated documentation files (the "Software"), to deal in 43 | the Software without restriction, including without limitation the rights to 44 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 45 | of the Software, and to permit persons to whom the Software is furnished to do 46 | so, subject to the following conditions: 47 | 48 | The above copyright notice and this permission notice shall be included in all 49 | copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 57 | SOFTWARE. 58 | -------------------------------------------------------------------------------- /api/listinputhandler.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.ListInputHandler Class" date="2020-05-06" 2 | 3 | 4 | # listinputhandler:ListInputHandler Class 5 | ======================== 6 | 7 | ListInputHandlers can be used to accept a choice input from a list items in the 8 | Command Palette. Return a subclass of this from the `input()` method of a 9 | command. 10 | 11 | This class is contained in the |sublime_plugin| module. 12 | 13 | Availability: `[>=3154]` 14 | 15 | 16 | *ListInputHandler.name*() 17 | Returns: str 18 | 19 | The command argument name this input handler is editing. Defaults to 20 | `foo_bar` for an input handler named `FooBarInputHandler` 21 | 22 | 23 | *ListInputHandler.list_items*() 24 | Returns: [str] or [(str, |value|)] 25 | 26 | The items to show in the list. If returning a list of (str, value) tuples, 27 | then the str will be shown to the user, while the value will be used as the 28 | command argument. 29 | 30 | Optionally return a tuple of (list_items, selected_item_index) to indicate 31 | an initial selection. 32 | 33 | 34 | *ListInputHandler.placeholder*() 35 | Returns: str 36 | 37 | Placeholder text is shown in the text entry box before the user has entered 38 | anything. Empty by default. 39 | 40 | 41 | *ListInputHandler.initial_text*() 42 | Returns: str 43 | 44 | Initial text shown in the text entry box. Empty by default. 45 | 46 | 47 | *ListInputHandler.preview*(text, ) 48 | Returns: str or sublime.Html 49 | 50 | Called whenever the user changes the text in the entry box. The returned 51 | value (either plain text or HTML) will be shown in the preview area of the 52 | Command Palette. 53 | 54 | The `value` argument will be provided when |:listinputhandler.list_items:list_items()| returns a list of 55 | tuples; otherwise it is not given. 56 | 57 | 58 | *ListInputHandler.validate*(text) 59 | Returns: bool 60 | 61 | Called whenever the user presses enter in the text entry box. Return False 62 | to disallow the current value. 63 | 64 | 65 | *ListInputHandler.cancel*() 66 | Returns: None 67 | 68 | Called when the input handler is canceled, either by the user pressing 69 | backspace or escape. 70 | 71 | 72 | *ListInputHandler.confirm*(text) 73 | Returns: None 74 | 75 | Called when the input is accepted, after the user has pressed enter and the 76 | text has been validated. 77 | 78 | 79 | *ListInputHandler.next_input*() 80 | Returns: |CommandInputHandler| or None 81 | 82 | Returns the next input after the user has completed this one. May return 83 | `None` to indicate no more input is required, or 84 | `sublime_plugin.BackInputHandler()` to indicate that the input handler 85 | should be popped off the stack instead. 86 | 87 | 88 | *ListInputHandler.description*(value, text) 89 | Returns: str 90 | 91 | The text to show in the Command Palette when this input handler is not at 92 | the top of the input handler stack. Defaults to the text the user entered. 93 | 94 | 95 | -------------------------------------------------------------------------------- 96 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/region.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Region Class" date="2020-05-05" 2 | 3 | 4 | # region:Region Class 5 | ============== 6 | 7 | Represents an area of the buffer. Empty regions, where `a == b` are valid. 8 | 9 | This class is contained in the |sublime| module. 10 | 11 | 12 | ## _none:Constructors 13 | --------------- 14 | 15 | *region_constructor:Region*(a, , ) 16 | 17 | Creates a Region with initial values `a` and `b`. If `b` is not specified, 18 | it defaults to `a`. 19 | 20 | 21 | ## _none:Properties 22 | ------------- 23 | 24 | *region.a* 25 | Type: int 26 | 27 | The first end of the region. 28 | 29 | 30 | *region.b* 31 | Type: int 32 | 33 | The second end of the region. May be less that a, in which case the region 34 | is a reversed one. 35 | 36 | 37 | *region.xpos* 38 | Type: int 39 | 40 | The target horizontal position of the region, or `-1` if undefined. Effects 41 | behavior when pressing the up or down keys. 42 | 43 | 44 | *|_none:Methods|* 45 | ------- 46 | 47 | *region.__str__*() `[UNDOCUMENTED]` 48 | Returns: string 49 | 50 | Returns an "informal", nicely printable string representation of the 51 | region. 52 | 53 | 54 | *region.__repr__*() `[UNDOCUMENTED]` 55 | Returns: string 56 | 57 | Returns an "official" string representation of the region. 58 | 59 | 60 | *region.__len__*() `[UNDOCUMENTED]` 61 | Returns: int 62 | 63 | Returns the number of characters spanned by the region. Always >= 0. 64 | 65 | 66 | *region.__eq__*(rhs) `[UNDOCUMENTED]` 67 | Returns: value 68 | 69 | Determines if `rhs` is also a `Region` and, if so, if it spans the same 70 | region that this region spans. 71 | 72 | 73 | *region.__lt__*(rhs) `[UNDOCUMENTED]` 74 | Returns: value 75 | 76 | Determines if this region starts before or ends before the region in `rhs`. 77 | 78 | 79 | *region.begin*() 80 | Returns: int 81 | 82 | Returns the minimum of a and b. 83 | 84 | 85 | *region.end*() 86 | Returns: int 87 | 88 | Returns the maximum of a and b. 89 | 90 | 91 | *region.size*() 92 | Returns: int 93 | 94 | Returns the number of characters spanned by the region. Always >= 0. 95 | 96 | 97 | *region.empty*() 98 | Returns: bool 99 | 100 | Returns `True` iff `begin()` == `end()`. 101 | 102 | 103 | *region.cover*(region) 104 | Returns: |Region| 105 | 106 | Returns a Region spanning both this and the given regions. 107 | 108 | 109 | *region.intersection*(region) 110 | Returns: |Region| 111 | 112 | Returns the set intersection of the two regions. 113 | 114 | 115 | *region.intersects*(region) 116 | Returns: bool 117 | 118 | Returns `True` iff self == `region` or both include one or more positions in 119 | common. 120 | 121 | 122 | *region.contains*(region) 123 | Returns: bool 124 | 125 | Returns `True` iff the given `region` is a subset. 126 | 127 | 128 | *_none:region.contains*(point) 129 | Returns: bool 130 | 131 | Returns `True` iff `begin()` <= `point` <= `end()`. 132 | 133 | 134 | -------------------------------------------------------------------------------- 135 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/completion_kind.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="completion_kind Tuple" date="2020-05-06" 2 | 3 | 4 | # completion_kind:completion_kind Tuple 5 | ======================= 6 | 7 | Metadata about the kind of a |CompletionItem|. Controls the color and letter 8 | shown in the "icon" presented to the left of the trigger. 9 | 10 | Options include pre-constructed combinations, or completely custom values. 11 | 12 | Availability: `[>=4050]` 13 | 14 | 15 | ## _none:Pre-constructed options 16 | -------------------------- 17 | 18 | *sublime.KIND_AMBIGUOUS* 19 | Letter: none, theme class: `kind_ambiguous` 20 | 21 | When there source of the completion is unknown – the default. 22 | 23 | 24 | *sublime.KIND_KEYWORD* 25 | Letter: `k`, theme class: `kind_keyword` 26 | 27 | When the completion represents a keyword. 28 | 29 | 30 | *sublime.KIND_TYPE* 31 | Letter: `t`, theme class: `kind_type` 32 | 33 | When the completion represents a data type, class, struct, interface, enum, 34 | trait, etc. 35 | 36 | *sublime.KIND_FUNCTION* 37 | Letter: `f`, theme class: `kind_function` 38 | 39 | When the completion represents a function, method, constructor or 40 | subroutine. 41 | 42 | 43 | *sublime.KIND_NAMESPACE* 44 | Letter: `a`, theme class: `kind_namespace` 45 | 46 | When the completion represents a namespace or module. 47 | 48 | 49 | *sublime.KIND_NAVIGATION* 50 | Letter: `n`, theme class: `kind_navigation` 51 | 52 | When the completion represents a definition, label or section. 53 | 54 | 55 | *sublime.KIND_MARKUP* 56 | Letter: `m`, theme class: `kind_markup` 57 | 58 | When the completion represents a markup component, including HTML tags and 59 | CSS selectors. 60 | 61 | 62 | *sublime.KIND_VARIABLE* 63 | Letter: `v`, theme class: `kind_variable` 64 | 65 | When the completion represents a variable, member, attribute, constant or 66 | parameter. 67 | 68 | 69 | *sublime.KIND_SNIPPET* 70 | Letter: `s`, theme class: `kind_snippet` 71 | 72 | When the completion contains a snippet. 73 | 74 | 75 | ## _none:Custom Kinds 76 | --------------- 77 | 78 | Custom kind information may also be passed, via a 3-element tuple, in the 79 | following format: 80 | 81 | 82 | ## _none:kind id 83 | ---------- 84 | 85 | A kind id, which controls the theme class used to contain the letter: 86 | 87 | *sublime.KIND_ID_AMBIGUOUS* 88 | When there source of the completion is unknown 89 | 90 | *sublime.KIND_ID_KEYWORD* 91 | When the completion represents a keyword 92 | 93 | *sublime.KIND_ID_TYPE* 94 | When the completion represents a data type 95 | 96 | *sublime.KIND_ID_FUNCTION* 97 | When the completion represents a function, method, constructor or 98 | subroutine 99 | 100 | *sublime.KIND_ID_NAMESPACE* 101 | When the completion represents a namespace or module 102 | 103 | *sublime.KIND_ID_NAVIGATION* 104 | When the completion represents a definition, label or section 105 | 106 | *sublime.KIND_ID_MARKUP* 107 | When the completion represents a markup component, including HTML tags 108 | and CSS selectors 109 | 110 | *sublime.KIND_ID_VARIABLE* 111 | When the completion represents a variable, member, attribute, constant 112 | or parameter 113 | 114 | *sublime.KIND_ID_SNIPPET* 115 | When the completion contains a snippet 116 | 117 | 118 | ## _none:letter 119 | --------- 120 | 121 | A unicode string containing a single unicode character. This is shown as an 122 | "icon" to the left of the `trigger`. 123 | 124 | 125 | ## _none:description 126 | -------------- 127 | 128 | An optional unicode string to describe the kind, shown in the detail pane 129 | at the bottom of the auto-complete window. 130 | 131 | 132 | -------------------------------------------------------------------------------- 133 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/completionitem.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.CompletionItem Class" date="2020-05-06" 2 | 3 | 4 | # completionitem_class:CompletionItem Class 5 | ====================== 6 | 7 | Represents an available auto-completion item. 8 | 9 | This class is contained in the |sublime| module. 10 | 11 | Availability: `[>=4050]` 12 | 13 | 14 | ## _none:Constructors 15 | --------------- 16 | 17 | *CompletionItem*(trigger, , , , 18 | ,
) 19 | 20 | * `trigger` 21 | A unicode string of the text to match against the user's input. 22 | 23 | * `annotation` 24 | An optional unicode string of a hint to draw to the right-hand side of the 25 | trigger. 26 | 27 | * `completion` 28 | An optional unicode string of the text to insert if the completion is 29 | specified. If empty, the `trigger` will be inserted. 30 | 31 | * `completion_format` 32 | The format of the `completion`: 33 | 34 | * `sublime.COMPLETION_FORMAT_TEXT` 35 | Plain text – the default 36 | 37 | * `sublime.COMPLETION_FORMAT_SNIPPET` 38 | A snippet, with `$` variables. See also the 39 | |:completionitem.snippet_completion:CompletionItem.snippet_completion()| class method. 40 | 41 | * `sublime.COMPLETION_FORMAT_COMMAND` 42 | A command name, optionally followed by space and args encoded via 43 | |:encode_value:encode_value()|. E.g. 44 | `my_command {"repeat": 2, "value": "ABC"}`. 45 | 46 | See also the |:completionitem.command_completion:CompletionItem.command_completion()| class method. 47 | 48 | * `kind` 49 | An optional |completion_kind| tuple that controls the presentation in the 50 | auto-complete window – defaults to `sublime.KIND_AMBIGUOUS`. 51 | 52 | * `details` `[>=4073]` 53 | An optional HTML description of the completion, shown in the detail pane at 54 | the bottom of the auto complete window. Only supports limited inline HTML, 55 | including the tags: 56 | 57 | * `` - |:minihtml protocols:protocols| 58 | * `` 59 | * `` 60 | * `` 61 | * `` 62 | * `` 63 | * `` 64 | * `` 65 | 66 | 67 | *CompletionItem.snippet_completion*(trigger, snippet, , , 68 |
) 69 | 70 | * `trigger` 71 | A unicode string of the text to match against the user's input. 72 | 73 | * `snippet` 74 | The snippet text to insert if the item is selected. 75 | 76 | * `annotation` 77 | An optional unicode string of a hint to draw to the right-hand side of the 78 | trigger. 79 | 80 | * `kind` 81 | An optional |completion_kind| tuple that controls the presentation in the 82 | auto-complete window – defaults to `sublime.KIND_SNIPPET`. 83 | 84 | * `details` `[>=4073]` 85 | An optional HTML description of the completion, shown in the detail pane at 86 | the bottom of the auto complete window. Only supports limited inline HTML, 87 | including the tags: 88 | 89 | * `` - |:minihtml protocols:protocols| 90 | * `` 91 | * `` 92 | * `` 93 | * `` 94 | * `` 95 | * `` 96 | * `` 97 | 98 | 99 | *CompletionItem.command_completion*(trigger, command, , , 100 | ,
) 101 | 102 | * `trigger` 103 | A unicode string of the text to match against the user's input. 104 | 105 | * `command` 106 | A unicode string of the command to execute 107 | 108 | * `args` 109 | An optional `dict` of args to pass to the `command` 110 | 111 | * `annotation` 112 | An optional unicode string of a hint to draw to the right-hand side of the 113 | trigger. 114 | 115 | * `kind` 116 | An optional |completion_kind| tuple that controls the presentation in the 117 | auto-complete window – defaults to `sublime.KIND_AMBIGUOUS`. 118 | 119 | * `details` `[>=4073]` 120 | An optional HTML description of the completion, shown in the detail pane at 121 | the bottom of the auto complete window. Only supports limited inline HTML, 122 | including the tags: 123 | 124 | * `` - |:minihtml protocols:protocols| 125 | * `` 126 | * `` 127 | * `` 128 | * `` 129 | * `` 130 | * `` 131 | * `` 132 | 133 | 134 | -------------------------------------------------------------------------------- 135 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/general.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="General Information" date="2020-05-06" 2 | 3 | 4 | # Example Plugins 5 | ================= 6 | 7 | Several pre-made plugins come with Sublime Text, you can find them in the 8 | Default package: 9 | 10 | |Packages/Default/exec.py| 11 | Uses phantoms to display errors inline 12 | |Packages/Default/font.py| 13 | Shows how to work with settings 14 | |Packages/Default/goto_line.py| 15 | Prompts the user for input, then updates the selection 16 | |Packages/Default/mark.py| 17 | Uses `add_regions()` to add an icon to the gutter 18 | |Packages/Default/show_scope_name.py| 19 | Uses a popup to show the scope names at the caret 20 | |Packages/Default/arithmetic.py| 21 | Accepts an input from the user when run via the Command Palette 22 | 23 | 24 | -------------------------------------------------------------------------------- 25 | 26 | 27 | # Plugin Lifecycle 28 | ================== 29 | 30 | At importing time, plugins may not call any API functions, with the exception 31 | of `sublime.version()`, `sublime.platform()`, `sublime.arch()` and 32 | `sublime.channel()`. 33 | 34 | If a plugin defines a module level function `plugin_loaded()`, this will be 35 | called when the API is ready to use. Plugins may also define 36 | `plugin_unloaded()`, to get notified just before the plugin is unloaded. 37 | 38 | 39 | -------------------------------------------------------------------------------- 40 | 41 | 42 | # Threading 43 | =========== 44 | 45 | All API functions are thread-safe, however keep in mind that from the 46 | perspective of code running in an alternate thread, application state will be 47 | changing while the code is running. 48 | 49 | 50 | -------------------------------------------------------------------------------- 51 | 52 | 53 | # Units and Coordinates 54 | ======================= 55 | 56 | API functions that accept or return coordinates or dimensions do so using 57 | device-independent pixel (dip) values. While in some cases these will be 58 | equivalent to device pixels, this is often not the case. Per the CSS 59 | specification, |minihtml| treats the `px` unit as device-independent. 60 | 61 | 62 | -------------------------------------------------------------------------------- 63 | 64 | 65 | # Types 66 | ======= 67 | 68 | This documentation generally refers to simply Python data types. Some type 69 | names are classes documented herein, however there are also a few custom type 70 | names that refer to construct with specific semantics: 71 | 72 | * *location* 73 | a tuple of `(str, str, (int, int))` that contains information about a 74 | location of a symbol. The first string is the absolute file path, the 75 | second is the file path relative to the project, the third element is a 76 | two-element tuple of the row and column. 77 | 78 | * *point* 79 | an `int` that represents the offset from the beginning of the editor 80 | buffer. The `View` methods `text_point()` and `rowcol()` allow converting 81 | to and from this format. 82 | 83 | * *value* 84 | any of the Python data types `bool`, `int`, `float`, `str`, `list` or 85 | `dict`. 86 | 87 | * *dip* 88 | a `float` that represents a device-independent pixel. 89 | 90 | * *vector* 91 | a tuple of `(dip, dip)` representing `x` and `y` coordinates. 92 | 93 | * *CommandInputHandler* 94 | a subclass of either |TextInputHandler| or |ListInputHandler|. 95 | 96 | * *symbolref* `[UNDOCUMENTED]` 97 | a tuple of `((int, int), string)` that contains information on indexed 98 | symbols in a |view|. The string contains the text of the indexed symbol and 99 | the tuple provides the location of that symbol in the file. 100 | 101 | * *resultref* `[UNDOCUMENTED]` 102 | a tuple of `(string, int, int, )` that contains information about 103 | the result of a regular expression match as a result of using the 104 | `result_file_regex` and `result_line_regex` settings in a |view|. 105 | 106 | The first string is the absolute file path of the file containing the match 107 | and the integers represent the row and column of the match in that file. 108 | 109 | The second string is optional and provides the text that matched the regex 110 | capture for the fourth capture in `result_file_regex` or the third capture 111 | in `result_line_regex`. This value is only a part of the result when you 112 | use |:view.find_all_results_with_text:view.find_all_results_with_text()|. 113 | 114 | 115 | -------------------------------------------------------------------------------- 116 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /colorscheme/rules.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Scope Rules" date="2020-07-28" 2 | 3 | 4 | Color schemes interact with the text in a file via scopes. Scopes are set to 5 | code or prose tokens via the syntax. Scopes are dotted strings, specified from 6 | least-to-most specific. For example, the `if` keyword in PHP could be specified 7 | via the scope name `keyword.control.php`. 8 | 9 | 10 | # Matching 11 | ---------- 12 | 13 | Color schemes apply colors and font styles to the scopes by matching the dotted 14 | labels, starting with the first. Prefix matching is the standard way to have a 15 | color scheme apply to multiple syntaxes. 16 | 17 | Instead of matching `keyword.control.php`, most color schemes will instead 18 | assign a color to `keyword`. Matching the first one or two labels in a scope is 19 | most common. Including the final label, the syntax name, is uncommon unless a 20 | syntax-specific override is desired. 21 | 22 | 23 | # Naming 24 | -------- 25 | 26 | Author of syntaxes can assign whatever scopes they want to a given token. This 27 | combined with the fact that there are hundreds of community-maintained syntaxes 28 | means that is can be hard to know what scopes to target. 29 | 30 | The |official Scope Naming guidelines| were established to help syntax and 31 | color scheme authors use a common set, for better interoperability. The 32 | |Usage in Color Schemes| section provides a baseline set of scopes that color 33 | scheme authors should strive to handle. 34 | 35 | 36 | # Style Rules 37 | ------------- 38 | 39 | Each scope style rule consists of an object containing a `"scope"` key, along 40 | with one or more of the following optional keys: 41 | 42 | * `name` 43 | the (arbitrary) name for the scope rule 44 | 45 | 46 | * `foreground` 47 | the text color 48 | 49 | 50 | * `background` 51 | the background color 52 | 53 | 54 | * `foreground_adjust` `[>=3179]` 55 | adjustment to the `foreground` color, only valid with `background` 56 | 57 | 58 | * `selection_foreground` 59 | the text color when selected 60 | 61 | 62 | * `font_style` 63 | zero or more of the following, separated by spaces: 64 | 65 | * `bold` 66 | *`italic` 67 | *`glow` `[>=4050]` 68 | *`underline` `[>=4074]` 69 | *`stippled_underline` `[>=4075]` 70 | *`squiggly_underline` `[>=4075]` 71 | 72 | 73 | The `foreground_adjust` key accepts a space-separated list of adjusters that 74 | are supported by the |minihtml color() mod function|. It is only supported when 75 | the `background` key is also specified, and thus allows modifying all 76 | foregrounds used in combination with the background, without having to create 77 | different rules for every permutation. 78 | 79 | 80 | # Hashed Syntax Highlighting 81 | ---------------------------- 82 | 83 | The `foreground` key supports a special mode called `Hashed Syntax 84 | Highlighting`, where each token matching the scope specified will receive a 85 | unique color from one, or more, gradients. Some editors refer to this style of 86 | highlighting as `Semantic Highlighting`. 87 | 88 | To use Hashed Syntax Highlighting, the `foreground` key must have a value that 89 | is a list of two or more colors. Sublime Text will create 256 different colors 90 | that are linear interpolations (lerp) between the colors provided. The 91 | interpolation is done in HSL space. 92 | 93 | As Sublime Text highlights the tokens in a file, it will create a hashed value 94 | of the token, and use that to pick one of the 256 linear interpolations. Every 95 | instance of a given token will use the same color. For instance, each instance 96 | of `first_name` would have the same color, but every instance of `name` would 97 | have a different color. 98 | 99 | For Hashed Syntax Highlighting to be most obvious, the hue difference between 100 | the start and end points should be as far apart as possible. Here is an example 101 | of using blues, purples and pinks for variable names: 102 | 103 | ```json 104 | { 105 | "scope": "source - punctuation - keyword", 106 | "foreground": ["hsl(200, 60%, 70%)", "hsl(330, 60%, 70%)"] 107 | } 108 | ``` 109 | 110 | 111 | # Examples 112 | ---------- 113 | 114 | The following scope style rule will color all strings as green: 115 | 116 | ```json 117 | { 118 | "name": "Strings", 119 | "scope": "string", 120 | "foreground": "#00FF00" 121 | } 122 | ``` 123 | 124 | To style all numbers as bold, italic red, use: 125 | 126 | ```json 127 | { 128 | "name": "Numbers", 129 | "scope": "constant.numeric", 130 | "foreground": "#FF0000", 131 | "font_style": "bold italic" 132 | } 133 | ``` 134 | 135 | 136 | -------------------------------------------------------------------------------- 137 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /SnAPI.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | 4 | import os 5 | 6 | import hyperhelpcore 7 | from hyperhelpcore.core import help_index_list, lookup_help_topic 8 | 9 | 10 | ###---------------------------------------------------------------------------- 11 | 12 | 13 | _scope_map = { 14 | # Default scope. 15 | "source.python": "SublimeAPI", 16 | 17 | # Enhanced scopes provided by PackageDev; Sublime packages use source.json 18 | # which is not unique enough. 19 | "source.json.sublime.build": "SublimeBuild", 20 | "source.json.sublime.color-scheme": "SublimeColorScheme" 21 | } 22 | 23 | _extension_map = { 24 | ".py": "SublimeAPI", 25 | 26 | ".sublime-build": "SublimeBuild", 27 | ".sublime-color-scheme": "SublimeColorScheme" 28 | } 29 | 30 | 31 | ###---------------------------------------------------------------------------- 32 | 33 | 34 | def plugin_loaded(): 35 | """ 36 | Ensure that hyperhelp is initialized at startup. 37 | """ 38 | hyperhelpcore.initialize() 39 | 40 | 41 | ###---------------------------------------------------------------------------- 42 | 43 | 44 | def _word_under_cursor(view): 45 | """ 46 | Get the word under the cursor, if possible. The caret must be either in a 47 | word or at the start of a word boundary for this to work; if the caret is 48 | anywhere else, no word will be returned. 49 | 50 | This uses the word separators from the view settings in the given view but 51 | also adds in whitespace characters, since those also separate words but are 52 | generally not included in the setting. 53 | """ 54 | if len(view.sel()) == 1: 55 | word_class = sublime.CLASS_WORD_START | sublime.CLASS_WORD_END 56 | sep = view.settings().get("word_separators", "") + " \t\n" 57 | 58 | pt = view.sel()[0].begin() 59 | pt_class = view.classify(pt) 60 | 61 | if view.substr(pt) in sep: 62 | return None 63 | 64 | if pt_class & sublime.CLASS_WORD_START == 0: 65 | word = view.expand_by_class(pt, word_class, sep) 66 | else: 67 | if view.substr(pt+1) in sep: 68 | word = sublime.Region(pt, pt + 1) 69 | else: 70 | word = view.expand_by_class(pt + 1, word_class, sep) 71 | 72 | return view.substr(word) 73 | 74 | return None 75 | 76 | 77 | class SnapiLookupCommand(sublime_plugin.TextCommand): 78 | """ 79 | Open the SnAPI index to browse topics. 80 | 81 | Attempts to open the appropriate help topic or package based on the type of 82 | file being edited and the current selection or text under the cursor. 83 | """ 84 | def run(self, edit): 85 | pkg_name = self.pkg_for_file() 86 | 87 | # For unknown files, open the default topic for a default package. 88 | # 89 | # TODO: Should be user configurable? 90 | if pkg_name is None: 91 | return sublime.run_command( 92 | "hyperhelp_topic", {"package": "SublimeAPI"}) 93 | 94 | # Get the help index for the type of file currently focused. 95 | pkg_info = help_index_list().get(pkg_name) 96 | 97 | # Get an initial topic; the selected text or the word under the cursor. 98 | extract = self.view.sel()[0] 99 | if extract.empty(): 100 | topic = _word_under_cursor(self.view) 101 | else: 102 | topic = self.view.substr(extract) 103 | 104 | # If the initial topic exists and is unique, open it directly. 105 | if topic and lookup_help_topic(pkg_info, topic): 106 | return sublime.run_command("hyperhelp_topic", { 107 | "package": pkg_info.package, 108 | "topic": topic 109 | }) 110 | 111 | # Open the root of the help package if the topic is empty, or open the 112 | # index popup if it has some text. In the latter case, also use it as 113 | # the default filter so the user can self disambiguate. 114 | sublime.run_command("hyperhelp_index" if topic else "hyperhelp_topic", 115 | {"package": pkg_info.package}) 116 | if topic: 117 | self.view.window().run_command("insert", {"characters": topic}) 118 | 119 | def pkg_for_file(self): 120 | # Use scope if possible to try and catch unsaved files. 121 | for scope, pkg in _scope_map.items(): 122 | if self.view.match_selector(0, scope): 123 | return pkg 124 | 125 | # Fall back to using the extension on the file. 126 | name = self.view.name() or self.view.file_name() or "" 127 | ext = os.path.splitext(name)[1] 128 | 129 | for extension, pkg in _extension_map.items(): 130 | if ext == extension: 131 | return pkg 132 | 133 | # Unrecognized file type 134 | return None 135 | 136 | def is_enabled(self): 137 | pkg = self.pkg_for_file() or "SublimeAPI" 138 | return pkg in help_index_list() 139 | 140 | 141 | ###---------------------------------------------------------------------------- 142 | -------------------------------------------------------------------------------- /colorscheme/colors.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Colors" date="2020-05-19" 2 | 3 | 4 | Colors in color schemes may be specified using one of seven formats: 5 | 6 | * `Hex RGB` 7 | 8 | A `#` followed by six hex characters, with the first two specifying the 9 | red channel, second tow the green channel and the final two the blue 10 | channel. Red is written as `#FF0000`. An abbreviated form is available 11 | when each of the three pairs use the same value for both characters. Red 12 | is written as `#F00`. 13 | 14 | 15 | * `Hex RGBA` 16 | 17 | Same as Hex RGBA, but with an extra pair of hex characters at the end to 18 | specify the alpha channel. Red with 67% opacity is written as 19 | `#FF0000AA`. The abbreviated form would be `#F00A`. 20 | 21 | 22 | * `RGB functional notation` 23 | 24 | A function named `rgb` that accepts three integers in the range 0 to 255. 25 | The first integer specifies the red channel, the second the green channel 26 | and the third the blue channel. Red is written as `rgb(255, 0, 0)`. 27 | 28 | 29 | * `RGBA functional notation` 30 | 31 | Identical to the RGB function format, except the name of the function is 32 | `rgba` and a fourth parameter is added accepting a value from `0.0` to 33 | `1.0` specifying the alpha channel. Red with 50% opacity is written as 34 | `rgba(255, 0, 0, 0.5)`. 35 | 36 | 37 | * `HSL functional notation` 38 | 39 | A function named `hsl` that accepts three values. The first is an integer 40 | in the range `0` to `360` specifying the hue. The second is a percentage 41 | specifying the saturation. The third is a percentage specifying the 42 | lightness. Red is written as `hsl(0, 100%, 50%)`. 43 | 44 | 45 | * `HSLA functional notation` 46 | 47 | Identical to the HSL function format, except the name of the function is 48 | `hsla` and a fourth parameter is added accepting a value from `0.0` to 49 | `1.0` specifying the alpha channel. Red with 50% opacity is written as 50 | `hsla(0, 100%, 50%, 0.5)`. 51 | 52 | 53 | * `HWB functional notation` `[>=3181]` 54 | 55 | A function named `hwb` that accepts three or four values. The first is an 56 | integer in the range `0` to `360` specifying the hue. The second is a 57 | percentage specifying the percentage of white mixed in. The third is a 58 | percentage specifying the black mixed in. The optional fourth parameter 59 | is a value from `0.0` to `1.0` that controls the opacity. Examples 60 | include: h`wb(0, 20%, 20%)` and `hwb(0, 20%, 20%, 0.5)`. 61 | 62 | 63 | * `Named` 64 | 65 | |CSS color names|. Please note that while some share names with X11 66 | named colors used in `.tmTheme` files, the actual colors tend to differ. 67 | 68 | 69 | Additionally, colors may be specified as a |variable|, and then referenced via 70 | the syntax `var(example_var_name)`. Variable references are particularly useful 71 | when combined with the |minihtml color() mod function| and the supported 72 | `blend()`, `blenda()`, `alpha()`, `saturation()`, `lightness()` and 73 | `min- contrast()` adjusters. 74 | 75 | 76 | * `blend() adjuster` 77 | 78 | Blends a color into the base. To blend equal parts grey and a base color 79 | referenced via variable, in RGB space: 80 | `color(var(base_green) blend(#888 50%))` 81 | 82 | If colors should be blended in HSL space, use the following form: 83 | `color(var(base_green) blend(#888 50% hsl))` 84 | 85 | The resulting alpha value is always the alpha channel of the base color. 86 | 87 | 88 | * `blenda() adjuster` 89 | 90 | Functions the same way as the `blend()` adjuster, but blends the alpha 91 | channel of the two colors instead of just using the alpha channel from 92 | the base. An example of the blending a partially transparent grey into a 93 | green: 94 | `color(var(base_green) blenda(#8888 50% hsl))` 95 | 96 | 97 | * `alpha() adjuster` 98 | 99 | Changes the alpha channel of the base color to the value specified, from 100 | `0.0` to `1.0`. Setting the alpha channel to 90%: 101 | `color(var(base_green) alpha(0.9))`. 102 | 103 | A shorthand name of `a()` is also available for this adjuster. 104 | 105 | 106 | * `saturation() adjuster` `[>=3179]` 107 | 108 | Changes the saturation channel of the base color, in the HSL color space, 109 | to the value specified, from `0%` to `100%`. Setting the saturation to 110 | 90%: 111 | `color(var(base_green) saturation(0.9))` 112 | 113 | Increasing the saturation by 10%: 114 | `color(var(base_green) s(+ 10%))` 115 | 116 | A shorthand name of `s()` is also available for this adjuster. 117 | 118 | 119 | * `lightness() adjuster` `[>=3179]` 120 | 121 | Changes the lightness channel of the base color, in the HSL color 122 | space, to the value specified, from `0%` to `100%`. Setting the 123 | lightness to 90%: 124 | `color(var(base_green) lightness(0.9))` 125 | 126 | Decreasing the lightness by 10%: 127 | `color(var(base_green) l(- 10%))` 128 | 129 | A shorthand name of `l()` is also available for this adjuster. 130 | 131 | * `min-contrast() adjuster` `[>=3181]` `[PROPRIETARY]` 132 | 133 | Modifies a color to ensure a minimum contrast ratio against a 134 | "background" color. The first parameter is the color to calculate the 135 | contrast again, the "background", and the second is a decimal number 136 | specifying the minimum contrast ratio. Typical values for the contrast 137 | ratio range from `2.0` to `4.5`. Ensure a contrast ratio of 2.5 against 138 | the background: 139 | `color(var(base_green) min-contrast(var(bg_color) 2.5))` 140 | 141 | 142 | -------------------------------------------------------------------------------- 143 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /colorscheme/global.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="Global Settings" date="2020-05-19" 2 | 3 | 4 | The following global settings go in the object with the `"globals"` key. 5 | 6 | 7 | *background* 8 | 9 | The default background color 10 | 11 | 12 | *foreground* 13 | 14 | The default color for text 15 | 16 | 17 | *invisibles* 18 | 19 | The color for whitespace, when rendered. When not specified, defaults to 20 | `foreground` with an opacity of `0.35`. 21 | 22 | 23 | *caret* 24 | 25 | The color of the caret 26 | 27 | 28 | *block_caret* `[>=3190]` 29 | 30 | The color of the caret when using a block caret 31 | 32 | 33 | *line_highlight* 34 | 35 | The background color of the line containing the caret. Only used when 36 | the `highlight_line` setting is enabled. 37 | 38 | 39 | # Accents 40 | --------- 41 | 42 | *misspelling* 43 | 44 | The color to use for the squiggly underline drawn under misspelled 45 | words. 46 | 47 | 48 | *fold_marker* 49 | 50 | The color to use for the marker that indicates content has been folded. 51 | 52 | 53 | *minimap_border* 54 | 55 | The color of the border drawn around the viewport area of the minimap 56 | when the setting `draw_minimap_border` is enabled. Note that the 57 | viewport is normally only visible on hover, unless the 58 | `always_show_minimap_viewport` setting is enabled. 59 | 60 | 61 | *scroll_highlight* `[>=4050]` 62 | 63 | The color search result positions drawn on top of the scroll bar. 64 | 65 | 66 | *scroll_selected_highlight* `[>=4050]` 67 | 68 | The color of the selected search result position drawn on top of the 69 | scroll bar. 70 | 71 | 72 | *accent* 73 | 74 | A color made available for use by the theme. The Default theme uses 75 | this to highlight modified tabs when the `highlight_modified_tabs` 76 | setting is enabled. 77 | 78 | 79 | # CSS 80 | ----- 81 | 82 | CSS is applied to |minihtml| content created via the popups and phantoms 83 | functionality that is exposed through the API. Supported CSS properties are 84 | discussed in the |minihtml CSS reference|. 85 | 86 | Plugins that use minihtml are encouraged to set a unique `id` attribute on the 87 | `` tag of generated HTML to allow color schemes to override default 88 | plugin styles. 89 | 90 | 91 | *popup_css* 92 | 93 | CSS passed to popups. 94 | 95 | 96 | *phantom_css* 97 | 98 | CSS passed to phantoms. If not specified, uses `popup_css`. 99 | 100 | 101 | *sheet_css* `[>=4050]` 102 | 103 | CSS passed to HTML sheets. 104 | 105 | 106 | # Gutters 107 | --------- 108 | 109 | *gutter* 110 | 111 | The background color of the gutter 112 | 113 | 114 | *gutter_foreground* 115 | 116 | The color of line numbers in the gutter 117 | 118 | 119 | *gutter_foreground_highlight* `[>=4050]` 120 | 121 | The color of line numbers in the gutter when a line is highlighted 122 | 123 | 124 | # Diff 125 | ------ 126 | 127 | The diff functionality is displayed in the gutter as colored lines for 128 | added and modified lines, and a triangle where lines were deleted. 129 | 130 | *line_diff_width* `[>=3186]` 131 | 132 | The width of the diff lines, between 1 and 8 133 | 134 | 135 | *line_diff_added* `[>=3189]` 136 | 137 | The color of diff markers for added lines 138 | 139 | 140 | *line_diff_modified* `[>=3189]` 141 | 142 | The color of diff markers for modified lines 143 | 144 | 145 | *line_diff_deleted* `[>=3189]` 146 | 147 | The color of diff markers for deleted lines 148 | 149 | 150 | # Selections 151 | ------------ 152 | 153 | *selection* 154 | 155 | The background color of selected text 156 | 157 | 158 | *selection_foreground* 159 | 160 | A color that will override the scope-based text color of the selection 161 | 162 | 163 | *selection_border* 164 | 165 | The color for the border of the selection 166 | 167 | 168 | *selection_border_width* 169 | 170 | The width of the selection border, from `0` to `4`. 171 | 172 | 173 | *inactive_selection* 174 | 175 | The background color of a selection in a view that is not currently 176 | focused 177 | 178 | 179 | *inactive_selection_border* `[>=4074]` 180 | 181 | The color for the border of the selection in a view that is not 182 | currently focused 183 | 184 | 185 | *inactive_selection_foreground* 186 | 187 | A color that will override the scope-based text color of the selection 188 | in a view that is not currently focused 189 | 190 | 191 | *selection_corner_style* 192 | 193 | The style of corners to use on selections. Options include: `round` 194 | (the default), `cut` or `square`. 195 | 196 | 197 | *selection_corner_radius* 198 | 199 | The radius to use when the `selection_corner_style` is `round` or 200 | `cut`. 201 | 202 | 203 | # Find 204 | ------ 205 | 206 | *highlight* 207 | 208 | The border color for "other" matches when the Highlight matches option 209 | is selected in the Find panel. Also used to highlight matches in Find 210 | in Files results. 211 | 212 | 213 | *find_highlight* 214 | 215 | The background color of text matched by the Find panel 216 | 217 | 218 | *find_highlight_foreground* 219 | 220 | A color that will override the scope-based text color of text matched 221 | by the Find panel 222 | 223 | 224 | # Guides 225 | -------- 226 | 227 | Guides are controlled globally by the `draw_indent_guides` setting. 228 | 229 | *guide* 230 | 231 | The color used to draw indent guides. Only used if the option 232 | `"draw_normal"` is present in the setting `indent_guide_options` 233 | 234 | 235 | *active_guide* 236 | 237 | The color used to draw the indent guides for the indentation levels 238 | containing the caret. Only used if the option `"draw_active"` is 239 | present in the setting `indent_guide_options` 240 | 241 | 242 | *stack_guide* 243 | 244 | The color used to draw the indent guides for the parent indentation 245 | levels of the indentation level containing the caret. Only used if the 246 | option `"draw_active"` is present in the setting 247 | `indent_guide_options`. 248 | 249 | 250 | # Brackets 251 | ---------- 252 | 253 | Bracket matching is controlled globally by the `match_brackets` setting. 254 | 255 | *brackets_options* 256 | 257 | How brackets are highlighted when the caret is next to one. Accepts a 258 | space-separated list from the following: 259 | 260 | * `underline` 261 | * `stippled_underline` 262 | * `squiggly_underline` 263 | * `foreground` 264 | * `bold` 265 | * `italic` 266 | * `glow` `[>=4050]` 267 | * `underline` `[>=4074]` 268 | 269 | 270 | *brackets_foreground* 271 | 272 | The color to use when drawing the style specified by 273 | `brackets_options`. 274 | 275 | 276 | *bracket_contents_options* 277 | 278 | How brackets are highlighted when the caret is positioned in between a 279 | pair of brackets. Accepts a space-separated list from the following: 280 | 281 | * `underline` 282 | * `stippled_underline` 283 | * `squiggly_underline` 284 | * `foreground` 285 | 286 | 287 | *bracket_contents_foreground* 288 | 289 | The color to use when drawing the style specified by 290 | `brackets_contents_options`. 291 | 292 | 293 | # Tags 294 | ------ 295 | 296 | Tag matching is controlled globally by the `match_tags` setting. 297 | 298 | *tags_options* 299 | 300 | How tags are highlighted when the caret is inside of one. Accepts a 301 | space- separated list from the following: 302 | 303 | * `underline` 304 | * `stippled_underline` 305 | * `squiggly_underline` 306 | * `foreground` 307 | * `glow` `[>=4050]` 308 | * `underline` `[>=4074]` 309 | 310 | 311 | *tags_foreground* 312 | 313 | The color to use when drawing the style specified by `tags_options`. 314 | 315 | 316 | # Shadows 317 | --------- 318 | 319 | *shadow* 320 | 321 | The color of the shadow used to show when a text area can be 322 | horizontally scrolled 323 | 324 | 325 | *shadow_width* 326 | 327 | The width of the shadow in device-independent pixels 328 | 329 | 330 | -------------------------------------------------------------------------------- 331 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |color_schemes.html| -------------------------------------------------------------------------------- /colorscheme/hyperhelp.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": "SublimeColorScheme", 3 | "description": "Sublime Text Color Schemes", 4 | "default_caption": "Global option: {topic}", 5 | "doc_root": "colorscheme/", 6 | "help_files": { 7 | "index.txt": [ 8 | "Sublime Text Color Schemes", 9 | ], 10 | 11 | "example.txt": [ 12 | "Example", 13 | 14 | { 15 | "topic": "example.txt", 16 | "caption": "Example", 17 | "aliases": ["example"] 18 | }, 19 | ], 20 | 21 | "colors.txt": [ 22 | "Colors", 23 | 24 | { 25 | "topic": "colors.txt", 26 | "caption": "Colors", 27 | "aliases": ["colors"] 28 | }, 29 | ], 30 | 31 | "variables.txt": [ 32 | "Variables", 33 | 34 | { 35 | "topic": "variables.txt", 36 | "caption": "Variables", 37 | "aliases": ["variable", "variables"] 38 | }, 39 | ], 40 | 41 | "global.txt": [ 42 | "Global Settings", 43 | 44 | { 45 | "topic": "global.txt", 46 | "caption": "Global Settings", 47 | "aliases": ["global settings", "globals"] 48 | }, 49 | 50 | { "topic": "background" }, 51 | { "topic": "foreground" }, 52 | { "topic": "invisibles" }, 53 | { "topic": "caret" }, 54 | { "topic": "block_caret" }, 55 | { "topic": "line_highlight" }, 56 | 57 | { 58 | "topic": "accents", 59 | "caption": "Global Settings: Accents" 60 | }, 61 | { "topic": "misspelling" }, 62 | { "topic": "fold_marker" }, 63 | { "topic": "minimap_border" }, 64 | { "topic": "scroll_highlight" }, 65 | { "topic": "scroll_selected_highlight" }, 66 | { "topic": "accent" }, 67 | 68 | { 69 | "topic": "css", 70 | "caption": "Global Settings: CSS" 71 | }, 72 | { "topic": "popup_css" }, 73 | { "topic": "phantom_css" }, 74 | { "topic": "sheet_css" }, 75 | 76 | { 77 | "topic": "gutters", 78 | "caption": "Global Settings: Gutters" 79 | }, 80 | { "topic": "gutter" }, 81 | { "topic": "gutter_foreground" }, 82 | { "topic": "gutter_foreground_highlight" }, 83 | 84 | { 85 | "topic": "diff", 86 | "caption": "Global Settings: Diff" 87 | }, 88 | { "topic": "line_diff_width" }, 89 | { "topic": "line_diff_added" }, 90 | { "topic": "line_diff_modified" }, 91 | { "topic": "line_diff_deleted" }, 92 | 93 | { 94 | "topic": "selections", 95 | "caption": "Global Settings: Selections" 96 | }, 97 | { "topic": "selection" }, 98 | { "topic": "selection_foreground" }, 99 | { "topic": "selection_border" }, 100 | { "topic": "selection_border_width" }, 101 | { "topic": "inactive_selection" }, 102 | { "topic": "inactive_selection_border" }, 103 | { "topic": "inactive_selection_foreground" }, 104 | { "topic": "selection_corner_style" }, 105 | { "topic": "selection_corner_radius" }, 106 | 107 | { 108 | "topic": "find", 109 | "caption": "Global Settings: Find" 110 | }, 111 | { "topic": "highlight" }, 112 | { "topic": "find_highlight" }, 113 | { "topic": "find_highlight_foreground" }, 114 | 115 | { 116 | "topic": "guides", 117 | "caption": "Global Settings: Guides" 118 | }, 119 | { "topic": "guide" }, 120 | { "topic": "active_guide" }, 121 | { "topic": "stack_guide" }, 122 | 123 | { 124 | "topic": "brackets", 125 | "caption": "Global Settings: Brackets" 126 | }, 127 | { "topic": "brackets_options" }, 128 | { "topic": "brackets_foreground" }, 129 | { "topic": "bracket_contents_options" }, 130 | { "topic": "bracket_contents_foreground" }, 131 | 132 | { 133 | "topic": "tags", 134 | "caption": "Global Settings: Tags" 135 | }, 136 | { "topic": "tags_options" }, 137 | { "topic": "tags_foreground" }, 138 | 139 | { 140 | "topic": "shadows", 141 | "caption": "Global Settings: Shadows" 142 | }, 143 | { "topic": "shadow" }, 144 | { "topic": "shadow_width" }, 145 | ], 146 | 147 | "rules.txt": [ 148 | "Scope Rules", 149 | 150 | { 151 | "topic": "rules.txt", 152 | "caption": "Rules", 153 | "aliases": ["scope rules", "rules"] 154 | }, 155 | { 156 | "topic": "matching", 157 | "caption": "Rules: Matching" 158 | }, 159 | { 160 | "topic": "naming", 161 | "caption": "Rules: Naming" 162 | }, 163 | { 164 | "topic": "style rules", 165 | "caption": "Rules: Style Rules", 166 | "aliases": ["name", "scope", "font_style"] 167 | }, 168 | { 169 | "topic": "hashed syntax highlighting", 170 | "caption": "Rules: Hashed Syntax Highlighting" 171 | }, 172 | { 173 | "topic": "examples", 174 | "caption": "Rules: Examples" 175 | }, 176 | 177 | ], 178 | 179 | "customization.txt": [ 180 | "Customization", 181 | 182 | { 183 | "topic": "customization.txt", 184 | "caption": "Customization", 185 | "aliases": ["customization"] 186 | }, 187 | 188 | ], 189 | }, 190 | 191 | "help_contents": [ 192 | { 193 | "topic": "index.txt", 194 | "caption": "Sublime Text Color Schemes" 195 | }, 196 | { 197 | "topic": "example.txt", 198 | "caption": "Example Color Scheme" 199 | }, 200 | 201 | "colors", 202 | "variables", 203 | 204 | { 205 | "topic": "global.txt", 206 | "caption": "Global Settings", 207 | "children": 208 | [ 209 | "global settings", 210 | "accents", 211 | "css", 212 | "gutters", 213 | "selections", 214 | "find", 215 | "guides", 216 | "brackets", 217 | "tags", 218 | "shadows" 219 | ] 220 | }, 221 | 222 | { 223 | "topic": "rules.txt", 224 | "caption": "Rules", 225 | "children": [ 226 | "scope rules", 227 | "matching", 228 | "naming", 229 | "style rules", 230 | "hashed syntax highlighting", 231 | "examples" 232 | ] 233 | }, 234 | 235 | "customization" 236 | ], 237 | 238 | "externals": 239 | { 240 | "https://www.sublimetext.com/docs/color_schemes.html": [ 241 | "Sublime Text Color Schemes", 242 | 243 | { 244 | "topic": "color_schemes.html" 245 | } 246 | ], 247 | 248 | "https://www.sublimetext.com/docs/color_schemes_tmtheme.html": [ 249 | "Sublime Text .thTheme Color Schemes", 250 | 251 | { 252 | "topic": "color_schemes_tmtheme.html", 253 | "aliases": ["tmTheme"] 254 | } 255 | ], 256 | 257 | "https://www.sublimetext.com/docs/themes.html": [ 258 | "Sublime Text Themes", 259 | 260 | { 261 | "topic": "themes.html", 262 | "aliases": ["theme"] 263 | } 264 | ], 265 | 266 | "https://www.sublimetext.com/docs/color_schemes.html#css_colors": [ 267 | "Appendix: CSS Colors", 268 | 269 | { 270 | "topic": "appendix", 271 | "aliases": ["css color names"] 272 | } 273 | ], 274 | 275 | "https://drafts.csswg.org/css-color-4/#modifying-colors": [ 276 | "CSS Color Module Level 4 color-mod function", 277 | 278 | { 279 | "topic": "color-mod function" 280 | } 281 | ], 282 | 283 | "https://www.sublimetext.com/docs/minihtml.html": [ 284 | "minihtml Reference", 285 | 286 | { 287 | "topic": "minihtml" 288 | } 289 | ], 290 | 291 | "https://www.sublimetext.com/docs/minihtml.html#css": [ 292 | "minihtml CSS Reference", 293 | 294 | { 295 | "topic": "minihtml css reference" 296 | } 297 | ], 298 | 299 | "https://www.sublimetext.com/docs/scope_naming.html": [ 300 | "official Scope Naming guidelines", 301 | 302 | { 303 | "topic": "official Scope Naming guidelines" 304 | } 305 | ], 306 | 307 | "https://www.sublimetext.com/docs/scope_naming.html#color_schemes": [ 308 | "Usage in Color Schemes", 309 | 310 | { 311 | "topic": "Usage in Color Schemes" 312 | } 313 | ], 314 | 315 | "https://www.sublimetext.com/docs/dev/color_schemes.html": [ 316 | "Dev Build Color Schemes Documentation", 317 | 318 | { 319 | "topic": "devdocs" 320 | } 321 | ], 322 | 323 | "https://www.sublimetext.com/docs/minihtml.html#color-mod_function": [ 324 | "minihtml color() mod function", 325 | 326 | { 327 | "topic": "minihtml color() mod function" 328 | } 329 | ] 330 | } 331 | } 332 | -------------------------------------------------------------------------------- /api/vieweventlistener.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.ViewEventListener Class" date="2020-05-19" 2 | 3 | 4 | # vieweventlistener:ViewEventListener Class 5 | ========================= 6 | 7 | A class that provides similar event handling to |EventListener|, but bound to a 8 | specific view. Provides class method-based filtering to control what views 9 | objects are created for. 10 | 11 | The view is passed as a single parameter to the constructor. The default 12 | implementation makes the view available via `self.view`. 13 | 14 | This class is contained in the |sublime_plugin| module. 15 | 16 | 17 | ## _none:Class Methods 18 | ---------------- 19 | *ViewEventListener.is_applicable*(settings) 20 | Returns: bool 21 | 22 | A `@classmethod` that receives a |Settings| object and should return a 23 | bool indicating if this class applies to a view with those settings 24 | 25 | 26 | *ViewEventListener.applies_to_primary_view_only*() 27 | Returns: bool 28 | 29 | A `@classmethod` that should return a bool indicating if this class 30 | applies only to the primary view for a file. A view is considered primary 31 | if it is the only, or first, view into a file. 32 | 33 | 34 | ## _none:Methods 35 | ---------- 36 | 37 | *ViewEventListener.on_load*() `[>=3155]` 38 | Returns: None 39 | 40 | Called when the file is finished loading. 41 | 42 | 43 | *ViewEventListener.on_load_async*() `[>=3155]` 44 | Returns: None 45 | 46 | Called when the file is finished loading. Runs in a separate thread, and 47 | does not block the application. 48 | 49 | 50 | *ViewEventListener.on_reload*() `[>=4050]` 51 | Returns: None 52 | 53 | Called when the file is reloaded. 54 | 55 | 56 | *ViewEventListener.on_reload_async*() `[>=4050]` 57 | Returns: None 58 | 59 | Called when the file is reloaded. Runs in a separate thread, and does not 60 | block the application. 61 | 62 | 63 | *ViewEventListener.on_revert*() `[>=4050]` 64 | Returns: None 65 | 66 | Called when the file is reverted. 67 | 68 | 69 | *ViewEventListener.on_revert_async*() `[>=4050]` 70 | Returns: None 71 | 72 | Called when the file is reverted. Runs in a separate thread, and does not 73 | block the application. 74 | 75 | 76 | *ViewEventListener.on_pre_move*() `[>=4050]` 77 | Returns: None 78 | 79 | Called right before a view is moved between two windows. 80 | 81 | 82 | *ViewEventListener.on_post_move*() `[>=4050]` 83 | Returns: None 84 | 85 | Called right after a view is moved between two windows. 86 | 87 | 88 | *ViewEventListener.on_post_move_async*() `[>=4050]` 89 | Returns: None 90 | 91 | Called right after a view is moved between two windows. Runs in a separate 92 | thread, and does not block the application. 93 | 94 | 95 | *ViewEventListener.on_pre_close*() `[>=3155]` 96 | Returns: None 97 | 98 | Called when a view is about to be closed. The view will still be in the 99 | window at this point. 100 | 101 | 102 | *ViewEventListener.on_close*() `[>=3155]` 103 | Returns: None 104 | 105 | Called when a view is closed (note, there may still be other views into the 106 | same buffer). 107 | 108 | 109 | *ViewEventListener.on_pre_save*() `[>=3155]` 110 | Returns: None 111 | 112 | Called just before a view is saved. 113 | 114 | 115 | *ViewEventListener.on_pre_save_async*() `[>=3155]` 116 | Returns: None 117 | 118 | Called just before a view is saved. Runs in a separate thread, and does not 119 | block the application. 120 | 121 | 122 | *ViewEventListener.on_post_save*() `[>=3155]` 123 | Returns: None 124 | 125 | Called after a view has been saved. 126 | 127 | 128 | *ViewEventListener.on_post_save_async*() `[>=3155]` 129 | Returns: None 130 | 131 | Called after a view has been saved. Runs in a separate thread, and does not 132 | block the application. 133 | 134 | 135 | *ViewEventListener.on_modified*() 136 | Returns: None 137 | 138 | Called after changes have been made to the view. 139 | 140 | 141 | *ViewEventListener.on_modified_async*() 142 | Returns: None 143 | 144 | Called after changes have been made to the view. Runs in a separate thread, 145 | and does not block the application. 146 | 147 | 148 | *ViewEventListener.on_text_changed*([changes]) `[>=4050]` 149 | Returns: None 150 | 151 | Called once after changes has been made to a view, with detailed 152 | information about what has changed. 153 | 154 | `changes` is a list of `TextChange` objects. 155 | 156 | 157 | *ViewEventListener.on_text_changed_async*([changes]) `[>=4050]` 158 | Returns: None 159 | 160 | Called once after changes has been made to a view, with detailed 161 | information about what has changed. Runs in a separate thread, and does not 162 | block the application. 163 | 164 | `changes` is a list of `TextChange` objects. 165 | 166 | 167 | *ViewEventListener.on_selection_modified*() 168 | Returns: None 169 | 170 | Called after the selection has been modified in the view. 171 | 172 | 173 | *ViewEventListener.on_selection_modified_async*() 174 | Returns: None 175 | 176 | Called after the selection has been modified in the view. Runs in a 177 | separate thread, and does not block the application. 178 | 179 | 180 | *ViewEventListener.on_activated*() 181 | Returns: None 182 | 183 | Called when a view gains input focus. 184 | 185 | 186 | *ViewEventListener.on_activated_async*() 187 | Returns: None 188 | 189 | Called when the view gains input focus. Runs in a separate thread, and does 190 | not block the application. 191 | 192 | 193 | *ViewEventListener.on_deactivated*() 194 | Returns: None 195 | 196 | Called when the view loses input focus. 197 | 198 | 199 | *ViewEventListener.on_deactivated_async*() 200 | Returns: None 201 | 202 | Called when the view loses input focus. Runs in a separate thread, and does 203 | not block the application. 204 | 205 | 206 | *ViewEventListener.on_hover*(point, hover_zone) 207 | Returns: None 208 | 209 | Called when the user's mouse hovers over the view for a short period. 210 | 211 | point is the closest point in the view to the mouse location. The mouse may 212 | not actually be located adjacent based on the value of `hover_zone`: 213 | 214 | * `sublime.HOVER_TEXT` 215 | When the mouse is hovered over text. 216 | 217 | * `sublime.HOVER_GUTTER` 218 | When the mouse is hovered over the gutter. 219 | 220 | * `sublime.HOVER_MARGIN` 221 | When the mouse is hovered in whitespace to the right of a line. 222 | 223 | 224 | *ViewEventListener.on_query_context*(key, operator, operand, match_all) 225 | Returns: bool or None 226 | 227 | Called when determining to trigger a key binding with the given context 228 | `key`. If the plugin knows how to respond to the context, it should return 229 | either `True` of `False`. If the context is unknown, it should return 230 | `None`. 231 | 232 | operator is one of: 233 | 234 | * `sublime.OP_EQUAL` 235 | Is the value of the context equal to the operand? 236 | 237 | * `sublime.OP_NOT_EQUAL` 238 | Is the value of the context not equal to the operand? 239 | 240 | * `sublime.OP_REGEX_MATCH` 241 | Does the value of the context match the regex given in operand? 242 | 243 | * `sublime.OP_NOT_REGEX_MATCH` 244 | Does the value of the context not match the regex given in operand? 245 | 246 | * `sublime.OP_REGEX_CONTAINS` 247 | Does the value of the context contain a substring matching the regex 248 | given in operand? 249 | 250 | * `sublime.OP_NOT_REGEX_CONTAINS` 251 | Does the value of the context not contain a substring matching the regex 252 | given in operand? 253 | 254 | `match_all` should be used if the context relates to the selections: does 255 | every selection have to match (`match_all == True`), or is at least one 256 | matching enough (`match_all == False`)? 257 | 258 | 259 | *ViewEventListener.on_query_completions*(prefix, locations) 260 | Returns: None, list, tuple or |CompletionList| 261 | 262 | Called whenever completions are to be presented to the user. The `prefix` 263 | is a unicode string of the text to complete. 264 | 265 | `locations` is a list of |:point:points|. Since this method is called for all 266 | completions no matter the syntax, `view.match_selector(point, 267 | relevant_scope)` should be called to determine if the point is relevant. 268 | 269 | The return value must be one of the following formats: 270 | 271 | * `None`: no completions are provided 272 | 273 | ```python 274 | return None 275 | ``` 276 | 277 | * A list of |completion| values 278 | 279 | ```python 280 | return [ 281 | ["me1", "method1()"], 282 | ["me2", "method2()"] 283 | ] 284 | ``` 285 | 286 | * A 2-element tuple with the first element being a list of |completion| 287 | values, and the second element being flags composed via bitwise OR of: 288 | 289 | * `sublime.INHIBIT_WORD_COMPLETIONS` 290 | prevent Sublime Text from showing completions based on the contents 291 | of the view 292 | 293 | * `sublime.INHIBIT_EXPLICIT_COMPLETIONS` 294 | prevent Sublime Text from showing completions based on 295 | `.sublime-completions` files 296 | 297 | * `sublime.DYNAMIC_COMPLETIONS`: `[>=4057]` 298 | if completions should be re-queried as the user types 299 | 300 | * `sublime.INHIBIT_REORDER` `[>=4074]` 301 | prevent Sublime Text from changing the completion order 302 | 303 | ```python 304 | return ( 305 | [ 306 | ["me1", "method1()"], 307 | ["me2", "method2()"] 308 | ], 309 | sublime.INHIBIT_WORD_COMPLETIONS | 310 | sublime.INHIBIT_EXPLICIT_COMPLETIONS 311 | ) 312 | ``` 313 | 314 | * A |CompletionList| object `[>=4050]` 315 | 316 | ```python 317 | cl = sublime.CompletionList(flags=sublime.INHIBIT_WORD_COMPLETIONS) 318 | start_background_fetch(cl) 319 | return cl 320 | ``` 321 | 322 | 323 | *ViewEventListener.on_text_command*(command_name, args) 324 | Returns: (str, dict) 325 | 326 | Called when a text command is issued. The listener may return a `(command, 327 | arguments)` tuple to rewrite the command, or `None` to run the command 328 | unmodified. 329 | 330 | 331 | *ViewEventListener.on_post_text_command*(command_name, args) 332 | Returns: None 333 | 334 | Called after a text command has been executed. 335 | 336 | 337 | -------------------------------------------------------------------------------- 338 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/sublime.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime Module" date="2020-07-28" 2 | 3 | 4 | # sublime:sublime Module 5 | ================ 6 | 7 | In addition to the following module functions, the `sublime` module contains 8 | the following classes and data types: 9 | 10 | |Sheet| 11 | |View| 12 | |Selection| 13 | |Region| 14 | |Phantom| 15 | |PhantomSet| 16 | |Edit| 17 | |TextChange| `[>=4050]` 18 | |HistoricPosition| `[>=4050]` 19 | |CompletionItem| `[>=4050]` 20 | |completion_kind| `[>=4050]` 21 | |CompletionList| `[>=4050]` 22 | |Window| 23 | |Settings| 24 | 25 | 26 | *sublime.set_timeout*(callback, delay=0) 27 | Returns: None 28 | 29 | Runs the callback in the main thread after the given `delay` (in 30 | milliseconds). Callbacks with an equal delay will be run in the order they 31 | were added. 32 | 33 | 34 | *sublime.set_timeout_async*(callback, delay=0) 35 | Returns: None 36 | 37 | Runs the callback on an alternate thread after the given `delay` (in 38 | milliseconds). 39 | 40 | 41 | *sublime.error_message*(msg) 42 | Returns: None 43 | 44 | Displays an error dialog to the user. 45 | 46 | 47 | *sublime.message_dialog*(string) 48 | Returns: None 49 | 50 | Displays a message dialog to the user. 51 | 52 | 53 | *sublime.ok_cancel_dialog*(msg, ) 54 | Returns: bool 55 | 56 | Displays an ok / cancel question dialog to the user. If `ok_title` is 57 | provided, this may be used as the text on the ok button. Returns `True` if 58 | the user presses the ok button. 59 | 60 | 61 | *sublime.yes_no_cancel_dialog*(msg, , ) 62 | Returns: int 63 | 64 | Displays a yes / no / cancel question dialog to the user. If `yes_title` 65 | and/or `no_title` are provided, they will be used as the text on the 66 | corresponding buttons on some platforms. Returns `sublime.DIALOG_YES`, 67 | `sublime.DIALOG_NO` or `sublime.DIALOG_CANCEL`. 68 | 69 | 70 | *sublime.open_dialog*(callback, , , `[>=4075]` 71 | , ) 72 | Returns: None 73 | 74 | Presents the user with a file dialog for the purpose of opening a file, 75 | and passes the resulting file path to `callback`. 76 | 77 | * `callback` 78 | A callback to accept the result of the user’s choice. If the user 79 | cancels the dialog, `None` will be passed. If a file is selected, a 80 | `str` containing the path will be passed. If the parameter 81 | `multi_select` is `True`, a `list` of `str` file paths will be passed. 82 | 83 | * `file_types` 84 | A specification of allowable file types. This parameter should be a 85 | `list` containing 2-element `tuples`: 86 | 87 | * A `str` containing a description 88 | * A `list` of `str` with valid file extensions 89 | 90 | Example: 91 | 92 | ```python 93 | [ 94 | ('Python source files', ['py', 'py3', 'pyw']), 95 | ('C source files', ['c', 'h']) 96 | ] 97 | ``` 98 | 99 | * `directory` 100 | A `str` of the directory to open the file dialog to. If not specified, 101 | will use the directory of the current view. 102 | 103 | * `multi_select*` 104 | A `bool` to indicate that the user should be allowed to select multiple 105 | files 106 | 107 | * `allow_folders` 108 | A `bool` to indicate that the user should be allowed to select folders 109 | 110 | 111 | *sublime.save_dialog*(callback, , , `[>=4075]` 112 | , ) 113 | Returns: None 114 | 115 | Presents the user with a file dialog for the purpose of saving a file, 116 | and passes the result to `callback`. 117 | 118 | * `callback` 119 | A callback to accept the result of the user’s choice. If the user 120 | cancels the dialog, `None` will be passed. If a file is selected, a 121 | `str` containing the path will be passed. 122 | 123 | * `file_types` 124 | A specification of allowable file types. This parameter should be a 125 | `list` containing 2-element `tuples`: 126 | 127 | * A `str` containing a description 128 | * A `list` of `str` with valid file extensions 129 | 130 | Example: 131 | 132 | ```python 133 | [ 134 | ('Python source files', ['py', 'py3', 'pyw']), 135 | ('C source files', ['c', 'h']) 136 | ] 137 | ``` 138 | 139 | * `directory` 140 | A `str` with the default file name 141 | 142 | * `name*` 143 | A `bool` to indicate that the user should be allowed to select multiple 144 | files 145 | 146 | * `extension` 147 | A `str` containing the default file extension 148 | 149 | 150 | *sublime.select_folder_dialog*(callback, , ) `[>=4075]` 151 | Returns: None 152 | 153 | Presents the user with a file dialog for the purpose of selecting a 154 | folder, and passes the resulting file path to `callback`. 155 | 156 | * `callback` 157 | A callback to accept the result of the user’s choice. If the user 158 | cancels the dialog, `None` will be passed. If a folder is selected, a 159 | `str` containing the path will be passed. If the parameter 160 | `multi_select` is `True`, a `list` of `str` folder paths will be 161 | passed. 162 | 163 | * `directory` 164 | A `str` of the directory to open the file dialog to. If not specified, 165 | will use the directory of the current view. 166 | 167 | * `multi_select*` 168 | A `bool` to indicate that the user should be allowed to select multiple 169 | files 170 | 171 | 172 | *sublime.status_message*() `[UNDOCUMENTED]` `[DEPRECATED]` 173 | Returns: None 174 | 175 | Show a message in the status bar. This is an old API that has been 176 | replaced by |:window.status_message:window.status_message()|. 177 | 178 | 179 | *sublime.load_resource*(name) 180 | Returns: str 181 | 182 | Loads the given resource. The `name` should be in the format 183 | `Packages/Default/Main.sublime-menu`. 184 | 185 | 186 | *sublime.load_binary_resource*(name) 187 | Returns: bytes 188 | 189 | Loads the given resource. The name should be in the format 190 | `Packages/Default/Main.sublime-menu`. 191 | 192 | 193 | *sublime.find_resources*(pattern) 194 | Returns: [str] 195 | 196 | Finds resources whose file name matches the given `pattern`. 197 | 198 | 199 | *sublime.list_syntaxes*() `[>=4050]` 200 | Returns: [dict] 201 | 202 | Returns a list of all available syntaxes. Each dict will have the keys 203 | `"path"`, `"name"`, `"hidden"` and `"scope"`. 204 | 205 | 206 | *sublime.find_syntax*(fname, ) `[>=4050]` 207 | Returns: str or None 208 | 209 | Returns the path to the syntax that will be used when opening a file with 210 | the name `fname`. The `first_line` of file contents may also be provided if 211 | available. 212 | 213 | 214 | *sublime.encode_value*(value, ) 215 | Returns: str 216 | 217 | Encode a JSON compatible `value` into a string representation. If `pretty` 218 | is set to `True`, the string will include newlines and indentation. 219 | 220 | 221 | *sublime.decode_value*(data) 222 | Returns: |value| 223 | 224 | Decodes a JSON string into an object. If the `string` is invalid, a 225 | `ValueError` will be thrown. 226 | 227 | 228 | *sublime.expand_variables*(value, variables) 229 | Returns: |value| 230 | 231 | Expands any variables in the string `value` using the variables defined in 232 | the dictionary `variables`. `value` may also be a `list` or `dict`, in 233 | which case the structure will be recursively expanded. Strings should use 234 | snippet syntax, for example: 235 | `expand_variables("Hello, ${name}", {"name": "Foo"})` 236 | 237 | 238 | *sublime.load_settings*(base_name) 239 | Returns: |Settings| 240 | 241 | Loads the named settings. The name should include a file name and 242 | extension, but not a path. The packages will be searched for files matching 243 | the `base_name`, and the results will be collated into the settings object. 244 | Subsequent calls to `load_settings()` with the `base_name` will return the 245 | same object, and not load the settings from disk again. 246 | 247 | 248 | *sublime.save_settings*(base_name) 249 | Returns: None 250 | 251 | Flushes any in-memory changes to the named settings object to disk. 252 | 253 | 254 | *sublime.windows*() 255 | Returns: [|Window|] 256 | 257 | Returns a list of all the open windows. 258 | 259 | 260 | *sublime.active_window*() 261 | Returns: |Window| 262 | 263 | Returns the most recently used window. 264 | 265 | 266 | *sublime.packages_path*() 267 | Returns: str 268 | 269 | Returns the path where all the user's loose packages are located. 270 | 271 | 272 | *sublime.installed_packages_path*() 273 | Returns: str 274 | 275 | Returns the path where all the user's `.sublime-package` files are 276 | located. 277 | 278 | 279 | *sublime.executable_path*() `[UNDOCUMENTED]` 280 | Returns: str 281 | 282 | Returns the full path to the Sublime Text executable, including the name 283 | of the executable itself. 284 | 285 | 286 | *sublime.executable_hash*() `[UNDOCUMENTED]` 287 | Returns: tuple 288 | 289 | Returns a 3-tuple that provides the current `version`, `platform`, 290 | `architecture` and a hash value. 291 | 292 | Example: 293 | `('3180', 'linux_x64', '6b76a7235661436c212bc5342d190146')` 294 | 295 | 296 | *sublime.cache_path*() 297 | Returns: str 298 | 299 | Returns the path where Sublime Text stores cache files. 300 | 301 | 302 | *sublime.get_clipboard*() 303 | Returns: str 304 | 305 | Returns the contents of the clipboard. `size_limit` is there to protect 306 | against unnecessarily large data, defaults to 16,777,216 characters 307 | 308 | 309 | *sublime.set_clipboard*(text) 310 | Returns: None 311 | 312 | Sets the contents of the clipboard. 313 | 314 | 315 | *sublime.score_selector*(scope_name, selector) 316 | Returns: int 317 | 318 | Matches the `selector` against the given scope, returning a score. A score 319 | of `0` means no match, above `0` means a match. Different selectors may be 320 | compared against the same scope: a higher score means the selector is a 321 | better match for the scope. 322 | 323 | 324 | *sublime.run_command*(cmd, ) 325 | Returns: None 326 | 327 | Runs the named |ApplicationCommand| with the (optional) given `args`. 328 | 329 | 330 | *sublime.log_commands*(flag) 331 | Returns: None 332 | 333 | Controls command logging. If enabled, all commands run from key bindings 334 | and the menu will be logged to the console. 335 | 336 | 337 | *sublime.log_input*(flag) 338 | Returns: None 339 | 340 | Controls input logging. If enabled, all key presses will be logged to the 341 | console. 342 | 343 | 344 | *sublime.log_result_regex*(flag) 345 | Returns: None 346 | 347 | Controls result regex logging. This is useful for debugging regular 348 | expressions used in build systems. 349 | 350 | 351 | *sublime.log_indexing*(flag) `[UNDOCUMENTED]` `[DEPRECATED]` 352 | Returns: None 353 | 354 | Controls logging of indexing operations. If enabled, relevant information 355 | related to indexing will be logged to the console. 356 | 357 | This method is deprecated in favor of the `Help > Indexing Status` menu 358 | item, which displays all indexing logs for the current invocation of 359 | Sublime Text and also includes more information. 360 | 361 | 362 | *sublime.log_build_systems*(flag) `[UNDOCUMENTED]` 363 | Returns: None 364 | 365 | Controls logging of build system selection. If enabled, information on how 366 | Sublime is selecting the appropriate build system for the current situation 367 | is logged to the console. 368 | 369 | 370 | *sublime.log_control_tree*(flag) 371 | Returns: None 372 | 373 | When enabled, clicking with will log the control tree under the 374 | mouse to the console. 375 | 376 | 377 | *sublime.version*() 378 | Returns: str 379 | 380 | Returns the version number 381 | 382 | 383 | *sublime.platform*() 384 | Returns: str 385 | 386 | Returns the platform, which may be `"osx"`, `"linux"` or `"windows"` 387 | 388 | 389 | *sublime.arch*() 390 | Returns: str 391 | 392 | Returns the CPU architecture, which may be `"x32"` or `"x64"` 393 | 394 | 395 | *sublime.channel*() `[UNDOCUMENTED]` 396 | Returns: str 397 | 398 | Returns the channel that the current version of Sublime is from, which may 399 | be `"dev"` or `"stable"`. 400 | 401 | 402 | -------------------------------------------------------------------------------- 403 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/eventlistener.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime_plugin.EventListener Class" date="2020-05-19" 2 | 3 | 4 | # eventlistener:EventListener Class 5 | ===================== 6 | 7 | Note that many of these events are triggered by the buffer underlying the view, 8 | and thus the method is only called once, with the first view as the parameter. 9 | 10 | This class is contained in the |sublime_plugin| module. 11 | 12 | 13 | *EventListener.on_init*([views]) `[>=4050]` 14 | Returns: None 15 | 16 | Called once with a list of views that were loaded before the EventListener 17 | was instantiated 18 | 19 | 20 | *EventListener.on_exit*() `[>=4050]` 21 | Returns: None 22 | 23 | Called once after the API has shut down, immediately before the plugin_host 24 | process exits 25 | 26 | 27 | *EventListener.on_new*(view) 28 | Returns: None 29 | 30 | Called when a new buffer is created. 31 | 32 | 33 | *EventListener.on_new_async*(view) 34 | Returns: None 35 | 36 | Called when a new buffer is created. Runs in a separate thread, and does 37 | not block the application. 38 | 39 | 40 | *EventListener.on_clone*(view) 41 | Returns: None 42 | 43 | Called when a view is cloned from an existing one. 44 | 45 | 46 | *EventListener.on_clone_async*(view) 47 | Returns: None 48 | 49 | Called when a view is cloned from an existing one. Runs in a separate 50 | thread, and does not block the application. 51 | 52 | 53 | *EventListener.on_load*(view) 54 | Returns: None 55 | 56 | Called when the file is finished loading. 57 | 58 | 59 | *EventListener.on_load_async*(view) 60 | Returns: None 61 | 62 | Called when the file is finished loading. Runs in a separate thread, and 63 | does not block the application. 64 | 65 | 66 | *EventListener.on_reload*(view) `[>=4050]` 67 | Returns: None 68 | 69 | Called when the |View| is reloaded. 70 | 71 | 72 | *EventListener.on_reload_async*(view) `[>=4050]` 73 | Returns: None 74 | 75 | Called when the |View| is reloaded. Runs in a separate thread, and does not 76 | block the application. 77 | 78 | 79 | *EventListener.on_revert*(view) `[>=4050]` 80 | Returns: None 81 | 82 | Called when the |View| is reverted. 83 | 84 | 85 | *EventListener.on_revert_async*(view) `[>=4050]` 86 | Returns: None 87 | 88 | Called when the |View| is reverted. Runs in a separate thread, and does not 89 | block the application. 90 | 91 | 92 | *EventListener.on_pre_move*(view) `[>=4050]` 93 | Returns: None 94 | 95 | Called right before a view is moved between two windows, passed the |View| 96 | object. 97 | 98 | 99 | *EventListener.on_post_move*(view) `[>=4050]` 100 | Returns: None 101 | 102 | Called right after a view is moved between two windows, passed the |View| 103 | object. 104 | 105 | 106 | *EventListener.on_post_move_async*(view) `[>=4050]` 107 | Returns: None 108 | 109 | Called right after a view is moved between two windows, passed the |View| 110 | object. Runs in a separate thread, and does not block the application. 111 | 112 | 113 | *EventListener.on_pre_close*(view) 114 | Returns: None 115 | 116 | Called when a view is about to be closed. The view will still be in the 117 | window at this point. 118 | 119 | 120 | *EventListener.on_close*(view) 121 | Returns: None 122 | 123 | Called when a view is closed (note, there may still be other views into the 124 | same buffer). 125 | 126 | 127 | *EventListener.on_pre_save*(view) 128 | Returns: None 129 | 130 | Called just before a view is saved. 131 | 132 | 133 | *EventListener.on_pre_save_async*(view) 134 | Returns: None 135 | 136 | Called just before a view is saved. Runs in a separate thread, and does not 137 | block the application. 138 | 139 | 140 | *EventListener.on_post_save*(view) 141 | Returns: None 142 | 143 | Called after a view has been saved. 144 | 145 | 146 | *EventListener.on_post_save_async*(view) 147 | Returns: None 148 | 149 | Called after a view has been saved. Runs in a separate thread, and does not 150 | block the application. 151 | 152 | 153 | *EventListener.on_modified*(view) 154 | Returns: None 155 | 156 | Called after changes have been made to a view. 157 | 158 | 159 | *EventListener.on_modified_async*(view) 160 | Returns: None 161 | 162 | Called after changes have been made to a view. Runs in a separate thread, 163 | and does not block the application. 164 | 165 | 166 | *EventListener.on_text_changed*(view, [changes]) `[>=4050]` 167 | Returns: None 168 | 169 | Called once after changes has been made to a view, with detailed 170 | information about what has changed. 171 | 172 | `changes` is a list of |TextChange| objects. 173 | 174 | 175 | *EventListener.on_text_changed_async*(view, [changes]) `[>=4050]` 176 | Returns: None 177 | 178 | Called once after changes has been made to a view, with detailed 179 | information about what has changed. Runs in a separate thread, and does not 180 | block the application. 181 | 182 | `changes` is a list of |TextChange| objects. 183 | 184 | 185 | *EventListener.on_selection_modified*(view) 186 | Returns: None 187 | 188 | Called after the selection has been modified in a view. 189 | 190 | 191 | *EventListener.on_selection_modified_async*(view) 192 | Returns: None 193 | 194 | Called after the selection has been modified in a view. Runs in a separate 195 | thread, and does not block the application. 196 | 197 | 198 | *EventListener.on_activated*(view) 199 | Returns: None 200 | 201 | Called when a view gains input focus. 202 | 203 | 204 | *EventListener.on_activated_async*(view) 205 | Returns: None 206 | 207 | Called when a view gains input focus. Runs in a separate thread, and does 208 | not block the application. 209 | 210 | 211 | *EventListener.on_deactivated*(view) 212 | Returns: None 213 | 214 | Called when a view loses input focus. 215 | 216 | 217 | *EventListener.on_deactivated_async*(view) 218 | Returns: None 219 | 220 | Called when a view loses input focus. Runs in a separate thread, and does 221 | not block the application. 222 | 223 | 224 | *EventListener.on_hover*(view, point, hover_zone) 225 | Returns: None 226 | 227 | Called when the user's mouse hovers over a view for a short period. 228 | 229 | `point` is the closest point in the view to the mouse location. The mouse 230 | may not actually be located adjacent based on the value of `hover_zone`: 231 | 232 | * `sublime.HOVER_TEXT`: When the mouse is hovered over text. 233 | 234 | * `sublime.HOVER_GUTTER`: When the mouse is hovered over the gutter. 235 | 236 | * `sublime.HOVER_MARGIN`: When the mouse is hovered in whitespace to the 237 | right of a line. 238 | 239 | 240 | *EventListener.on_query_context*(view, key, operator, operand, match_all) 241 | Returns: bool or None 242 | 243 | Called when determining to trigger a key binding with the given context 244 | `key`. If the plugin knows how to respond to the context, it should return 245 | either `True` of `False`. If the context is unknown, it should return 246 | `None`. 247 | 248 | `operator` is one of: 249 | 250 | * `sublime.OP_EQUAL`: Is the value of the context equal to the operand? 251 | 252 | * `sublime.OP_NOT_EQUAL`: Is the value of the context not equal to the 253 | operand? 254 | 255 | * `sublime.OP_REGEX_MATCH`: Does the value of the context match the regex 256 | given in operand? 257 | 258 | * `sublime.OP_NOT_REGEX_MATCH`: Does the value of the context not match the 259 | regex given in operand? 260 | 261 | * `sublime.OP_REGEX_CONTAINS`: Does the value of the context contain a 262 | substring matching the regex given in operand? 263 | 264 | * `sublime.OP_NOT_REGEX_CONTAINS`: Does the value of the context not contain 265 | a substring matching the regex given in operand? 266 | 267 | `match_all` should be used if the context relates to the selections: does 268 | every selection have to match (`match_all == True`), or is at least one 269 | matching enough (`match_all == False`)? 270 | 271 | 272 | *EventListener.on_query_completions*(view, prefix, locations) 273 | Returns: None, list, tuple or |CompletionList| 274 | 275 | Called whenever completions are to be presented to the user. The `prefix` 276 | is a unicode string of the text to complete. 277 | 278 | `locations` is a list of |:point:points|. Since this method is called for all 279 | completions in every view no matter the syntax, `view.match_selector(point, 280 | relevant_scope)` should be called to determine if the point is relevant. 281 | 282 | The return value must be one of the following formats: 283 | 284 | * `None`: no completions are provided 285 | 286 | ```python 287 | return None 288 | ``` 289 | 290 | * A list of |completion| values 291 | 292 | ```python 293 | return [ 294 | ["me1", "method1()"], 295 | ["me2", "method2()"] 296 | ] 297 | ``` 298 | 299 | * A 2-element tuple with the first element being a list of |completion| 300 | values, and the second element being flags composed via bitwise OR of: 301 | 302 | * `sublime.INHIBIT_WORD_COMPLETIONS`: prevent Sublime Text from showing 303 | completions based on the contents of the view 304 | 305 | * `sublime.INHIBIT_EXPLICIT_COMPLETIONS`: prevent Sublime Text from 306 | showing completions based on `.sublime-completions` files 307 | 308 | * `sublime.DYNAMIC_COMPLETIONS`: `[>=4057]` 309 | if completions should be re-queried as the user types 310 | 311 | * `sublime.INHIBIT_REORDER` `[>=4074]` 312 | prevent Sublime Text from changing the completion order 313 | 314 | ```python 315 | return ( 316 | [ 317 | ["me1", "method1()"], 318 | ["me2", "method2()"] 319 | ], 320 | sublime.INHIBIT_WORD_COMPLETIONS | 321 | sublime.INHIBIT_EXPLICIT_COMPLETIONS 322 | ) 323 | ``` 324 | 325 | * A |CompletionList| object `[>=4050]` 326 | 327 | ```python 328 | cl = sublime.CompletionList(flags=sublime.INHIBIT_WORD_COMPLETIONS) 329 | start_background_fetch(cl) 330 | return cl 331 | ``` 332 | 333 | 334 | *EventListener.on_text_command*(view, command_name, args) 335 | Returns: (str, dict) 336 | 337 | Called when a text command is issued. The listener may return a `(command, 338 | arguments)` tuple to rewrite the command, or `None` to run the command 339 | unmodified. 340 | 341 | 342 | *EventListener.on_window_command*(window, command_name, args) 343 | Returns: (str, dict) 344 | 345 | Called when a window command is issued. The listener may return a 346 | `(command, arguments)` tuple to rewrite the command, or `None` to run the 347 | command unmodified. 348 | 349 | 350 | *EventListener.on_post_text_command*(view, command_name, args) 351 | Returns: None 352 | 353 | Called after a text command has been executed. 354 | 355 | 356 | *EventListener.on_post_window_command*(window, command_name, args) 357 | Returns: None 358 | 359 | Called after a window command has been executed. 360 | 361 | 362 | *EventListener.on_new_window*(window) `[>=4050]` 363 | Returns: None 364 | 365 | Called when a window is created, passed the |Window| object. 366 | 367 | 368 | *EventListener.on_new_window_async*(window) `[>=4050]` 369 | Returns: None 370 | 371 | Called when a window is created, passed the |Window| object. Runs in a 372 | separate thread, and does not block the application. 373 | 374 | 375 | *EventListener.on_pre_close_window*(window) `[>=4050]` 376 | Returns: None 377 | 378 | Called right before a window is closed, passed the |Window| object. 379 | 380 | 381 | *EventListener.on_new_project*(window) `[>=4050]` 382 | Returns: None 383 | 384 | Called right after a new project is created, passed the |Window| object. 385 | 386 | 387 | *EventListener.on_new_project_async*(window) `[>=4050]` 388 | Returns: None 389 | 390 | Called right after a new project is created, passed the |Window| object. 391 | Runs in a separate thread, and does not block the application. 392 | 393 | 394 | *EventListener.on_load_project*(window) `[>=4050]` 395 | Returns: None 396 | 397 | Called right after a new project is loaded, passed the |Window| object. 398 | 399 | 400 | *EventListener.on_load_project_async*(window) `[>=4050]` 401 | Returns: None 402 | 403 | Called right after a new project is loaded, passed the |Window| object. 404 | Runs in a separate thread, and does not block the application. 405 | 406 | 407 | *EventListener.on_pre_save_project*(window) `[>=4050]` 408 | Returns: None 409 | 410 | Called right before a project is saved, passed the |Window| object. 411 | 412 | 413 | *EventListener.on_post_save_project*(window) `[>=4050]` 414 | Returns: None 415 | 416 | Called right after a project is saved, passed the |Window| object. 417 | 418 | 419 | *EventListener.on_post_save_project_async*(window) `[>=4050]` 420 | Returns: None 421 | 422 | Called right after a project is saved, passed the |Window| object. Runs in 423 | a separate thread, and does not block the application. 424 | 425 | 426 | *EventListener.on_pre_close_project*(window) `[>=4050]` 427 | Returns: None 428 | 429 | Called right before a project is closed, passed the |Window| object. 430 | 431 | 432 | -------------------------------------------------------------------------------- 433 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/window.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.Window Class" date="2020-05-06" 2 | 3 | 4 | # window:Window Class 5 | ============== 6 | 7 | Represents a Sublime Text window. 8 | 9 | This class is contained in the |sublime| module. 10 | 11 | 12 | *window.id*() 13 | Returns: int 14 | 15 | Returns a number that uniquely identifies this window. 16 | 17 | 18 | *window.new_file*(, ) 19 | Returns: |View| 20 | 21 | Creates a new file. The returned view will be empty, and its `is_loaded()` 22 | method will return `True`. 23 | 24 | The optional `flags` parameter may be `sublime.TRANSIENT` to create the new 25 | view as a transient view. 26 | 27 | The optional `syntax` argument applies a syntax to the newly created view; 28 | it takes an argument as per the `syntax` setting. 29 | 30 | NOTE: The `flags` and `syntax` arguments are `[UNDOCUMENTED]`. 31 | 32 | 33 | *window.open_file*(file_name, , ) 34 | Returns: |View| 35 | 36 | Opens the named file, and returns the corresponding view. If the file is 37 | already opened, it will be brought to the front. Note that as file loading 38 | is asynchronous, operations on the returned view won't be possible until 39 | its `is_loading()` method returns `False`. 40 | 41 | The file will be opened into the provided `group`, which will be the 42 | currently active group if `group` is -1. 43 | 44 | The optional `flags` parameter is a bitwise combination of: 45 | 46 | * `sublime.ENCODED_POSITION` 47 | Indicates the file_name should be searched for a `:row` or `:row:col` 48 | suffix 49 | 50 | * `sublime.TRANSIENT` 51 | Open the file as a preview only: it won't have a tab assigned it until 52 | modified 53 | 54 | * `sublime.FORCE_GROUP` 55 | Don't select the file if it's opened in a different group. 56 | 57 | * `sublime.ADD_TO_SELECTION` `[>=4050]` 58 | Add the file to the currently selected sheets in this group 59 | 60 | The optional group parameter an a 0-based integer of the group to open the 61 | file within. -1 specifies the active group. 62 | 63 | 64 | *window.find_open_file*(file_name) 65 | Returns: |View| 66 | 67 | Finds the named file in the list of open files, and returns the 68 | corresponding View, or `None` if no such file is open. 69 | 70 | 71 | *window.new_html_sheet*(name, contents, , ) `[>=4065]` 72 | Returns: |Sheet| 73 | 74 | Constructs a sheet with HTML contents rendered using |minihtml|. 75 | 76 | * `name` 77 | A unicode string of the sheet name, shown in tab and Open Files 78 | 79 | * `contents` 80 | A unicode string of the HTML contents 81 | 82 | * `flags` 83 | A bitwise combination of: 84 | 85 | * `sublime.TRANSIENT` 86 | Open the file as a preview only: it won't have a tab assigned it until 87 | modified 88 | 89 | * `sublime.ADD_TO_SELECTION` `[>=4050]` 90 | Add the file to the currently selected sheets in this group 91 | 92 | * `group` 93 | An integer of the group to add the sheet to, `-1` for the active group 94 | 95 | 96 | *window.active_sheet*() 97 | Returns: |Sheet| 98 | 99 | Returns the currently focused sheet. 100 | 101 | 102 | *window.active_view*() 103 | Returns: |View| 104 | 105 | Returns the currently edited view. 106 | 107 | 108 | *window.active_sheet_in_group*(group) 109 | Returns: |Sheet| 110 | 111 | Returns the currently focused sheet in the given `group`. 112 | 113 | 114 | *window.active_view_in_group*(group) 115 | Returns: |View| 116 | 117 | Returns the currently edited view in the given `group`. 118 | 119 | 120 | *window.transient_sheet_in_group*(group) `[UNDOCUMENTED]` 121 | Returns: ???? 122 | 123 | ???? 124 | 125 | 126 | *window.transient_view_in_group*(group) `[UNDOCUMENTED]` 127 | Returns: ???? 128 | 129 | ???? 130 | 131 | 132 | *window.sheets*() 133 | Returns: [|Sheet|] 134 | 135 | Returns all open sheets in the window. 136 | 137 | 138 | *window.sheets_in_group*(group) 139 | Returns: [|Sheet|] 140 | 141 | Returns all open sheets in the given `group`. 142 | 143 | 144 | *window.views*() 145 | Returns: [|View|] 146 | 147 | Returns all open views in the window. 148 | 149 | 150 | *window.views_in_group*(group) 151 | Returns: [|View|] 152 | 153 | Returns all open views in the given `group`. 154 | 155 | 156 | *window.num_groups*() 157 | Returns: int 158 | 159 | Returns the number of view groups in the window. 160 | 161 | 162 | *window.active_group*() 163 | Returns: int 164 | 165 | Returns the index of the currently selected group. 166 | 167 | 168 | *window.focus_group*(group) 169 | Returns: None 170 | 171 | Makes the given `group` active. 172 | 173 | 174 | *window.focus_sheet*(sheet) 175 | Returns: None 176 | 177 | Switches to the given `sheet`. 178 | 179 | 180 | *window.focus_view*(view) 181 | Returns: None 182 | 183 | Switches to the given `view`. 184 | 185 | 186 | *window.focus_window*(window) 187 | Returns: None 188 | 189 | Switches to the `window`. 190 | 191 | 192 | *window.get_sheet_index*(sheet) 193 | Returns: (int, int) 194 | 195 | Returns the group, and index within the group of the `sheet`. Returns `-1` 196 | if not found. 197 | 198 | 199 | *window.set_sheet_index*(sheet, group, index) 200 | Returns: None 201 | 202 | Moves the `sheet` to the given `group` and `index`. 203 | 204 | 205 | *window.get_view_index*(view) 206 | Returns: (int, int) 207 | 208 | Returns the group, and index within the group of the `view`. Returns `-1` 209 | if not found. 210 | 211 | 212 | *window.set_view_index*(view, group, index) 213 | Returns: None 214 | 215 | Moves the `view` to the given `group` and `index`. 216 | 217 | 218 | *window.layout*() `[UNDOCUMENTED]` 219 | Returns: dict 220 | 221 | Returns a dictionary with keys `rows`, `colls` and `cells` which describes 222 | the current layout of the window. 223 | 224 | 225 | *window.get_layout*() `[UNDOCUMENTED]` `[DEPRECATED]` 226 | Returns: dict 227 | 228 | Returns the window layout. This is deprecated, use |:window.layout:layout()| instead. 229 | 230 | 231 | *window.set_layout*(layout) `[UNDOCUMENTED]` 232 | Returns: None 233 | 234 | Alter the layout of the window based on the passed in `layout` dictionary, 235 | which should be in the same form as returned from |:window.layout:layout()|. 236 | 237 | 238 | *window.status_message*(msg) 239 | Returns: None 240 | 241 | Show a message in the status bar. 242 | 243 | 244 | *window.bring_to_front*() `[>=4067]` 245 | Returns: None 246 | 247 | Brings the window in front of any other windows 248 | 249 | 250 | *window.is_menu_visible*() 251 | Returns: bool 252 | 253 | Returns `True` if the menu is visible. 254 | 255 | 256 | *window.set_menu_visible*(flag) 257 | Returns: None 258 | 259 | Controls if the menu is visible. 260 | 261 | 262 | *window.is_sidebar_visible*() 263 | Returns: bool 264 | 265 | Returns `True` if the sidebar will be shown when contents are available. 266 | 267 | 268 | *window.set_sidebar_visible*(flag) 269 | Returns: None 270 | 271 | Sets the sidebar to be shown or hidden when contents are available. 272 | 273 | 274 | *window.get_tabs_visible*() 275 | Returns: bool 276 | 277 | Returns `True` if tabs will be shown for open files. 278 | 279 | 280 | *window.set_tabs_visible*(flag) 281 | Returns: None 282 | 283 | Controls if tabs will be shown for open files. 284 | 285 | 286 | *window.is_minimap_visible*() 287 | Returns: bool 288 | 289 | Returns `True` if the minimap is enabled. 290 | 291 | 292 | *window.set_minimap_visible*(flag) 293 | Returns: None 294 | 295 | Controls the visibility of the minimap. 296 | 297 | 298 | *window.is_status_bar_visible*() 299 | Returns: bool 300 | 301 | Returns `True` if the status bar will be shown. 302 | 303 | 304 | *window.set_status_bar_visible*(flag) 305 | Returns: None 306 | 307 | Controls the visibility of the status bar. 308 | 309 | 310 | *window.settings*() `[UNDOCUMENTED]` 311 | Returns: |Settings| 312 | 313 | Returns a per-window settings object. The contents of these settings are 314 | persisted in the session. 315 | 316 | 317 | *window.template_settings*() `[UNDOCUMENTED]` 318 | Returns: |Settings| 319 | 320 | Returns a per-windows settings object. The contents of these settings are 321 | persisted in the session, and duplicated into new windows. 322 | 323 | 324 | *window.folders*() 325 | Returns: [str] 326 | 327 | Returns a list of the currently open folders. 328 | 329 | 330 | *window.project_file_name*() 331 | Returns: str 332 | 333 | Returns name of the currently opened project file, if any. 334 | 335 | 336 | *window.workspace_file_name*() `[>=4050]` 337 | Returns: str 338 | 339 | Returns name of the currently opened workspace file, if any. 340 | 341 | 342 | *window.project_data*() 343 | Returns: dict 344 | 345 | Returns the project data associated with the current window. The data is in 346 | the same format as the contents of a `.sublime-project` file. 347 | 348 | 349 | *window.set_project_data*(data) 350 | Returns: None 351 | 352 | Updates the project data associated with the current window. If the window 353 | is associated with a `.sublime-project` file, the project file will be 354 | updated on disk, otherwise the window will store the data internally. 355 | 356 | 357 | *window.run_command*(cmd, ) 358 | Returns: None 359 | 360 | Runs the named |WindowCommand| with the (optional) given `args`. This 361 | method is able to run any sort of command, dispatching the command via 362 | input focus. 363 | 364 | 365 | *window.show_quick_panel*(items, on_select, , , 366 | ) 367 | Returns: None 368 | 369 | Shows a quick panel, to select an item in a list. `on_select` will be 370 | called once, with the index of the selected item. If the quick panel was 371 | cancelled, `on_select` will be called with an argument of -1. 372 | 373 | `items` may be a list of strings, or a list of string lists. In the latter 374 | case, each entry in the quick panel will show multiple rows. 375 | 376 | `flags` is a bitwise OR of `sublime.MONOSPACE_FONT` and 377 | `sublime.KEEP_OPEN_ON_FOCUS_LOST` 378 | 379 | `on_highlight`, if given, will be called every time the highlighted item 380 | in the quick panel is changed. 381 | 382 | 383 | *window.show_input_panel*(caption, initial_text, on_done, on_change, on_cancel) 384 | Returns: |View| 385 | 386 | Shows the input panel, to collect a line of input from the user. `on_done` 387 | and `on_change`, if not `None`, should both be functions that expect a 388 | single string argument. `on_cancel` should be a function that expects no 389 | arguments. The view used for the input widget is returned. 390 | 391 | 392 | *window.create_output_panel*(name, ) 393 | Returns: |View| 394 | 395 | Returns the view associated with the named output panel, creating it if 396 | required. The output panel can be shown by running the `show_panel` window 397 | command, with the `panel` argument set to the name with an `"output."` 398 | prefix. 399 | 400 | The optional `unlisted` parameter is a boolean to control if the output 401 | panel should be listed in the panel switcher. 402 | 403 | 404 | *window.get_output_panel*(name) `[UNDOCUMENTED]` `[DEPRECATED]` 405 | Returns: |View| 406 | 407 | Returns the view associated with the named output panel. This method is 408 | deprecated; use |:window.create_output_panel:create_output_panel()| instead. 409 | 410 | 411 | *window.find_output_panel*(name) 412 | Returns: |View| or None 413 | 414 | Returns the view associated with the named output panel, or `None` if the 415 | output panel does not exist. 416 | 417 | 418 | *window.destroy_output_panel*(name) 419 | Returns: None 420 | 421 | Destroys the named output panel, hiding it if currently open. 422 | 423 | 424 | *window.active_panel*() 425 | Returns: str or None 426 | 427 | Returns the name of the currently open panel, or `None` if no panel is 428 | open. Will return built-in panel names (e.g. `"console"`, `"find"`, etc) in 429 | addition to output panels. 430 | 431 | 432 | *window.panels*() 433 | Returns: [str] 434 | 435 | Returns a list of the names of all panels that have not been marked as 436 | unlisted. Includes certain built-in panels in addition to output panels. 437 | 438 | 439 | *window.lookup_symbol_in_index*(symbol) 440 | Returns: [|location|] 441 | 442 | Returns all locations where the symbol is defined across files in the 443 | current project. 444 | 445 | 446 | *window.lookup_symbol_in_open_files*(symbol) 447 | Returns: [|location|] 448 | 449 | Returns all locations where the symbol is defined across open files. 450 | 451 | 452 | *window.lookup_references_in_index*(symbol) `[UNDOCUMENTED]` 453 | Returns: [|location|] 454 | 455 | Returns all locations where the symbol is referenced across files in the 456 | current project. 457 | 458 | 459 | *window.lookup_references_in_open_files*(symbol) `[UNDOCUMENTED]` 460 | Returns: [|location|] 461 | 462 | Returns all locations where the symbol is referenced across open files. 463 | 464 | 465 | *window.extract_variables*() 466 | Returns: dict 467 | 468 | Returns a dictionary of strings populated with contextual keys: 469 | 470 | `packages`, `platform`, `file`, `file_path`, `file_name`, `file_base_name`, 471 | `file_extension`, `folder`, `project`, `project_path`, `project_name`, 472 | `project_base_name`, `project_extension`. This dict is suitable for passing 473 | to `sublime.expand_variables()`. 474 | 475 | 476 | -------------------------------------------------------------------------------- 477 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/view.txt: -------------------------------------------------------------------------------- 1 | %hyperhelp title="sublime.View Class" date="2020-07-30" 2 | 3 | 4 | # view:View Class 5 | ============ 6 | 7 | Represents a view into a text buffer. Note that multiple views may refer to the 8 | same buffer, but they have their own unique selection and geometry. 9 | 10 | This class is contained in the |sublime| module. 11 | 12 | 13 | *view.__len__*() `[UNDOCUMENTED]` 14 | Returns: int 15 | 16 | Returns the number of character in the file. 17 | 18 | 19 | *view.__eq__*(rhs) `[UNDOCUMENTED]` 20 | Returns: value 21 | 22 | Determines if `rhs` is a `view` that is associated with the same |:view.id:view.id()| 23 | or not (i.e. that it represents the same view). 24 | 25 | 26 | *view.__bool__*() `[UNDOCUMENTED]` 27 | Returns: bool 28 | 29 | Returns `True` if the |:view.id:view.id()| of this view is not 0 or `False` 30 | otherwise. 31 | 32 | 33 | *view.id*() 34 | Returns: int 35 | 36 | Returns a number that uniquely identifies this view. 37 | 38 | 39 | *view.buffer_id*() 40 | Returns: int 41 | 42 | Returns a number that uniquely identifies the buffer underlying this view. 43 | 44 | 45 | *view.is_valid*() `[UNDOCUMENTED]` 46 | Returns: bool 47 | 48 | Returns a boolean indicating if this view object is valid or not. A view 49 | becomes invalid if it is no longer attached to a buffer. 50 | 51 | 52 | *view.is_primary*() 53 | Returns: bool 54 | 55 | If the view is the primary view into a file. Will only be `False` if the 56 | user has opened multiple views into a file. 57 | 58 | 59 | *view.file_name*() 60 | Returns: str 61 | 62 | The full name file the file associated with the buffer, or `None` if it 63 | doesn't exist on disk. 64 | 65 | 66 | *view.retarget*(new_file_name) `[UNDOCUMENTED]` 67 | Returns: None 68 | 69 | Changes the file name associated with the view to the one passed in. All 70 | future save operations will be done using this file name. 71 | 72 | 73 | *view.meta_info*(key, point) `[UNDOCUMENTED]` 74 | Returns: value 75 | 76 | Obtain the metadata information (i.e. information stored in `tmPreferences` 77 | files) for the provided `key`. For metadata that is scoped, the scope at the 78 | `point` provided is used to determine which meta information to return. 79 | 80 | 81 | *view.name*() 82 | Returns: str 83 | 84 | The name assigned to the buffer, if any 85 | 86 | 87 | *view.set_name*(name) 88 | Returns: None 89 | 90 | Assigns a name to the buffer 91 | 92 | 93 | *view.is_loading*() 94 | Returns: bool 95 | 96 | Returns `True` if the buffer is still loading from disk, and not ready for 97 | use. 98 | 99 | 100 | *view.close*() `[UNDOCUMENTED]` 101 | Returns: bool 102 | 103 | Attempts to close the current view, possibly prompting the user if they 104 | wish to throw away unsaved changes. A `bool` is returned that indicates if 105 | the view was actually closed or not. 106 | 107 | 108 | *view.is_dirty*() 109 | Returns: bool 110 | 111 | Returns `True` if there are any unsaved modifications to the buffer. 112 | 113 | 114 | *view.is_read_only*() 115 | Returns: bool 116 | 117 | Returns `True` if the buffer may not be modified. 118 | 119 | 120 | *view.set_read_only*(read_only) 121 | Returns: None 122 | 123 | Sets the read only property on the buffer. 124 | 125 | 126 | *view.is_scratch*() 127 | Returns: bool 128 | 129 | Returns `True` if the buffer is a scratch buffer. Scratch buffers never 130 | report as being dirty. 131 | 132 | 133 | *view.set_scratch*(scratch) 134 | Returns: None 135 | 136 | Sets the scratch property on the buffer. 137 | 138 | 139 | *view.settings*() 140 | Returns: |Settings| 141 | 142 | Returns a reference to the view's settings object. Any changes to this 143 | settings object will be private to this view. 144 | 145 | 146 | *view.element*() `[>=4050]` 147 | Returns: str or None 148 | 149 | Returns `None` for normal views, for views that comprise part of the UI, a 150 | `str` is returned from the following list: 151 | 152 | * `"console:input"` 153 | The console input 154 | 155 | * `"goto_anything:input"` 156 | The input for the Goto Anything 157 | 158 | * `"command_palette:input"` 159 | The input for the Command Palette 160 | 161 | * `"find:input"` 162 | The input for the Find panel 163 | 164 | * `"incremental_find:input"` 165 | The input for the Incremental Find panel 166 | 167 | * `"replace:input:find"` 168 | The Find input for the Replace panel 169 | 170 | * `"replace:input:replace"` 171 | The Replace input for the Replace panel 172 | 173 | * `"find_in_files:input:find"` 174 | The Find input for the Find in Files panel 175 | 176 | * `"find_in_files:input:location"` 177 | The Where input for the Find in Files panel 178 | 179 | * `"find_in_files:input:replace"` 180 | The Replace input for the Find in Files panel 181 | 182 | * `"find_in_files:output"` 183 | The output panel for Find in Files (buffer or output panel) 184 | 185 | * `"input:input"` 186 | The input for the Input panel 187 | 188 | * `"exec:output"` 189 | The output for the exec command 190 | 191 | * `"output:output"` 192 | A general output panel 193 | 194 | The console output, indexer status output and license input controls are 195 | not accessible via the API. 196 | 197 | 198 | *view.window*() 199 | Returns: |Window| 200 | 201 | Returns a reference to the window containing the view. 202 | 203 | 204 | *view.run_command*(cmd, ) 205 | Returns: None 206 | 207 | Runs the named |TextCommand| with the (optional) given `args`. 208 | 209 | 210 | *view.size*() 211 | Returns: int 212 | 213 | Returns the number of character in the file. 214 | 215 | 216 | *view.substr*(region) 217 | Returns: str 218 | 219 | Returns the contents of the `region` as a string. 220 | 221 | 222 | *_none:view.substr*(point) 223 | Returns: str 224 | 225 | Returns the character to the right of the `point`. 226 | 227 | 228 | *view.insert*(edit, point, text) 229 | Returns: int 230 | 231 | Inserts the given `string` in the buffer at the specified `point`. Returns 232 | the number of characters inserted: this may be different if tabs are being 233 | translated into spaces in the current buffer. 234 | 235 | 236 | *view.erase*(edit, region) 237 | Returns: None 238 | 239 | Erases the contents of the `region` from the buffer. 240 | 241 | 242 | *view.replace*(edit, region, text) 243 | Returns: None 244 | 245 | Replaces the contents of the `region` with the given `string`. 246 | 247 | 248 | *view.sel*() 249 | Returns: |Selection| 250 | 251 | Returns a reference to the selection. 252 | 253 | 254 | *view.has_non_empty_selection_region*() `[UNDOCUMENTED]` 255 | Returns: bool 256 | 257 | Returns `True` if the `view` contains at least one `selection` with a 258 | length larger than `0`. 259 | 260 | 261 | *view.line*(point) 262 | Returns: |Region| 263 | 264 | Returns the line that contains the `point`. 265 | 266 | 267 | *_none:view.line*(region) 268 | Returns: |Region| 269 | 270 | Returns a modified copy of `region` such that it starts at the beginning of 271 | a line, and ends at the end of a line. Note that it may span several lines. 272 | 273 | 274 | *view.full_line*(point) 275 | Returns: |Region| 276 | 277 | As `line()`, but the region includes the trailing newline character, if 278 | any. 279 | 280 | 281 | *_none:view.full_line*(region) 282 | Returns: |Region| 283 | 284 | As `line()`, but the region includes the trailing newline character, if 285 | any. 286 | 287 | 288 | *view.lines*(region) 289 | Returns: [|Region|] 290 | 291 | Returns a list of lines (in sorted order) intersecting the `region`. 292 | 293 | 294 | *view.split_by_newlines*(region) 295 | Returns: [|Region|] 296 | 297 | Splits the `region` up such that each region returned exists on exactly one 298 | line. 299 | 300 | 301 | *view.word*(point) 302 | Returns: |Region| 303 | 304 | Returns the word that contains the `point`. 305 | 306 | 307 | *_none:view.word*(region) 308 | Returns: |Region| 309 | 310 | Returns a modified copy of `region` such that it starts at the beginning of 311 | a word, and ends at the end of a word. Note that it may span several words. 312 | 313 | 314 | *view.classify*(point) 315 | Returns: int 316 | 317 | Classifies `point`, returning a bitwise OR of zero or more of these flags: 318 | 319 | * `sublime.CLASS_WORD_START` 320 | * `sublime.CLASS_WORD_END` 321 | * `sublime.CLASS_PUNCTUATION_START` 322 | * `sublime.CLASS_PUNCTUATION_END` 323 | * `sublime.CLASS_SUB_WORD_START` 324 | * `sublime.CLASS_SUB_WORD_END` 325 | * `sublime.CLASS_LINE_START` 326 | * `sublime.CLASS_LINE_END` 327 | * `sublime.CLASS_EMPTY_LINE` 328 | 329 | 330 | *view.find_by_class*(point, forward, classes, ) 331 | Returns: |Region| 332 | 333 | Finds the next location after point that matches the given `classes`. If 334 | `forward` is `False`, searches backwards instead of forwards. `classes` is 335 | a bitwise OR of the `sublime.CLASS_XXX` flags. `separators` may be passed 336 | in, to define what characters should be considered to separate words. 337 | 338 | 339 | *view.expand_by_class*(point, classes, ) 340 | Returns: |Region| 341 | 342 | Expands `point` to the left and right, until each side lands on a location 343 | that matches `classes`. `classes` is a bitwise OR of the 344 | `sublime.CLASS_XXX` flags. separators may be passed in, to define what 345 | characters should be considered to separate words. 346 | 347 | 348 | *_none:view.expand_by_class*(region, classes, ) 349 | Returns: |Region| 350 | 351 | Expands `region` to the left and right, until each side lands on a location 352 | that matches `classes`. `classes` is a bitwise OR of the 353 | `sublime.CLASS_XXX` flags. `separators` may be passed in, to define what 354 | characters should be considered to separate words. 355 | 356 | 357 | *view.find*(pattern, start_point, ) 358 | Returns: |Region| 359 | 360 | Returns the first region matching the regex `pattern`, starting from 361 | `start_point`, or `None` if it can't be found. The optional `flags` 362 | parameter may be `sublime.LITERAL`, `sublime.IGNORECASE`, or the two ORed 363 | together. 364 | 365 | 366 | *view.find_all*(pattern, , , ) 367 | Returns: [|Region|] 368 | 369 | Returns all (non-overlapping) regions matching the regex `pattern`. The 370 | optional `flags` parameter may be `sublime.LITERAL`, `sublime.IGNORECASE`, 371 | or the two ORed together. If a `format` string is given, then all matches 372 | will be formatted with the formatted string and placed into the extractions 373 | list. 374 | 375 | 376 | *view.rowcol*(point) 377 | Returns: (int, int) 378 | 379 | Calculates the 0-based line and column numbers of the `point`. Column 380 | numbers are returned as number of Unicode characters. 381 | 382 | 383 | *view.rowcol_utf8*() `[>=4050]` 384 | Returns: (int, int) 385 | 386 | Calculates the 0-based line and column numbers of the `point`. Column 387 | numbers are returned as UTF-8 code units, i.e. bytes. 388 | 389 | 390 | *view.rowcol_utf16*() `[>=4050]` 391 | Returns: (int, int) 392 | 393 | Calculates the 0-based line and column numbers of the `point`. Column 394 | numbers are returned as UTF-16 code units, i.e. byte pairs. 395 | 396 | 397 | *view.text_point*(row, col) 398 | Returns: int 399 | 400 | Calculates the character offset of the given, 0-based, `row` and `col`. 401 | `col` is interpreted as the number of Unicode characters to advance past 402 | the beginning of the row. 403 | 404 | 405 | *view.text_point_utf8*() `[>=4050]` 406 | Returns: (int, int) 407 | 408 | Calculates the character offset of the given, 0-based, `row` and `col`. 409 | `col` is interpreted as the number of UTF-8 code units, i.e. bytes, to 410 | advance past the beginning of the row. 411 | 412 | 413 | *view.text_point_utf16*() `[>=4050]` 414 | Returns: (int, int) 415 | 416 | Calculates the character offset of the given, 0-based, `row` and `col`. 417 | `col` is interpreted as the number of UTF-16 code units, i.e. byte pairs, 418 | to advance past the beginning of the row. 419 | 420 | 421 | *view.assign_syntax*(syntax_file) `[UNDOCUMENTED]` 422 | Returns: None 423 | 424 | Changes the syntax used by the view. `syntax_file` should be a name along 425 | the lines of `Packages/Python/Python.tmLanguage`. To retrieve the current 426 | syntax, use `view.settings().get('syntax')`. 427 | 428 | 429 | *view.set_syntax_file*(syntax_file) `[DEPRECATED]` 430 | Returns: None 431 | 432 | Changes the syntax used by the view. `syntax_file` should be a name along 433 | the lines of `Packages/Python/Python.tmLanguage`. To retrieve the current 434 | syntax, use `view.settings().get('syntax')`. 435 | 436 | This function is deprecated; you should use |:view.assign_syntax:assign_syntax| instead. 437 | 438 | 439 | *view.extract_scope*(point) 440 | Returns: |Region| 441 | 442 | Returns the extent of the syntax scope name assigned to the character at 443 | the given `point`. 444 | 445 | 446 | *view.scope_name*(point) 447 | Returns: str 448 | 449 | Returns the syntax scope name assigned to the character at the given 450 | `point`. 451 | 452 | 453 | *view.match_selector*(point, selector) 454 | Returns: bool 455 | 456 | Checks the `selector` against the scope at the given `point`, returning a 457 | bool if they match. 458 | 459 | 460 | *view.score_selector*(point, selector) 461 | Returns: int 462 | 463 | Matches the `selector` against the scope at the given `point`, returning a 464 | score. A score of `0` means no match, above `0` means a match. Different 465 | selectors may be compared against the same scope: a higher score means the 466 | selector is a better match for the scope. 467 | 468 | 469 | *view.find_by_selector*(selector) 470 | Returns: [|Region|] 471 | 472 | Finds all regions in the file matching the given `selector`, returning them 473 | as a list. 474 | 475 | 476 | *view.show*(location, ) 477 | Returns: None 478 | 479 | Scroll the view to show the given `location`, which may be a |point|, 480 | |Region| or |Selection|. 481 | 482 | 483 | *view.show_at_center*(location) 484 | Returns: None 485 | 486 | Scroll the view to center on the `location`, which may be a |point| or 487 | |Region|. 488 | 489 | 490 | *view.visible_region*() 491 | Returns: |Region| 492 | 493 | Returns the currently visible area of the view. 494 | 495 | 496 | *view.viewport_position*() 497 | Returns: |vector| 498 | 499 | Returns the offset of the viewport in layout coordinates. 500 | 501 | 502 | *view.set_viewport_position*(vector, ) 503 | Returns: None 504 | 505 | Scrolls the viewport to the given layout position. 506 | 507 | 508 | *view.viewport_extent*() 509 | Returns: |vector| 510 | 511 | Returns the width and height of the viewport. 512 | 513 | 514 | *view.layout_extent*() 515 | Returns: |vector| 516 | 517 | Returns the width and height of the layout. 518 | 519 | 520 | *view.text_to_layout*(point) 521 | Returns: |vector| 522 | 523 | Converts a text point to a layout position 524 | 525 | 526 | *view.text_to_window*(point) 527 | Returns: |vector| 528 | 529 | Converts a text point to a window position 530 | 531 | 532 | *view.layout_to_text*(vector) 533 | Returns: |point| 534 | 535 | Converts a layout position to a text point 536 | 537 | 538 | *view.layout_to_window*(vector) 539 | Returns: |vector| 540 | 541 | Converts a layout position to a window position 542 | 543 | 544 | *view.window_to_layout*(vector) 545 | Returns: |vector| 546 | 547 | Converts a window position to a layout position 548 | 549 | 550 | *view.window_to_text*(vector) 551 | Returns: |point| 552 | 553 | Converts a window position to a text point 554 | 555 | 556 | *view.line_height*() 557 | Returns: |dip| 558 | 559 | Returns the light height used in the layout 560 | 561 | 562 | *view.em_width*() 563 | Returns: |dip| 564 | 565 | Returns the typical character width used in the layout 566 | 567 | 568 | *view.add_regions*(key, [regions], , , , , 569 | , , ) [] 570 | Returns: None 571 | 572 | +--------------------------------------------------------------------------+ 573 | | Some capabilities and arguments of this API method depend on the version | 574 | | of Sublime Text being used; see below for details. | 575 | +--------------------------------------------------------------------------+ 576 | 577 | Adds visual indicators to regions of text in the view. Indicators include 578 | icons in the gutter, underlines under the text, borders around the text and 579 | annotations. Annotations are drawn aligned to the right-hand edge of the 580 | view and may contain HTML markup. 581 | 582 | * `key` 583 | A unicode string identifying the collection of regions. If a set of 584 | regions already exists with the same key, they will be overwritten. 585 | 586 | * `scope` 587 | An optional unicode string used to source a color to draw the `regions` 588 | in. The `scope` is matched against the color scheme. Examples include: 589 | `"invalid"` and `"string"`. See |Scope Naming| for a list of common 590 | scopes. If the `scope` is empty, the `regions` won't be drawn. 591 | 592 | Also supports the following pseudo-scopes, to allow picking the closest 593 | color from the user‘s color scheme: `[>=3148]` 594 | 595 | * `"region.redish"` 596 | * `"region.orangish"` 597 | * `"region.yellowish"` 598 | * `"region.greenish"` 599 | * `"region.cyanish"` 600 | * `"region.bluish"` 601 | * `"region.purplish"` 602 | * `"region.pinkish"` 603 | 604 | * `icon` 605 | An optional unicode string specifying an icon to draw in the gutter 606 | next to each region. The `icon` will be tinted using the color 607 | associated with the `scope`. Standard icon names are `"dot"`, 608 | `"circle"` and `"bookmark"`. The `icon` may also be a full 609 | package-relative path, such as `"Packages/Theme - Default/dot.png"`. 610 | 611 | * `flags` 612 | An optional bitwise combination of zero or more of: 613 | 614 | * `sublime.DRAW_EMPTY` 615 | Draw empty regions with a vertical bar. By default, they aren't 616 | drawn at all. 617 | 618 | * `sublime.HIDE_ON_MINIMAP` 619 | Don't show the regions on the minimap. 620 | 621 | * `sublime.DRAW_EMPTY_AS_OVERWRITE` 622 | Draw empty regions with a horizontal bar instead of a vertical 623 | one. 624 | 625 | * `sublime.DRAW_NO_FILL` 626 | Disable filling the regions, leaving only the outline. 627 | 628 | * `sublime.DRAW_NO_OUTLINE` 629 | Disable drawing the outline of the regions. 630 | 631 | * `sublime.DRAW_SOLID_UNDERLINE` 632 | Draw a solid underline below the regions. 633 | 634 | * `sublime.DRAW_STIPPLED_UNDERLINE` 635 | Draw a stippled underline below the regions. 636 | 637 | * `sublime.DRAW_SQUIGGLY_UNDERLINE` 638 | Draw a squiggly underline below the regions. 639 | 640 | * `sublime.PERSISTENT` 641 | Save the regions in the session. 642 | 643 | * `sublime.HIDDEN` 644 | Don't draw the regions. 645 | 646 | The underline styles are exclusive, either zero or one of them should be 647 | given. If using an underline, `sublime.DRAW_NO_FILL` and 648 | `sublime.DRAW_NO_OUTLINE` should generally be passed in. 649 | 650 | * `annotations` `[>=4050]` 651 | An optional collection of unicode strings containing HTML documents to 652 | display along the right-hand edge of the view. There should be the same 653 | number of `annotations` as regions. See |:minihtml:minihtml Reference| for 654 | supported HTML. 655 | 656 | * `annotations_color` `[>=4050]` 657 | A optional unicode string of the CSS color to use when drawing the left 658 | border of the annotation. See |:minihtml colors:minihtml Reference: Colors| for 659 | supported color formats. 660 | 661 | * `on_navigate` `[>=4050]` 662 | A callback that will be passed the `href` when a link in an annotation 663 | is clicked. 664 | 665 | * `on_close` `[>=4050]` 666 | A callback that will be called when the annotations are closed. 667 | 668 | 669 | *view.get_regions*(key) 670 | Returns: [|Region|] 671 | 672 | Return the regions associated with the given `key`, if any 673 | 674 | 675 | *view.erase_regions*(key) 676 | Returns: None 677 | 678 | Removed the named regions 679 | 680 | 681 | *view.add_phantom*(key) `[UNDOCUMENTED]` 682 | Returns: ??? 683 | 684 | This API endpoint is used internally by |PhantomSet| to manage |:phantom:phantoms| 685 | in the current view. You should use that class rather than this method. 686 | 687 | 688 | *view.erase_phantoms*(key) `[UNDOCUMENTED]` 689 | Returns: ??? 690 | 691 | This API endpoint is used internally by |PhantomSet| to manage |:phantom:phantoms| 692 | in the current view. You should use that class rather than this method. 693 | 694 | 695 | *view.erase_phantom_by_id*(id) `[UNDOCUMENTED]` 696 | Returns: ??? 697 | 698 | This API endpoint is used internally by |PhantomSet| to manage |:phantom:phantoms| 699 | in the current view. You should use that class rather than this method. 700 | 701 | 702 | *view.query_phantom*(id) `[UNDOCUMENTED]` 703 | Returns: ??? 704 | 705 | This API endpoint is used internally by |PhantomSet| to manage |:phantom:phantoms| 706 | in the current view. You should use that class rather than this method. 707 | 708 | 709 | *view.query_phantoms*(ids) `[UNDOCUMENTED]` 710 | Returns: ??? 711 | 712 | This API endpoint is used internally by |PhantomSet| to manage |:phantom:phantoms| 713 | in the current view. You should use that class rather than this method. 714 | 715 | 716 | *view.set_status*(key, value) 717 | Returns: None 718 | 719 | Adds the status `key` to the view. The `value` will be displayed in the 720 | status bar, in a comma separated list of all status values, ordered by key. 721 | Setting the `value` to the empty string will clear the status. 722 | 723 | 724 | *view.get_status*(key) 725 | Returns: str 726 | 727 | Returns the previously assigned value associated with the `key`, if any. 728 | 729 | 730 | *view.erase_status*(key) 731 | Returns: None 732 | 733 | Clears the named status. 734 | 735 | 736 | *view.command_history*(index, ) 737 | Returns: (str, dict, int) 738 | 739 | Returns the command name, command arguments, and repeat count for the given 740 | history entry, as stored in the undo / redo stack. 741 | 742 | Index `0` corresponds to the most recent command, `-1` the command before 743 | that, and so on. Positive values for index indicate to look in the redo 744 | stack for commands. If the undo / redo history doesn't extend far enough, 745 | then `(None, None, 0)` will be returned. 746 | 747 | Setting `modifying_only` to `True` (the default is `False`) will only 748 | return entries that modified the buffer. 749 | 750 | 751 | *view.indexed_symbols*() `[UNDOCUMENTED]` 752 | Returns: [|symbolref|] 753 | 754 | Returns a list of all of the indexed symbols in the current view, along 755 | with the location where the symbol is defined in the view. 756 | 757 | As the name suggests, this lists only `indexed` symbols; that is, symbols 758 | for which `showInIndexedSymbolList` is set to `1` in a `tmPreferences` 759 | meta file. 760 | 761 | 762 | *view.indexed_references*() `[UNDOCUMENTED]` 763 | Returns: [|symbolref|] 764 | 765 | Returns a list of all of the places where an indexed symbol is referenced 766 | in the current view, along with the location where the reference to the 767 | symbol occurs. The same symbol may appear in the list more than once if it 768 | is referenced more than once. 769 | 770 | As the name suggests, this lists only references to `indexed` symbols; that 771 | is, symbols for which `showInIndexedSymbolList` is set to `1` in a 772 | `tmPreferences` meta file. 773 | 774 | 775 | *view.extract_completions*(prefix, ) `[UNDOCUMENTED]` 776 | Returns: [str] 777 | 778 | Return a list of all completions from the current view that match the given 779 | `prefix` string. 780 | 781 | 782 | *view.find_all_results*() `[UNDOCUMENTED]` 783 | Returns: [|resultref|] 784 | 785 | Return a list of all matches found as a result of applying the 786 | `result_file_regex` and `line_file_regex` settings to the view. These 787 | settings correspond to the |SublimeBuild::file_regex| and |SublimeBuild::line_regex| settings in a 788 | |SublimeBuild:index.txt:sublime-build| file. 789 | 790 | The list of returned items contains the absolute filename of the filename 791 | portion of the match as well as the row and column portions, if they 792 | matched. 793 | 794 | 795 | *view.find_all_results_with_text*() `[UNDOCUMENTED]` 796 | Returns: [|resultref|] 797 | 798 | This operates as |::find_all_results| with the exception that the returned 799 | list of results also includes the "message" portion of the result match 800 | (e.g. the error message associated with an error in a build system). 801 | 802 | 803 | *view.change_count*() 804 | Returns: int 805 | 806 | Returns the current change count. Each time the buffer is modified, the 807 | change count is incremented. The change count can be used to determine if 808 | the buffer has changed since the last it was inspected. 809 | 810 | 811 | *view.change_id*() `[>=4069]` 812 | Returns: (int, int, int) 813 | 814 | Returns a 3-element tuple that can be passed to |:transform_region_from:transform_region_from()| 815 | to obtain a region equivalent to a region of the `View` in the past. This 816 | is primarily useful for plugins providing text modification that must 817 | operate in an asynchronous fashion and must be able to handle the view 818 | contents changing between the request and response. 819 | 820 | 821 | *view.transform_region_from*(region, change_id) `[>=4069]` 822 | Returns: |Region| 823 | 824 | Transforms a region from a previous point in time to an equivalent region 825 | in the current state of the `View`. The `change_id` must have been obtained 826 | from |:change_id:change_id()| at the point in time the region is from. 827 | 828 | 829 | *view.fold*([regions]) 830 | Returns: bool 831 | 832 | Folds the given `regions`, returning `False` if they were already folded 833 | 834 | 835 | *_none:view.fold*(region) 836 | Returns: bool 837 | 838 | Folds the given `region`, returning `False` if it was already folded 839 | 840 | 841 | *view.unfold*(region) 842 | Returns: [|Region|] 843 | 844 | Unfolds all text in the `region`, returning the unfolded regions 845 | 846 | 847 | *_none:view.unfold*([regions]) 848 | Returns: [|Region|] 849 | 850 | Unfolds all text in the `regions`, returning the unfolded regions 851 | 852 | 853 | *view.is_folded*(region) `[UNDOCUMENTED]` 854 | Returns: bool 855 | 856 | Determines if the `region` provided is currently folded or not. The region 857 | must be entirely folded in order for `True` to be returned. 858 | 859 | 860 | *view.folded_regions*() `[UNDOCUMENTED]` 861 | Returns: [|Region|] 862 | 863 | Returns a list of `regions` that are currently folded. The list may be 864 | empty if no text is currently folded. 865 | 866 | 867 | *view.indented_region*(point) `[UNDOCUMENTED]` 868 | Returns: |Region| 869 | 870 | Returns a `region` that encompasses all lines surrounding the line 871 | containing the given `point` where the |:view.indentation_level:indentation level| is greater than 872 | or equal to the indent at the `point`. 873 | 874 | If the level of indent at the given `point` is `0`, the returned region is 875 | a 0-length region that specifies the start of the line containing the 876 | point. 877 | 878 | 879 | *view.indentation_level*(point) `[UNDOCUMENTED]` 880 | Returns: int 881 | 882 | Returns the level of indentation at the provided point. This is `0` at the 883 | margin, `1` for one level of indentation, etc. 884 | 885 | 886 | *view.encoding*() 887 | Returns: str 888 | 889 | Returns the encoding currently associated with the file 890 | 891 | 892 | *view.set_encoding*(encoding_name) 893 | Returns: None 894 | 895 | Applies a new encoding to the file. This encoding will be used the next 896 | time the file is saved. 897 | 898 | 899 | *view.line_endings*() 900 | Returns: str 901 | 902 | Returns the line endings used by the current file. 903 | 904 | 905 | *view.set_line_endings*(line_ending_name) 906 | Returns: None 907 | 908 | Sets the line endings that will be applied when next saving. 909 | 910 | 911 | *view.overwrite_status*() 912 | Returns: bool 913 | 914 | Returns the overwrite status, which the user normally toggles via the 915 | insert key. 916 | 917 | 918 | *view.set_overwrite_status*(enabled) 919 | Returns: None 920 | 921 | Sets the overwrite status. 922 | 923 | 924 | *view.symbols*() 925 | Returns: [(|Region|, str)] 926 | 927 | Extract all the symbols defined in the buffer. 928 | 929 | 930 | *view.show_popup_menu*(items, on_select, ) 931 | Returns: None 932 | 933 | Shows a pop up menu at the caret, to select an item in a list. `on_select` 934 | will be called once, with the index of the selected item. If the pop up 935 | menu was cancelled, `on_select` will be called with an argument of -1. 936 | 937 | `items` is a list of strings. 938 | 939 | `flags` it currently unused. 940 | 941 | 942 | *view.show_popup*(content, , , , , 943 | , ) 944 | Returns: None 945 | 946 | Shows a popup displaying HTML content. 947 | 948 | `flags` is a bitwise combination of the following: 949 | 950 | * `sublime.COOPERATE_WITH_AUTO_COMPLETE` 951 | causes the popup to display next to the auto complete menu 952 | 953 | * `sublime.HIDE_ON_MOUSE_MOVE` 954 | causes the popup to hide when the mouse is moved, clicked or scrolled 955 | 956 | * `sublime.HIDE_ON_MOUSE_MOVE_AWAY` 957 | causes the popup to hide when the mouse is moved (unless towards the 958 | popup), or when clicked or scrolled 959 | 960 | * `sublime.KEEP_ON_SELECTION_MODIFIED` `[>=4057]` 961 | prevent the popup from hiding when the selection is modified 962 | 963 | The default `location` of `-1` will display the popup at the cursor, 964 | otherwise a text point should be passed. 965 | 966 | `max_width` and `max_height` set the maximum dimensions for the popup, 967 | after which scroll bars will be displayed. 968 | 969 | `on_navigate` is a callback that should accept a string contents of the 970 | `href` attribute on the link the user clicked. 971 | 972 | `on_hide` is called when the popup is hidden. 973 | 974 | 975 | *view.update_popup*(content) 976 | Returns: None 977 | 978 | Updates the contents of the currently visible popup. 979 | 980 | 981 | *view.is_popup_visible*() 982 | Returns: bool 983 | 984 | Returns if the popup is currently shown. 985 | 986 | 987 | *view.preserve_auto_complete_on_focus_lost*() `[>=4073]` 988 | Returns: None 989 | 990 | Sets the auto complete popup state to be preserved the next time the View 991 | loses focus. When the View regains focus, the auto complete window will be 992 | re-shown, with the previously selected entry pre-selected. 993 | 994 | 995 | *view.hide_popup*() 996 | Returns: None 997 | 998 | Hides the popup. 999 | 1000 | 1001 | *view.is_auto_complete_visible*() 1002 | Returns: bool 1003 | 1004 | Returns if the auto complete menu is currently visible. 1005 | 1006 | 1007 | *view.style*() `[>=3150]` 1008 | Returns: dict 1009 | 1010 | Returns a `dict` of the global style settings for the view. All colors are 1011 | normalized to the six character hex form with a leading hash, e.g. 1012 | `#ff0000`. 1013 | 1014 | 1015 | *view.style_for_scope*(scope_name) `[>=3149]` 1016 | Returns: dict 1017 | 1018 | Accepts a string scope name and returns a `dict` of style information, 1019 | includes the keys: 1020 | 1021 | * `"foreground"` 1022 | * `"background"` (only if set) 1023 | * `"bold"` 1024 | * `"italic"` 1025 | * `"glow"` `[>=4063]` 1026 | * `"source_line"` 1027 | * `"source_column"` 1028 | * `"source_file"` 1029 | 1030 | The foreground and background colors are normalized to the six character 1031 | hex form with a leading hash, e.g. `#ff0000`. 1032 | 1033 | 1034 | *view.extract_tokens_with_scopes*(region) `[UNDOCUMENTED]` `[>=3172]` 1035 | Returns: [(|Region|, str)] 1036 | 1037 | Collect a list of all distinct tokens in the provided input region, 1038 | returning back regions that specify the location of each token and a string 1039 | that represents the scope of that token. 1040 | 1041 | 1042 | *view.set_reference_document*(content) `[>=3186]` 1043 | Returns: None 1044 | 1045 | Uses the string `reference` to calculate the initial diff for the 1046 | `incremental diff` 1047 | 1048 | 1049 | *view.reset_reference_document*(content) `[>=3190]` 1050 | Returns: None 1051 | 1052 | Clears the state of the `incremental diff` for the view 1053 | 1054 | 1055 | -------------------------------------------------------------------------------- 1056 | Sublime Text Help Copyright © Sublime HQ Pty Ltd |api_reference.html| -------------------------------------------------------------------------------- /api/hyperhelp.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": "SublimeAPI", 3 | "description": "Sublime Text API Documentation", 4 | "default_caption": "{topic}()", 5 | "doc_root": "api/", 6 | "help_files": { 7 | "index.txt": [ 8 | "Sublime Text API Documentation", 9 | ], 10 | "general.txt": [ 11 | "General Information", 12 | 13 | { 14 | "topic": "example plugins", 15 | "caption": "Example Plugins" 16 | }, 17 | { 18 | "topic": "plugin lifecycle", 19 | "caption": "Plugin Lifecycle" 20 | }, 21 | { 22 | "topic": "threading", 23 | "caption": "Threading" 24 | }, 25 | { 26 | "topic": "units and coordinates", 27 | "caption": "Units and Coordinates" 28 | }, 29 | { 30 | "topic": "types", 31 | "caption": "Types" 32 | }, 33 | { 34 | "topic": "location", 35 | "caption": "Type: location" 36 | }, 37 | { 38 | "topic": "point", 39 | "caption": "Type: point" 40 | }, 41 | { 42 | "topic": "value", 43 | "caption": "Type: value" 44 | }, 45 | { 46 | "topic": "dip", 47 | "caption": "Type: dip" 48 | }, 49 | { 50 | "topic": "vector", 51 | "caption": "Type: vector" 52 | }, 53 | { 54 | "topic": "CommandInputHandler", 55 | "caption": "Type: CommandInputHandler" 56 | }, 57 | { 58 | "topic": "symbolref", 59 | "caption": "Type: symbolref" 60 | }, 61 | { 62 | "topic": "resultref", 63 | "caption": "Type: resultref" 64 | } 65 | ], 66 | "sublime.txt": [ 67 | "sublime Module", 68 | 69 | { 70 | "topic": "sublime", 71 | "caption": "sublime Module" 72 | 73 | }, 74 | { "topic": "sublime.set_timeout", "aliases": ["set_timeout"] }, 75 | { "topic": "sublime.set_timeout_async", "aliases": ["set_timeout_async"] }, 76 | { "topic": "sublime.error_message", "aliases": ["error_message"] }, 77 | { "topic": "sublime.message_dialog", "aliases": ["message_dialog"] }, 78 | { "topic": "sublime.ok_cancel_dialog", "aliases": ["ok_cancel_dialog"] }, 79 | { "topic": "sublime.yes_no_cancel_dialog", "aliases": ["yes_no_cancel_dialog"] }, 80 | { "topic": "sublime.open_dialog", "aliases": ["open_dialog"] }, 81 | { "topic": "sublime.save_dialog", "aliases": ["save_dialog"] }, 82 | { "topic": "sublime.select_folder_dialog", "aliases": ["select_folder_dialog"] }, 83 | { "topic": "sublime.status_message" }, 84 | { "topic": "sublime.load_resource", "aliases": ["load_resource"] }, 85 | { "topic": "sublime.load_binary_resource", "aliases": ["load_binary_resource"] }, 86 | { "topic": "sublime.find_resources", "aliases": ["find_resources"] }, 87 | { "topic": "sublime.list_syntaxes", "aliases": ["list_syntaxes"] }, 88 | { "topic": "sublime.find_syntax", "aliases": ["find_syntax"] }, 89 | { "topic": "sublime.encode_value", "aliases": ["encode_value"] }, 90 | { "topic": "sublime.decode_value", "aliases": ["decode_value"] }, 91 | { "topic": "sublime.expand_variables", "aliases": ["expand_variables"] }, 92 | { "topic": "sublime.load_settings", "aliases": ["load_settings"] }, 93 | { "topic": "sublime.save_settings", "aliases": ["save_settings"] }, 94 | { "topic": "sublime.windows", "aliases": ["windows"] }, 95 | { "topic": "sublime.active_window", "aliases": ["active_window"] }, 96 | { "topic": "sublime.packages_path", "aliases": ["packages_path"] }, 97 | { "topic": "sublime.installed_packages_path", "aliases": ["installed_packages_path"] }, 98 | { "topic": "sublime.executable_path", "aliases": ["executable_path"] }, 99 | { "topic": "sublime.executable_hash", "aliases": ["executable_hash"] }, 100 | { "topic": "sublime.cache_path", "aliases": ["cache_path"] }, 101 | { "topic": "sublime.get_clipboard", "aliases": ["get_clipboard"] }, 102 | { "topic": "sublime.set_clipboard", "aliases": ["set_clipboard"] }, 103 | { "topic": "sublime.score_selector" }, 104 | { "topic": "sublime.run_command" }, 105 | { "topic": "sublime.log_commands", "aliases": ["log_commands"] }, 106 | { "topic": "sublime.log_input", "aliases": ["log_input"] }, 107 | { "topic": "sublime.log_result_regex", "aliases": ["log_result_regex"] }, 108 | { "topic": "sublime.log_indexing", "aliases": ["log_indexing"] }, 109 | { "topic": "sublime.log_build_systems", "aliases": ["log_build_systems"] }, 110 | { "topic": "sublime.log_control_tree", "aliases": ["log_control_tree"] }, 111 | { "topic": "sublime.version", "aliases": ["version"] }, 112 | { "topic": "sublime.platform", "aliases": ["platform"] }, 113 | { "topic": "sublime.arch", "aliases": ["arch"] }, 114 | { "topic": "sublime.channel", "aliases": ["channel"] } 115 | ], 116 | "sheet.txt": [ 117 | "sublime.Sheet Class", 118 | 119 | { 120 | "topic": "Sheet", 121 | "caption": "sublime.Sheet Class" 122 | }, 123 | { "topic": "sheet.id" }, 124 | { "topic": "sheet.window" }, 125 | { "topic": "sheet.view" }, 126 | { "topic": "sheet.file_name" } 127 | ], 128 | "view.txt": [ 129 | "sublime.View Class", 130 | 131 | { 132 | "topic": "View", 133 | "caption": "sublime.View Class" 134 | }, 135 | 136 | { "topic": "view.__len__" }, 137 | { "topic": "view.__eq__" }, 138 | { "topic": "view.__bool__" }, 139 | 140 | { "topic": "view.id" }, 141 | { "topic": "view.is_valid" }, 142 | { "topic": "view.buffer_id", "aliases": ["buffer_id"] }, 143 | { "topic": "view.is_primary", "aliases": ["is_primary"] }, 144 | { "topic": "view.file_name", "aliases": ["file_name"] }, 145 | { "topic": "view.set_reference_document", "aliases": ["set_reference_document"] }, 146 | { "topic": "view.reset_reference_document", "aliases": ["reset_reference_document"] }, 147 | { "topic": "view.retarget", "aliases": ["retarget"] }, 148 | { "topic": "view.meta_info", "aliases": ["meta_info"] }, 149 | { "topic": "view.name", "aliases": ["name"] }, 150 | { "topic": "view.set_name", "aliases": ["set_name"] }, 151 | { "topic": "view.is_loading", "aliases": ["is_loading"] }, 152 | { "topic": "view.close", "aliases": ["close"] }, 153 | { "topic": "view.is_dirty", "aliases": ["is_dirty"] }, 154 | { "topic": "view.is_read_only", "aliases": ["is_read_only"] }, 155 | { "topic": "view.set_read_only", "aliases": ["set_read_only"] }, 156 | { "topic": "view.is_scratch", "aliases": ["is_scratch"] }, 157 | { "topic": "view.set_scratch", "aliases": ["set_scratch"] }, 158 | { "topic": "view.settings" }, 159 | { "topic": "view.element" }, 160 | { "topic": "view.window" }, 161 | { "topic": "view.run_command" }, 162 | { "topic": "view.size" }, 163 | { "topic": "view.substr", "aliases": ["substr"] }, 164 | { "topic": "view.insert", "aliases": ["insert"] }, 165 | { "topic": "view.erase" }, 166 | { "topic": "view.replace", "aliases": ["replace"] }, 167 | { "topic": "view.sel", "aliases": ["sel"] }, 168 | { "topic": "view.has_non_empty_selection_region", "aliases": ["has_non_empty_selection_region"] }, 169 | { "topic": "view.line", "aliases": ["line"] }, 170 | { "topic": "view.full_line", "aliases": ["full_line"] }, 171 | { "topic": "view.lines", "aliases": ["lines"] }, 172 | { "topic": "view.split_by_newlines", "aliases": ["split_by_newlines"] }, 173 | { "topic": "view.word", "aliases": ["word"] }, 174 | { "topic": "view.classify", "aliases": ["classify"] }, 175 | { "topic": "view.find_by_class", "aliases": ["find_by_class"] }, 176 | { "topic": "view.expand_by_class", "aliases": ["expand_by_class"] }, 177 | { "topic": "view.find", "aliases": ["find"] }, 178 | { "topic": "view.find_all", "aliases": ["find_all"] }, 179 | { "topic": "view.rowcol", "aliases": ["rowcol"] }, 180 | { "topic": "view.rowcol_utf8", "aliases": ["rowcol_utf8"] }, 181 | { "topic": "view.rowcol_utf16", "aliases": ["rowcol_utf16"] }, 182 | { "topic": "view.text_point", "aliases": ["text_point"] }, 183 | { "topic": "view.text_point_utf8", "aliases": ["text_point_utf8"] }, 184 | { "topic": "view.text_point_utf16", "aliases": ["text_point_utf16"] }, 185 | { "topic": "view.assign_syntax", "aliases": ["assign_syntax"] }, 186 | { "topic": "view.set_syntax_file", "aliases": ["set_syntax_file"] }, 187 | { "topic": "view.extract_scope", "aliases": ["extract_scope"] }, 188 | { "topic": "view.scope_name", "aliases": ["scope_name"] }, 189 | { "topic": "view.match_selector", "aliases": ["match_selector"] }, 190 | { "topic": "view.score_selector" }, 191 | { "topic": "view.find_by_selector", "aliases": ["find_by_selector"] }, 192 | { "topic": "view.show", "aliases": ["show"] }, 193 | { "topic": "view.show_at_center", "aliases": ["show_at_center"] }, 194 | { "topic": "view.visible_region", "aliases": ["visible_region"] }, 195 | { "topic": "view.viewport_position", "aliases": ["viewport_position"] }, 196 | { "topic": "view.set_viewport_position", "aliases": ["set_viewport_position"] }, 197 | { "topic": "view.viewport_extent", "aliases": ["viewport_extent"] }, 198 | { "topic": "view.layout_extent", "aliases": ["layout_extent"] }, 199 | { "topic": "view.text_to_layout", "aliases": ["text_to_layout"] }, 200 | { "topic": "view.layout_to_text", "aliases": ["layout_to_text"] }, 201 | { "topic": "view.window_to_layout", "aliases": ["window_to_layout"] }, 202 | { "topic": "view.window_to_text", "aliases": ["window_to_text"] }, 203 | { "topic": "view.line_height", "aliases": ["line_height"] }, 204 | { "topic": "view.em_width", "aliases": ["em_width"] }, 205 | { "topic": "view.add_regions", "aliases": ["add_regions"] }, 206 | { "topic": "view.get_regions", "aliases": ["get_regions"] }, 207 | { "topic": "view.add_phantom", "aliases": ["add_phantom"] }, 208 | { "topic": "view.erase_phantoms", "aliases": ["erase_phantoms"] }, 209 | { "topic": "view.erase_phantom_by_id", "aliases": ["erase_phantom_by_id"] }, 210 | { "topic": "view.query_phantom", "aliases": ["query_phantom"] }, 211 | { "topic": "view.query_phantoms", "aliases": ["query_phantoms"] }, 212 | { "topic": "view.erase_regions", "aliases": ["erase_regions"] }, 213 | { "topic": "view.set_status", "aliases": ["set_status"] }, 214 | { "topic": "view.get_status", "aliases": ["get_status"] }, 215 | { "topic": "view.erase_status", "aliases": ["erase_status"] }, 216 | { "topic": "view.command_history", "aliases": ["command_history"] }, 217 | { "topic": "view.indexed_symbols", "aliases": ["indexed_symbols"] }, 218 | { "topic": "view.indexed_references", "aliases": ["indexed_references"] }, 219 | { "topic": "view.extract_completions", "aliases": ["extract_completions"] }, 220 | { "topic": "view.find_all_results", "aliases": ["find_all_results"] }, 221 | { "topic": "view.find_all_results_with_text", "aliases": ["find_all_results_with_text"] }, 222 | { "topic": "view.change_count", "aliases": ["change_count"] }, 223 | { "topic": "view.change_id", "aliases": ["change_id"] }, 224 | { "topic": "view.transform_region_from", "aliases": ["transform_region_from"] }, 225 | { "topic": "view.fold", "aliases": ["fold"] }, 226 | { "topic": "view.unfold", "aliases": ["unfold"] }, 227 | { "topic": "view.is_folded", "aliases": ["is_folded"] }, 228 | { "topic": "view.folded_regions", "aliases": ["folded_regions"] }, 229 | { "topic": "view.indented_region", "aliases": ["indented_region"] }, 230 | { "topic": "view.indentation_level", "aliases": ["indentation_level"] }, 231 | { "topic": "view.encoding", "aliases": ["encoding"] }, 232 | { "topic": "view.set_encoding", "aliases": ["set_encoding"] }, 233 | { "topic": "view.line_endings", "aliases": ["line_endings"] }, 234 | { "topic": "view.set_line_endings", "aliases": ["set_line_endings"] }, 235 | { "topic": "view.overwrite_status", "aliases": ["overwrite_status"] }, 236 | { "topic": "view.set_overwrite_status", "aliases": ["set_overwrite_status"] }, 237 | { "topic": "view.symbols", "aliases": ["symbols"] }, 238 | { "topic": "view.show_popup_menu", "aliases": ["show_popup_menu"] }, 239 | { "topic": "view.show_popup", "aliases": ["show_popup"] }, 240 | { "topic": "view.update_popup", "aliases": ["update_popup"] }, 241 | { "topic": "view.is_popup_visible", "aliases": ["is_popup_visible"] }, 242 | { "topic": "view.preserve_auto_complete_on_focus_lost", "aliases": ["preserve_auto_complete_on_focus_lost"] }, 243 | { "topic": "view.hide_popup", "aliases": ["hide_popup"] }, 244 | { "topic": "view.is_auto_complete_visible", "aliases": ["is_auto_complete_visible"] }, 245 | { "topic": "view.text_to_window", "aliases": ["text_to_window"] }, 246 | { "topic": "view.layout_to_window", "aliases": ["layout_to_window"] }, 247 | { "topic": "view.style", "aliases": ["style"] }, 248 | { "topic": "view.style_for_scope", "aliases": ["style_for_scope"] }, 249 | { "topic": "view.extract_tokens_with_scopes", "aliases": ["extract_tokens_with_scopes"] } 250 | ], 251 | "selection.txt": [ 252 | "sublime.Selection Class", 253 | 254 | { 255 | "topic": "Selection", 256 | "caption": "sublime.Selection Class" 257 | }, 258 | 259 | { "topic": "selection.__len__" }, 260 | { "topic": "selection.__getitem__", "aliases": ["__getitem__"] }, 261 | { "topic": "selection.__delitem__", "aliases": ["__delitem__"] }, 262 | { "topic": "selection.__eq__" }, 263 | { "topic": "selection.__lt__" }, 264 | { "topic": "selection.__bool__", "aliases": ["__bool__"] }, 265 | 266 | { "topic": "selection.clear", "aliases": ["clear"] }, 267 | { "topic": "selection.add", "aliases": ["add"] }, 268 | { "topic": "selection.add_all", "aliases": ["add_all"] }, 269 | { "topic": "selection.subtract", "aliases": ["subtract"] }, 270 | { "topic": "selection.contains" }, 271 | { "topic": "selection.is_valid" } 272 | 273 | ], 274 | "region.txt": [ 275 | "sublime.Region Class", 276 | 277 | { 278 | "topic": "Region", 279 | "caption": "sublime.Region Class" 280 | }, 281 | { 282 | "topic": "region_constructor", 283 | "caption": "Region Class Constructor" 284 | }, 285 | { 286 | "topic": "region.a", 287 | "caption": "region.a", 288 | }, 289 | { 290 | "topic": "region.b", 291 | "caption": "region.b", 292 | }, 293 | { 294 | "topic": "region.xpos", 295 | "caption": "region.xpos", 296 | "aliases": ["xpos"] 297 | }, 298 | 299 | { "topic": "region.__str__", "aliases": ["__str__"] }, 300 | { "topic": "region.__repr__", "aliases": ["__repr__"] }, 301 | { "topic": "region.__len__" }, 302 | { "topic": "region.__eq__" }, 303 | { "topic": "region.__lt__" }, 304 | 305 | { "topic": "region.begin", "aliases": ["begin"] }, 306 | { "topic": "region.end", "aliases": ["end"] }, 307 | { "topic": "region.size" }, 308 | { "topic": "region.empty", "aliases": ["empty"] }, 309 | { "topic": "region.cover", "aliases": ["cover"] }, 310 | { "topic": "region.intersection", "aliases": ["intersection"] }, 311 | { "topic": "region.intersects", "aliases": ["intersects"] }, 312 | { "topic": "region.contains" } 313 | ], 314 | "textchange.txt": [ 315 | "sublime.TextChange Class", 316 | 317 | { 318 | "topic": "textchange", 319 | "caption": "sublime.TextChange Class" 320 | }, 321 | { 322 | "topic": "textchange.a", 323 | "caption": "textchange.a", 324 | }, 325 | { 326 | "topic": "textchange.b", 327 | "caption": "textchange.b", 328 | }, 329 | { 330 | "topic": "textchange.str", 331 | "caption": "textchange.str", 332 | } 333 | ], 334 | "historicposition.txt": [ 335 | "sublime.HistoricPosition Class", 336 | 337 | { 338 | "topic": "historicposition", 339 | "caption": "sublime.HistoricPosition Class" 340 | }, 341 | { 342 | "topic": "historicposition.pt", 343 | "caption": "historicposition.pt", 344 | }, 345 | { 346 | "topic": "historicposition.row", 347 | "caption": "historicposition.row", 348 | }, 349 | { 350 | "topic": "historicposition.col", 351 | "caption": "historicposition.col", 352 | } 353 | ], 354 | "completion.txt": [ 355 | "completion Value", 356 | 357 | { 358 | "topic": "completion", 359 | "caption": "completion Value" 360 | } 361 | ], 362 | "completionitem.txt": [ 363 | "sublime.CompletionItem Class", 364 | 365 | { 366 | "topic": "completionitem_class", 367 | "caption": "sublime.CompletionItem Class" 368 | }, 369 | { "topic": "completionitem" }, 370 | { "topic": "completionitem.snippet_completion" }, 371 | { "topic": "completionitem.command_completion" } 372 | ], 373 | "completion_kind.txt": [ 374 | "completion_kind Tuple", 375 | 376 | { 377 | "topic": "completion_kind", 378 | "caption": "completion_kind Tuple" 379 | }, 380 | { 381 | "topic": "sublime.KIND_AMBIGUOUS", 382 | "caption": "sublime.KIND_AMBIGUOUS" 383 | }, 384 | { 385 | "topic": "sublime.KIND_KEYWORD", 386 | "caption": "sublime.KIND_KEYWORD" 387 | }, 388 | { 389 | "topic": "sublime.KIND_TYPE", 390 | "caption": "sublime.KIND_TYPE" 391 | }, 392 | { 393 | "topic": "sublime.KIND_FUNCTION", 394 | "caption": "sublime.KIND_FUNCTION" 395 | }, 396 | { 397 | "topic": "sublime.KIND_NAMESPACE", 398 | "caption": "sublime.KIND_NAMESPACE" 399 | }, 400 | { 401 | "topic": "sublime.KIND_NAVIGATION", 402 | "caption": "sublime.KIND_NAVIGATION" 403 | }, 404 | { 405 | "topic": "sublime.KIND_MARKUP", 406 | "caption": "sublime.KIND_MARKUP" 407 | }, 408 | { 409 | "topic": "sublime.KIND_VARIABLE", 410 | "caption": "sublime.KIND_VARIABLE" 411 | }, 412 | { 413 | "topic": "sublime.KIND_SNIPPET", 414 | "caption": "sublime.KIND_SNIPPET" 415 | }, 416 | { 417 | "topic": "sublime.KIND_ID_AMBIGUOUS", 418 | "caption": "sublime.KIND_ID_AMBIGUOUS" 419 | }, 420 | { 421 | "topic": "sublime.KIND_ID_KEYWORD", 422 | "caption": "sublime.KIND_ID_KEYWORD" 423 | }, 424 | { 425 | "topic": "sublime.KIND_ID_TYPE", 426 | "caption": "sublime.KIND_ID_TYPE" 427 | }, 428 | { 429 | "topic": "sublime.KIND_ID_FUNCTION", 430 | "caption": "sublime.KIND_ID_FUNCTION" 431 | }, 432 | { 433 | "topic": "sublime.KIND_ID_NAMESPACE", 434 | "caption": "sublime.KIND_ID_NAMESPACE" 435 | }, 436 | { 437 | "topic": "sublime.KIND_ID_NAVIGATION", 438 | "caption": "sublime.KIND_ID_NAVIGATION" 439 | }, 440 | { 441 | "topic": "sublime.KIND_ID_MARKUP", 442 | "caption": "sublime.KIND_ID_MARKUP" 443 | }, 444 | { 445 | "topic": "sublime.KIND_ID_VARIABLE", 446 | "caption": "sublime.KIND_ID_VARIABLE" 447 | }, 448 | { 449 | "topic": "sublime.KIND_ID_SNIPPET", 450 | "caption": "sublime.KIND_ID_SNIPPET" 451 | } 452 | ], 453 | "completionlist.txt": [ 454 | "sublime.CompletionList Class", 455 | 456 | { 457 | "topic": "CompletionList", 458 | "caption": "sublime.CompletionList Class" 459 | }, 460 | { 461 | "topic": "completionlist_constructor", 462 | "caption": "CompletionList Class Constructor" 463 | }, 464 | {"topic": "completionlist.set_completions" } 465 | ], 466 | "phantom.txt": [ 467 | "sublime.Phantom Class", 468 | 469 | { 470 | "topic": "Phantom", 471 | "caption": "sublime.Phantom Class" 472 | }, 473 | { 474 | "topic": "phantom_constructor", 475 | "caption": "Phantom Class Constructor" 476 | }, 477 | { "topic": "phantom.__eq__" } 478 | ], 479 | "phantomset.txt": [ 480 | "sublime.PhantomSet Class", 481 | 482 | { 483 | "topic": "PhantomSet", 484 | "caption": "sublime.PhantomSet Class" 485 | }, 486 | { 487 | "topic": "phantomset_constructor", 488 | "caption": "PhantomSet Class Constructor" 489 | }, 490 | { "topic": "PhantomSet.update", "aliases": ["update"] } 491 | ], 492 | "edit.txt": [ 493 | "sublime.Edit Class", 494 | 495 | { 496 | "topic": "Edit", 497 | "caption": "sublime.Edit Class" 498 | } 499 | ], 500 | "window.txt": [ 501 | "sublime.Window Class", 502 | 503 | { 504 | "topic": "Window", 505 | "caption": "sublime.Window Class" 506 | }, 507 | { "topic": "window.id" }, 508 | { "topic": "window.new_file", "aliases": ["new_file"] }, 509 | { "topic": "window.open_file", "aliases": ["open_file"] }, 510 | { "topic": "window.find_open_file", "aliases": ["find_open_file"] }, 511 | { "topic": "window.new_html_sheet", "aliases": ["new_html_sheet"] }, 512 | { "topic": "window.active_sheet", "aliases": ["active_sheet"] }, 513 | { "topic": "window.active_view", "aliases": ["active_view"] }, 514 | { "topic": "window.active_sheet_in_group", "aliases": ["active_sheet_in_group"] }, 515 | { "topic": "window.active_view_in_group", "aliases": ["active_view_in_group"] }, 516 | { "topic": "window.transient_sheet_in_group", "aliases": ["transient_sheet_in_group"] }, 517 | { "topic": "window.transient_view_in_group", "aliases": ["transient_view_in_group"] }, 518 | { "topic": "window.sheets", "aliases": ["sheets"] }, 519 | { "topic": "window.sheets_in_group", "aliases": ["sheets_in_group"] }, 520 | { "topic": "window.views", "aliases": ["views"] }, 521 | { "topic": "window.views_in_group", "aliases": ["views_in_group"] }, 522 | { "topic": "window.num_groups", "aliases": ["num_groups"] }, 523 | { "topic": "window.active_group", "aliases": ["active_group"] }, 524 | { "topic": "window.focus_group", "aliases": ["focus_group"] }, 525 | { "topic": "window.focus_sheet", "aliases": ["focus_sheet"] }, 526 | { "topic": "window.focus_view", "aliases": ["focus_view"] }, 527 | { "topic": "window.focus_window", "aliases": ["focus_window"] }, 528 | { "topic": "window.get_sheet_index", "aliases": ["get_sheet_index"] }, 529 | { "topic": "window.set_sheet_index", "aliases": ["set_sheet_index"] }, 530 | { "topic": "window.get_view_index", "aliases": ["get_view_index"] }, 531 | { "topic": "window.set_view_index", "aliases": ["set_view_index"] }, 532 | { "topic": "window.layout", "aliases": ["layout"] }, 533 | { "topic": "window.get_layout", "aliases": ["get_layout"] }, 534 | { "topic": "window.set_layout", "aliases": ["set_layout"] }, 535 | { "topic": "window.status_message" }, 536 | { "topic": "window.bring_to_front", "aliases": ["bring_to_front"] }, 537 | { "topic": "window.is_menu_visible", "aliases": ["is_menu_visible"] }, 538 | { "topic": "window.set_menu_visible", "aliases": ["set_menu_visible"] }, 539 | { "topic": "window.is_sidebar_visible", "aliases": ["is_sidebar_visible"] }, 540 | { "topic": "window.set_sidebar_visible", "aliases": ["set_sidebar_visible"] }, 541 | { "topic": "window.get_tabs_visible", "aliases": ["get_tabs_visible"] }, 542 | { "topic": "window.set_tabs_visible", "aliases": ["set_tabs_visible"] }, 543 | { "topic": "window.is_minimap_visible", "aliases": ["is_minimap_visible"] }, 544 | { "topic": "window.set_minimap_visible", "aliases": ["set_minimap_visible"] }, 545 | { "topic": "window.is_status_bar_visible", "aliases": ["is_status_bar_visible"] }, 546 | { "topic": "window.set_status_bar_visible", "aliases": ["set_status_bar_visible"] }, 547 | { "topic": "window.settings" }, 548 | { "topic": "window.template_settings", "aliases": ["template_settings"] }, 549 | { "topic": "window.folders", "aliases": ["folders"] }, 550 | { "topic": "window.project_file_name", "aliases": ["project_file_name"] }, 551 | { "topic": "window.workspace_file_name", "aliases": ["workspace_file_name"] }, 552 | { "topic": "window.project_data", "aliases": ["project_data"] }, 553 | { "topic": "window.set_project_data", "aliases": ["set_project_data"] }, 554 | { "topic": "window.run_command" }, 555 | { "topic": "window.show_quick_panel", "aliases": ["show_quick_panel"] }, 556 | { "topic": "window.show_input_panel", "aliases": ["show_input_panel"] }, 557 | { "topic": "window.create_output_panel", "aliases": ["create_output_panel"] }, 558 | { "topic": "window.get_output_panel", "aliases": ["get_output_panel"] }, 559 | { "topic": "window.find_output_panel", "aliases": ["find_output_panel"] }, 560 | { "topic": "window.destroy_output_panel", "aliases": ["destroy_output_panel"] }, 561 | { "topic": "window.active_panel", "aliases": ["active_panel"] }, 562 | { "topic": "window.panels", "aliases": ["panels"] }, 563 | { "topic": "window.lookup_symbol_in_index", "aliases": ["lookup_symbol_in_index"] }, 564 | { "topic": "window.lookup_symbol_in_open_files", "aliases": ["lookup_symbol_in_open_files"] }, 565 | { "topic": "window.lookup_references_in_index", "aliases": ["lookup_references_in_index"] }, 566 | { "topic": "window.lookup_references_in_open_files", "aliases": ["lookup_references_in_open_files"] }, 567 | { "topic": "window.extract_variables", "aliases": ["extract_variables"] } 568 | ], 569 | "settings.txt": [ 570 | "sublime.Settings Class", 571 | 572 | { 573 | "topic": "Settings", 574 | "caption": "sublime.Settings Class" 575 | }, 576 | { "topic": "settings.get", "aliases": ["get"] }, 577 | { "topic": "settings.set", "aliases": ["set"] }, 578 | { "topic": "settings.setdefault", "aliases": ["setdefault"] }, 579 | { "topic": "settings.erase" }, 580 | { "topic": "settings.has", "aliases": ["has"] }, 581 | { "topic": "settings.add_on_change", "aliases": ["add_on_change"] }, 582 | { "topic": "settings.clear_on_change", "aliases": ["clear_on_change"] } 583 | ], 584 | "sublime_plugin.txt": [ 585 | "sublime_plugin Module", 586 | 587 | { 588 | "topic": "sublime_plugin", 589 | "caption": "sublime_plugin Module", 590 | } 591 | ], 592 | "eventlistener.txt": [ 593 | "sublime_plugin.EventListener Class", 594 | 595 | { 596 | "topic": "EventListener", 597 | "caption": "sublime_plugin.EventListener Class" 598 | }, 599 | { "topic": "EventListener.on_init", "aliases": ["on_init"] }, 600 | { "topic": "EventListener.on_exit", "aliases": ["on_exit"] }, 601 | { "topic": "EventListener.on_new", "aliases": ["on_new"] }, 602 | { "topic": "EventListener.on_new_async", "aliases": ["on_new_async"] }, 603 | { "topic": "EventListener.on_clone", "aliases": ["on_clone"] }, 604 | { "topic": "EventListener.on_clone_async", "aliases": ["on_clone_async"] }, 605 | { "topic": "EventListener.on_load" }, 606 | { "topic": "EventListener.on_load_async" }, 607 | { "topic": "EventListener.on_reload" }, 608 | { "topic": "EventListener.on_reload_async" }, 609 | { "topic": "EventListener.on_revert" }, 610 | { "topic": "EventListener.on_revert_async" }, 611 | { "topic": "EventListener.on_pre_move" }, 612 | { "topic": "EventListener.on_post_move" }, 613 | { "topic": "EventListener.on_post_move_async" }, 614 | { "topic": "EventListener.on_pre_close" }, 615 | { "topic": "EventListener.on_close" }, 616 | { "topic": "EventListener.on_pre_save" }, 617 | { "topic": "EventListener.on_pre_save_async" }, 618 | { "topic": "EventListener.on_post_save" }, 619 | { "topic": "EventListener.on_post_save_async" }, 620 | { "topic": "EventListener.on_modified" }, 621 | { "topic": "EventListener.on_modified_async" }, 622 | { "topic": "EventListener.on_text_changed" }, 623 | { "topic": "EventListener.on_text_changed_async" }, 624 | { "topic": "EventListener.on_selection_modified" }, 625 | { "topic": "EventListener.on_selection_modified_async" }, 626 | { "topic": "EventListener.on_activated" }, 627 | { "topic": "EventListener.on_activated_async" }, 628 | { "topic": "EventListener.on_deactivated" }, 629 | { "topic": "EventListener.on_deactivated_async" }, 630 | { "topic": "EventListener.on_hover" }, 631 | { "topic": "EventListener.on_query_context" }, 632 | { "topic": "EventListener.on_query_completions" }, 633 | { "topic": "EventListener.on_text_command" }, 634 | { "topic": "EventListener.on_window_command", "aliases": ["on_window_command"] }, 635 | { "topic": "EventListener.on_post_text_command" }, 636 | { "topic": "EventListener.on_post_window_command", "aliases": ["on_post_window_command"] }, 637 | { "topic": "EventListener.on_new_window", "aliases": ["on_new_window"] }, 638 | { "topic": "EventListener.on_new_window_async", "aliases": ["on_new_window_async"] }, 639 | { "topic": "EventListener.on_pre_close_window", "aliases": ["on_pre_close_window"] }, 640 | { "topic": "EventListener.on_new_project", "aliases": ["on_new_project"] }, 641 | { "topic": "EventListener.on_new_project_async", "aliases": ["on_new_project_async"] }, 642 | { "topic": "EventListener.on_load_project", "aliases": ["on_load_project"] }, 643 | { "topic": "EventListener.on_load_project_async", "aliases": ["on_load_project_async"] }, 644 | { "topic": "EventListener.on_pre_save_project", "aliases": ["on_pre_save_project"] }, 645 | { "topic": "EventListener.on_post_save_project", "aliases": ["on_post_save_project"] }, 646 | { "topic": "EventListener.on_post_save_project_async", "aliases": ["on_post_save_project_async"] }, 647 | { "topic": "EventListener.on_pre_close_project", "aliases": ["on_pre_close_project"] } 648 | ], 649 | "vieweventlistener.txt": [ 650 | "sublime_plugin.ViewEventListener Class", 651 | 652 | { 653 | "topic": "ViewEventListener", 654 | "caption": "sublime_plugin.ViewEventListener Class" 655 | }, 656 | { "topic": "ViewEventListener.is_applicable", "aliases": ["is_applicable"] }, 657 | { "topic": "ViewEventListener.applies_to_primary_view_only", "aliases": ["applies_to_primary_view_only"] }, 658 | { "topic": "ViewEventListener.on_modified" }, 659 | { "topic": "ViewEventListener.on_modified_async" }, 660 | { "topic": "ViewEventListener.on_text_changed" }, 661 | { "topic": "ViewEventListener.on_text_changed_async" }, 662 | { "topic": "ViewEventListener.on_selection_modified" }, 663 | { "topic": "ViewEventListener.on_selection_modified_async" }, 664 | { "topic": "ViewEventListener.on_activated" }, 665 | { "topic": "ViewEventListener.on_activated_async" }, 666 | { "topic": "ViewEventListener.on_deactivated" }, 667 | { "topic": "ViewEventListener.on_deactivated_async" }, 668 | { "topic": "ViewEventListener.on_hover" }, 669 | { "topic": "ViewEventListener.on_query_context" }, 670 | { "topic": "ViewEventListener.on_query_completions" }, 671 | { "topic": "ViewEventListener.on_load" }, 672 | { "topic": "ViewEventListener.on_load_async" }, 673 | { "topic": "ViewEventListener.on_reload" }, 674 | { "topic": "ViewEventListener.on_reload_async" }, 675 | { "topic": "ViewEventListener.on_revert" }, 676 | { "topic": "ViewEventListener.on_revert_async" }, 677 | { "topic": "ViewEventListener.on_pre_move" }, 678 | { "topic": "ViewEventListener.on_post_move" }, 679 | { "topic": "ViewEventListener.on_post_move_async" }, 680 | { "topic": "ViewEventListener.on_pre_close" }, 681 | { "topic": "ViewEventListener.on_close" }, 682 | { "topic": "ViewEventListener.on_pre_save", }, 683 | { "topic": "ViewEventListener.on_pre_save_async" }, 684 | { "topic": "ViewEventListener.on_post_save" }, 685 | { "topic": "ViewEventListener.on_post_save_async" }, 686 | { "topic": "ViewEventListener.on_text_command" }, 687 | { "topic": "ViewEventListener.on_post_text_command" } 688 | ], 689 | "applicationcommand.txt": [ 690 | "sublime_plugin.ApplicationCommand Class", 691 | 692 | { 693 | "topic": "ApplicationCommand", 694 | "caption": "sublime_plugin.ApplicationCommand Class" 695 | }, 696 | { "topic": "ApplicationCommand.run" }, 697 | { "topic": "ApplicationCommand.is_enabled" }, 698 | { "topic": "ApplicationCommand.is_visible" }, 699 | { "topic": "ApplicationCommand.is_checked" }, 700 | { "topic": "ApplicationCommand.description" }, 701 | { "topic": "ApplicationCommand.input" }, 702 | { "topic": "ApplicationCommand.input_description" } 703 | ], 704 | "windowcommand.txt": [ 705 | "sublime_plugin.WindowCommand Class", 706 | 707 | { 708 | "topic": "WindowCommand", 709 | "caption": "sublime_plugin.WindowCommand Class" 710 | }, 711 | { "topic": "WindowCommand.run" }, 712 | { "topic": "WindowCommand.is_enabled" }, 713 | { "topic": "WindowCommand.is_visible" }, 714 | { "topic": "WindowCommand.is_checked" }, 715 | { "topic": "WindowCommand.description" }, 716 | { "topic": "WindowCommand.input" }, 717 | { "topic": "WindowCommand.input_description" } 718 | ], 719 | "textcommand.txt": [ 720 | "sublime_plugin.TextCommand Class", 721 | 722 | { 723 | "topic": "TextCommand", 724 | "caption": "sublime_plugin.TextCommand Class" 725 | }, 726 | { "topic": "TextCommand.run" }, 727 | { "topic": "TextCommand.is_enabled" }, 728 | { "topic": "TextCommand.is_visible" }, 729 | { "topic": "TextCommand.is_checked" }, 730 | { "topic": "TextCommand.description" }, 731 | { "topic": "TextCommand.want_event", "aliases": ["want_event"] }, 732 | { "topic": "TextCommand.input" }, 733 | { "topic": "TextCommand.input_description" } 734 | ], 735 | "textinputhandler.txt": [ 736 | "sublime_plugin.TextInputHandler Class", 737 | 738 | { 739 | "topic": "TextInputHandler", 740 | "caption": "sublime_plugin.TextInputHandler Class" 741 | }, 742 | { "topic": "TextInputHandler.name" }, 743 | { "topic": "TextInputHandler.placeholder" }, 744 | { "topic": "TextInputHandler.initial_text" }, 745 | { "topic": "TextInputHandler.preview" }, 746 | { "topic": "TextInputHandler.validate" }, 747 | { "topic": "TextInputHandler.cancel" }, 748 | { "topic": "TextInputHandler.confirm" }, 749 | { "topic": "TextInputHandler.next_input" }, 750 | { "topic": "TextInputHandler.description" } 751 | ], 752 | "listinputhandler.txt": [ 753 | "sublime_plugin.ListInputHandler Class", 754 | 755 | { 756 | "topic": "ListInputHandler", 757 | "caption": "sublime_plugin.ListInputHandler Class" 758 | }, 759 | { "topic": "ListInputHandler.name" }, 760 | { "topic": "ListInputHandler.list_items" }, 761 | { "topic": "ListInputHandler.placeholder" }, 762 | { "topic": "ListInputHandler.initial_text" }, 763 | { "topic": "ListInputHandler.preview" }, 764 | { "topic": "ListInputHandler.validate" }, 765 | { "topic": "ListInputHandler.cancel" }, 766 | { "topic": "ListInputHandler.confirm" }, 767 | { "topic": "ListInputHandler.next_input" }, 768 | { "topic": "ListInputHandler.description" } 769 | ] 770 | }, 771 | 772 | "help_contents": [ 773 | { 774 | "topic": "index.txt", 775 | "caption": "Sublime Text 3 API Documentation" 776 | }, 777 | { 778 | "topic": "general.txt", 779 | "caption": "General Information", 780 | "children": [ 781 | { 782 | "topic": "example plugins", 783 | "caption": "Example Plugins" 784 | }, 785 | { 786 | "topic": "plugin lifecycle", 787 | "caption": "Plugin Lifecycle" 788 | }, 789 | { 790 | "topic": "threading", 791 | "caption": "Threading" 792 | }, 793 | { 794 | "topic": "units and coordinates", 795 | "caption": "Units and Coordinates" 796 | }, 797 | { 798 | "topic": "types", 799 | "caption": "Types" 800 | } 801 | ] 802 | }, 803 | { 804 | "topic": "sublime", 805 | "caption": "Core Components", 806 | 807 | "children": [ 808 | { 809 | "topic": "sublime", 810 | "caption": "sublime Module" 811 | }, 812 | { 813 | "topic": "Sheet", 814 | "caption": "Sheet Class" 815 | }, 816 | { 817 | "topic": "View", 818 | "caption": "View Class" 819 | }, 820 | { 821 | "topic": "Selection", 822 | "caption": "Selection Class" 823 | }, 824 | { 825 | "topic": "Region", 826 | "caption": "Region Class" 827 | }, 828 | { 829 | "topic": "Phantom", 830 | "caption": "Phantom Class" 831 | }, 832 | { 833 | "topic": "PhantomSet", 834 | "caption": "PhantomSet Class" 835 | }, 836 | { 837 | "topic": "Edit", 838 | "caption": "Edit Class" 839 | }, 840 | { 841 | "topic": "TextChange", 842 | "caption": "TextChange Class" 843 | }, 844 | { 845 | "topic": "HistoricPosition", 846 | "caption": "HistoricPosition Class" 847 | }, 848 | { 849 | "topic": "completion", 850 | "caption": "completion value" 851 | }, 852 | { 853 | "topic": "CompletionItem", 854 | "caption": "CompletionItem Class" 855 | }, 856 | { 857 | "topic": "completion_kind", 858 | "caption": "completion_kind Tuple" 859 | }, 860 | { 861 | "topic": "completionlist", 862 | "caption": "CompletionList Class" 863 | }, 864 | { 865 | "topic": "Window", 866 | "caption": "Window Class" 867 | }, 868 | { 869 | "topic": "Settings", 870 | "caption": "Settings Class" 871 | } 872 | ] 873 | }, 874 | { 875 | "topic": "sublime_plugin.txt", 876 | "caption": "sublime_plugin Module", 877 | 878 | "children": [ 879 | { 880 | "topic": "sublime_plugin", 881 | "caption": "sublime_plugin Module" 882 | }, 883 | { 884 | "topic": "EventListener", 885 | "caption": "EventListener Class" 886 | }, 887 | { 888 | "topic": "ViewEventListener", 889 | "caption": "ViewEventListener Class" 890 | }, 891 | { 892 | "topic": "ApplicationCommand", 893 | "caption": "ApplicationCommand Class" 894 | }, 895 | { 896 | "topic": "WindowCommand", 897 | "caption": "WindowCommand Class" 898 | }, 899 | { 900 | "topic": "TextCommand", 901 | "caption": "TextCommand Class" 902 | }, 903 | { 904 | "topic": "TextInputHandler", 905 | "caption": "TextInputHandler Class" 906 | }, 907 | { 908 | "topic": "ListInputHandler", 909 | "caption": "ListInputHandler Class" 910 | } 911 | ] 912 | } 913 | ], 914 | 915 | "externals": 916 | { 917 | "http://www.sublimetext.com/docs/api_reference.html": [ 918 | "Sublime Text API Reference", 919 | 920 | { 921 | "topic": "api_reference.html" 922 | } 923 | ], 924 | 925 | "http://www.sublimetext.com/docs/minihtml.html": [ 926 | "minihtml Reference", 927 | 928 | { 929 | "topic": "minihtml" 930 | } 931 | ], 932 | 933 | "http://www.sublimetext.com/docs/minihtml.html#colors": [ 934 | "minihtml Reference: Colors", 935 | 936 | { 937 | "topic": "minihtml colors" 938 | } 939 | ], 940 | 941 | "http://www.sublimetext.com/docs/minihtml.html#protocols": [ 942 | "minihtml Reference: Protocols", 943 | 944 | { 945 | "topic": "minihtml protocols" 946 | } 947 | ], 948 | 949 | "https://www.sublimetext.com/docs/scope_naming.html#alphabetical_reference": [ 950 | "Scope Naming", 951 | 952 | { 953 | "topic": "Scope Naming" 954 | } 955 | ], 956 | 957 | "Packages/Default/exec.py": [ 958 | "Packages/Default/exec.py", 959 | 960 | { 961 | "topic": "exec.py" 962 | } 963 | ], 964 | 965 | "Packages/Default/font.py": [ 966 | "Packages/Default/font.py", 967 | 968 | { 969 | "topic": "font.py" 970 | } 971 | ], 972 | 973 | "Packages/Default/goto_line.py": [ 974 | "Packages/Default/goto_line.py", 975 | 976 | { 977 | "topic": "goto_line.py" 978 | } 979 | ], 980 | 981 | "Packages/Default/mark.py": [ 982 | "Packages/Default/mark.py", 983 | 984 | { 985 | "topic": "mark.py" 986 | } 987 | ], 988 | 989 | "Packages/Default/show_scope_name.py": [ 990 | "Packages/Default/show_scope_name.py", 991 | 992 | { 993 | "topic": "show_scope_name.py" 994 | } 995 | ], 996 | 997 | "Packages/Default/arithmetic.py": [ 998 | "Packages/Default/arithmetic.py", 999 | 1000 | { 1001 | "topic": "arithmetic.py" 1002 | } 1003 | ] 1004 | } 1005 | } 1006 | --------------------------------------------------------------------------------