-
Notifications
You must be signed in to change notification settings - Fork 11
Modernize repo and make sure it works with ST4 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Frizlab
wants to merge
199
commits into
SublimeText:master
Choose a base branch
from
Frizlab:develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
199 commits
Select commit
Hold shift + click to select a range
369f0a1
ST3 compatibility, VIM compatibility
klorenz 82618b3
removed logging
klorenz b858efa
remove typo
MerlinDMC d100a14
PY3: make python3 happy
MerlinDMC fbac0c3
fix typo
MerlinDMC ed26369
Migrate cleanup script to bash
Frizlab a2fba70
Fix cd in cleanup
Frizlab 738e833
Add __pycache__ in the cleanup files in cleanup script
Frizlab 438e47e
Convert .gitignore to unix EoL
Frizlab 368fd09
Remove obsolete hg files
Frizlab ffd3be0
Remove obsolete “make release” script
Frizlab 9116291
Dummy code formatting change
Frizlab 1ee1ba9
Remove RunTests script
Frizlab b0785da
Dummy code-style fix
Frizlab 62516f9
Convert and update the Readme
Frizlab 431a272
Update and rename the license file
Frizlab 767ae64
Convert EoL to unix everywhere
Frizlab 540276e
Dummy comments formatting fixes
Frizlab 58c110e
Update manifest file
Frizlab dd26106
Remove modeline from script
Frizlab 396c317
Remove unused files
Frizlab 4d8e7ac
Use double-quotes instead of simple-quotes
Frizlab 13cfdf9
Ident empty lines
Frizlab 195d48a
Dummy syntax changes
Frizlab 3c60255
Fix and make less flexible syntax setting
Frizlab 5ee3bfe
Dummy code formatting change
Frizlab 3cb77eb
Remove some dead code
Frizlab d331972
Remove vim support
Frizlab a888337
Add info about setting language name for x_syntax in Readme
Frizlab 0dea4ee
Fix some rst to md conversion failures
Frizlab 337c2fa
Remove some dead code
Frizlab c4f6e22
Disable debug logging
Frizlab 241186f
Import importlib instead of imp
Frizlab 7c3b0c1
Differentiate logging to log and to tmp
Frizlab bee07e6
Add some missing trailing newlines
Frizlab dfb5bba
Remove init from tests
Frizlab 89aa5b0
Remove useless command
Frizlab f595ee1
Fix running the tests
Frizlab 4f7359c
Continue test fixes
Frizlab 79c0ede
Remove type hints in tests as they are not supported by UnitTesting
Frizlab 6bad26b
Fix test compilation
Frizlab b001b0f
Change a test to make sure we do not call meta_info anymore
Frizlab fb9ff7f
Fix test_get_line_comment_char_does_not_call_meta_info
Frizlab 40e1935
Fix test_to_json_type
Frizlab 5680c0c
Enable a new test, remove dead code
Frizlab 42823fd
Finish migrating old original tests
Frizlab 6120e85
Reformat newer test file and remove duplicated test
Frizlab 9499d28
Typo fix
Frizlab 28b5af6
Add Guillermo López-Anglada contribution in Readme
Frizlab 46380fb
Add Guillermo López-Anglada Copyright back in the License file
Frizlab ceb7d47
Update URL for Sublime package installation documentation
Frizlab 6c71f4c
Add a GitHub workflow to test the package on the CI
Frizlab 8aa5377
Start splitting source code in multiple files
Frizlab b56d6de
Add settings
Frizlab d35f3ae
Remove the delimited mode from default formats
Frizlab 44f875a
Remove a stray log
Frizlab 99e6ab3
Remove a useless import
Frizlab 285b2a6
Add new setting to set the number of lines to scan to find the modelines
Frizlab 496431e
Remove an unused import
Frizlab e0a7863
Add a pyrightconfig file for proper detection of sublime modules
Frizlab 18d1e03
Do not enable debug logs
Frizlab 96fc4fd
Remove useless passes
Frizlab 2dce7c6
Add type hints in the code
Frizlab 6699c2b
Add more info about the formats key of the preferences
Frizlab e7dde30
Add more info about the log_to_tmp variable in the logger
Frizlab b6f097f
Empty the __init__ file
Frizlab 566d0c0
Load Logger config from settings
Frizlab b85eb27
Add all the “specs” for the project in the settings file
Frizlab 28a0a4b
Fix circular import
Frizlab d795375
Fix plugin init
Frizlab 53f8d60
Dummy typo fixes
Frizlab 14d1535
Update plugin bootstrap structure
Frizlab 8072663
Pass the settings object to updateLoggerSettings
Frizlab af13733
Add new settings to prevent apply on load and/or save
Frizlab cf9952a
Add new command to apply modelines manually
Frizlab cf3e153
Add a comment with the command name
Frizlab 4b4cea0
Dummy comment/code-style fixes in the settings file
Frizlab b14372b
Fix a compilation error in main file
Frizlab c910f34
Create a new Utils class for doing type casting
Frizlab cb294ba
Create ModelineInstructionsMapping class
Frizlab 235bd81
Add first model
Frizlab aaded51
Use `get` instead of `… if … else None`
Frizlab 4c3b9c8
Add new util method in settings to convert a setting to a dictionary
Frizlab 9ed2073
Fix compilation on Python 3.8
Frizlab 08ccb3f
Fix signature of init of ModelineInstructionsMapping
Frizlab ace2fe4
Utils: Add a new method to merge two dictionaries
Frizlab c4639e7
Utils: Add a new method to cast an object to a dict of dict (both w/ …
Frizlab e7acd02
Utils: Fix incorrect variable used throughout the file
Frizlab fc8a932
Settings: Add VIM mapping retrieval
Frizlab 850ba51
Implement pretty-printing ModelineInstructionsMapping
Frizlab f59e71c
Settings: Add Emacs mapping retrieval
Frizlab 82d2b90
Update settings file with enhanced parsing rules
Frizlab f4f036f
Use get method on dict in more places
Frizlab 44e2d54
Apply transforms on optional objects instead of strings
Frizlab 8cc715d
Add new utilities methods
Frizlab a1355b9
Add method to apply the mapping on a key/value
Frizlab fde1bcf
Start implementation of raw line parsing result to a Modeline
Frizlab db58602
Start Modeline instruction parsing
Frizlab 9705807
Replace `Optional[object]` by `object`
Frizlab e14ec57
Dummy code organization change
Frizlab 60c7890
Properly return the mapped modeline instruction in apply function
Frizlab 33d94d2
Add new utility to safely cast an object to a SublimeValue
Frizlab 233742f
Implement the two modeline instructions we have
Frizlab 014a03a
Implement converting the raw modeline parsing result to an actual mod…
Frizlab 6cc05a6
Catch exception when converting raw modeline instructions to structur…
Frizlab 305f53e
Catch exception when parsing line for raw modeline instructions
Frizlab 33ae58e
Move ValueModifier to ModelineInstruction
Frizlab 2f8e56b
Store the value modifier in the modeline instructions that need it
Frizlab 09f2d5b
Add error log level to Logger
Frizlab 5d2adec
Dummy comment change
Frizlab ec2acc8
Implement value modifier in “set view setting” instruction
Frizlab 658b43a
Create the (unimplemented) modeline parsers
Frizlab 67e5821
Implement the core loop for parsing and applying the modelines
Frizlab fdd75cc
Fix apply_on_load and apply_on_save settings being ignored
Frizlab 0e4e07f
Fix checked_cast_to_sublime_value
Frizlab 67997f2
Add more specs for the default modeline format
Frizlab fb46f6b
Fix default Modeline not having any instructions
Frizlab 4c20aeb
Print the modeline instruction being applied before applying them
Frizlab 2ff52f2
Implement ModelineParser_Sublime
Frizlab 1bbc0b8
Dummy comment change
Frizlab d1bb017
Fix Modeline having its instructions saved in a class variable instea…
Frizlab 54c3d14
Dummy white-line removal
Frizlab 479a160
Do not process overlapping lines twice
Frizlab cd3182e
Dummy comment enhancement
Frizlab ed1e50c
Fix VIM and Emacs mapping for syntax
Frizlab bc9787d
Implement Emacs parser
Frizlab 743da8b
Implement automatic finding of syntax file for the syntax key
Frizlab fc3153d
Add classic+vim parser
Frizlab 8884877
Fix modeline not being returned when one attribute is unsupported
Frizlab 7ab220b
Remove an unused import
Frizlab 39a27e1
Implement VIM modeline parsing
Frizlab c115e8b
Prepare implementation of the legacy parsing
Frizlab 0307c2f
Use a better method of preparing for legacy parsing
Frizlab ffc626c
Implement legacy parser
Frizlab 2bdf58c
Implement legacy+vim parser
Frizlab c33f616
Enhance debug logs
Frizlab f170c20
Add snippets for the different modelines
Frizlab bb52599
Remove an obsolete file
Frizlab 83717df
Add a default value to the init of a ModelineInstruction
Frizlab 435938e
Add a default value to the init of a Modeline
Frizlab 84c0d71
Add more str representations
Frizlab 2a23ff9
Properly reset the mapping for new ModelienParser instances
Frizlab 8a59909
Change the way `no*` keys are handled for the legacy vim parser
Frizlab 9822b6b
Properly reset the mapping for new ModelineInstructionsMapping instances
Frizlab 9cfee78
Make Modeline and its instructions equatable
Frizlab cbfc53e
Add an __init__ file for the tests
Frizlab a07b721
Fix most legacy+vim tests
Frizlab 3c24222
Add original (commented) test files for legacy parser
Frizlab ee55dcf
Remove an unused import
Frizlab 7409185
Dummy code format fix
Frizlab 36b1d16
Remove ST3 compat’
Frizlab 0aaf54c
Remove an unused import
Frizlab 8ba098d
Add dependency to typing_extensions
Frizlab 6f00951
Move the snippets in a folder
Frizlab 125bf34
Do not prevent modeline plugin to run if the view is scratch
Frizlab 70e74a9
Finish migrating the original legacy+vim tests
Frizlab e250352
Make a test more interesting
Frizlab 48a3da0
Remove unused imports
Frizlab 1be0fa5
Enhance the integration tests setup
Frizlab b129597
Remove codecov action as it currently does nothing
Frizlab 70c3a73
Prevent snippet’s content to be autodetected by the plugin in most co…
Frizlab 5cb9462
Add a new test for legacy+vim parser
Frizlab 75d5218
Dummy comment addition
Frizlab 17c9299
Rename a test file
Frizlab a614e3f
Dummy trailing lines removal
Frizlab 53c0c38
Sublime Parser: Fix key/value pairs potentially not being stripped
Frizlab d6f75fb
Sublime parser: Add tests
Frizlab 043b6d5
Remove a stray print
Frizlab 62524e7
Legacy Parser: Fix default comment char not escaped in prefix regex
Frizlab 9a3716d
Legacy Parser: Fix missing stripping
Frizlab e3415a9
Add tests for the legacy parser
Frizlab 2fdb0f0
Tweak Sublime parser tests
Frizlab e628dc8
Remove a stray print
Frizlab 1241c9e
Add commented prints in tests for easy re-activation
Frizlab 8ccebba
Add tests for the VIM parser
Frizlab 0fa62eb
Remove an unused import
Frizlab 98d2336
Add tests for the Emacs parser
Frizlab 33ff631
Update the Readme
Frizlab fdccfda
Ignore the tests and the Readme in git archives
Frizlab 3c8eecd
Remove pyrightconfig
Frizlab 76c25f9
Remove more useless stuff from the gitignore file
Frizlab c9777a9
Move parser creation to the ModelineFormat enum
Frizlab ce0a6bc
Add missing forward declaration
Frizlab 24c8df5
Change the order of contributions in the readme
Frizlab 9471341
Put the website for Kiwi as an actual href
Frizlab c6030a8
Dummy formatting changes for the contributors
Frizlab aebaa75
Fix a link
Frizlab dbda8ad
Rename “Sublime Modelines” to “Modelines” where applicable
Frizlab 45fd110
Add a comment on the verbose setting
Frizlab f6bf3f3
Report tests dependency to the UnitTesting package in the Readme
Frizlab 2ac9420
Fix warning in tests using async setUp
Frizlab fb9a6ea
Rename test classes to be in plural form
Frizlab 5fec68f
Implement no default values in mapping (passthrough for unmapped)
Frizlab 3a56b9b
Check some isinstance checks
Frizlab 9c57986
Add a TODO
Frizlab 888e7ea
Add a default mapping for the filetype key for VIM
Frizlab 1b4b7f9
Add tests for the mapping, and fix bugs found w/ those tests
Frizlab 2dd01df
Remove invalid and unused class variables
Frizlab af7418b
Remove a print
Frizlab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /tests/ export-ignore | ||
| /Readme.md export-ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: tests | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| run-tests: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| st-version: [4] | ||
| os: ["ubuntu-latest", "macOS-latest", "windows-latest"] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: SublimeText/UnitTesting/actions/setup@v1 | ||
| with: | ||
| sublime-text-version: ${{ matrix.st-version }} | ||
| - uses: SublimeText/UnitTesting/actions/run-tests@v1 | ||
| with: | ||
| coverage: true | ||
| # We do not have a codecov token; let’s not do this. | ||
| # I’m still keeping it around as we might want it later; | ||
| # after must have been in the source file this action is from for a reason, I guess… | ||
| #- uses: codecov/codecov-action@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,5 @@ | ||
| *.hgignore | ||
| *.hgtags | ||
| *.pyc | ||
| *.cache | ||
| *.sublime-project | ||
|
|
||
| _*.txt | ||
| sample-grammar.js | ||
| Manifest | ||
| MANIFEST | ||
|
|
||
| dist/ | ||
| build/ | ||
| *.pyc | ||
| *.cache | ||
| *.sublime-project | ||
|
|
||
| /pyrightconfig.json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [ | ||
| { | ||
| "caption": "Preferences: Modelines Settings", | ||
| "command": "edit_settings", | ||
| "args": { | ||
| "base_file": "${packages}/Modelines/Modelines.sublime-settings", | ||
| "default": "/* See the left pane for the list of settings and valid values. */\n{\n\t$0\n}\n", | ||
| } | ||
| }, | ||
| { | ||
| "caption": "Modelines: Apply", | ||
| "command": "modelines_apply", | ||
| }, | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,20 @@ | ||
| Copyright (c) 2010 Guillermo López-Anglada | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| Copyright (c) 2010 Guillermo López-Anglada | ||
| (c) 2026 Frizlab | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [{ | ||
| "id": "preferences", | ||
| "children": [ | ||
| { | ||
| "caption": "Package Settings", | ||
| "mnemonic": "P", | ||
| "id": "package-settings", | ||
| "children": [ | ||
| { | ||
| "caption": "Modelines", | ||
| "id": "modelines-settings", | ||
| "command": "edit_settings", | ||
| "args": { | ||
| "base_file": "${packages}/Modelines/Modelines.sublime-settings", | ||
| "default": "/* See the left pane for the list of settings and valid values. */\n{\n\t$0\n}\n", | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| { | ||
| /* Apply modelines on file open. */ | ||
| "apply_on_load": true, | ||
| /* Apply modelines on file save. */ | ||
| "apply_on_save": true, | ||
|
|
||
| /* These two settings determine how far the search for a modeline should be done. */ | ||
| "number_of_lines_to_check_from_beginning": 5, | ||
| "number_of_lines_to_check_from_end": 5, | ||
|
|
||
| /* Which types of modelines format are allowed. | ||
| * When multiple formats are specified, the parsing is attempted using the formats in the order they are given. */ | ||
| "formats": [ | ||
| /* Default format. | ||
| * Examples: | ||
| * `// ~*~ sublime: key=val; key2=val2; key3 ~*~` | ||
| * `// ~*~ sublime: key = val; key2+=val2; ~*~` | ||
| * `// ~*~ sublime : key=["hello": "world"] ~*~` | ||
| * (Also works with /*-styled comments, but JSON does not supported nested comments, so I’m skipping this example…) | ||
| * | ||
| * This format is inspired by VIM (`sublime:` prefix, key=val) as well as Emacs (`~*~` delimiters; Emacs uses `-*-`). | ||
| * | ||
| * Any value that starts with either a double-quote (`"`), a brace (`{`) or a bracket (`[`) is parsed as a JSON string. | ||
| * If the JSON fails to parse, the original string is kept. | ||
| * The literal strings `true` and `false` are converted to their boolean values. | ||
| * Literal numbers (`42`, `3.14`, `-007`, `+12.345`, `23e32`) are converted to ints or floats. | ||
| * The exact rule is: if `int(value)` does not throw, the int value is used, then if `float(value)` does not throw, the float value is used. | ||
| * The literal string `null` is converted to None. | ||
| * You can use double-quotes for these cases if you need an explicit string instead. | ||
| * | ||
| * All values are trimmed of their spaces (before being parsed if the value is a JSON string). | ||
| * If a value should contain a semicolon (`;`), it should be doubled (included inside a JSON string) | ||
| * to avoid being interpreted as the delimiter for the end of the value. | ||
| * | ||
| * To avoid ambiguities, if there are multiple `~*~` tokens on the line, only the first and last are considered. */ | ||
| "default", | ||
|
|
||
| /* VIM-like modelines. | ||
| * Examples (straight from <https://vim.fandom.com/wiki/Modeline_magic>): | ||
| * - `// vim: noai:ts=4:sw=4` | ||
| * - `/* vim: noai:ts=4:sw=4` (w/ closing comment token on next line) */ | ||
| // - `/* vim: set noai ts=4 sw=4: */` | ||
| // - `/* vim: set fdm=expr fde=getline(v\:lnum)=~'{'?'>1'\:'1': */` | ||
| /* | ||
| * For this format we map the VIM commands to Sublime Text commands. | ||
| * Additional mapping can be added in this config file. | ||
| * | ||
| * It is also possible to prefix commands with `st-`, `sublime-`, `sublime-text-` or `sublimetext-` | ||
| * to directly execute Sublime Text commands without needing any mapping. | ||
| * | ||
| * See the Readme for more information. */ | ||
| //"vim", | ||
|
|
||
| /* Emacs-like modelines. | ||
| * Examples: | ||
| * `-*- key: value; key2: value2 -*-` | ||
| * `-*- syntax_name -*-` | ||
| * | ||
| * Just like for the VIM format, we map the Emacs commands to Sublime Text commands. */ | ||
| //"emacs", | ||
|
|
||
| /* Classic (legacy) format. | ||
| * Example: `# sublime: key val(; key2 val2)*` | ||
| * | ||
| * Usually works well unless putting the modeline in a `/*`-style comment. | ||
| * | ||
| * Can also not work when the syntax of the file is not known, | ||
| * because we check the line to begin with the comment char before parsing it | ||
| * (`#` is used when the character is unknown). | ||
| * | ||
| * The parsing algorithm is exactly the same as the old ST2 version of the plugin. */ | ||
| //"classic", | ||
|
|
||
| /* Classic (legacy) format with VIM support. | ||
| * | ||
| * Same as previous, with original VIM support implementation. */ | ||
| //"classic+vim", | ||
| ], | ||
|
|
||
| /* Default VIM commands mapping. | ||
| * Use can use `vim_mapping_user` to define your own mapping while keeping this one. | ||
| * From <https://github.com/pestilence669/VimModelines/tree/b7d499b705277a1aa8ee1dd6387f78b734a8512c>. */ | ||
| "vim_mapping": { | ||
| /* Enable/disable automatic indentation. */ | ||
| "autoindent": {"aliases": ["ai"], "key": "auto_indent", "value": true}, | ||
| "noautoindent": {"aliases": ["noai"], "key": "auto_indent", "value": false}, | ||
| /* Set line endings (DOS, Legacy MacOS, UNIX). */ | ||
| "fileformat": {"aliases": ["ff"], "key": "set_line_endings()", "value-mapping": {"dos": "windows", "mac": "CR", "unix": "unix"}}, | ||
| /* Set the syntax of the file. */ | ||
| "filetype": {"aliases": ["ft"], "key": "syntax", "value-transforms": [ | ||
| {"type": "map", "parameters": {/* No "default", the value will be pass-through’d if not in the table. */ "table": { | ||
| "python": "Python", /* Explicitly set, but would work if not there. */ | ||
| "python2": "Python", | ||
| "dosini": "INI", /* Requires INI package. */ | ||
| }}} | ||
| ]}, | ||
| /* # of columns for each tab character. */ | ||
| "tabstop": {"aliases": ["ts"], "key": "tab_size"}, | ||
| /* # of columns for indent operation. */ | ||
| "shiftwidth": {"aliases": ["sw"], "key": null /* Not supported by Sublime. */}, | ||
| /* # of columns for tab key (space & tab). */ | ||
| "softtab": {"aliases": ["st"], "key": null /* Not supported by Sublime. */}, | ||
| /* Tabs → Spaces enable/disable. */ | ||
| "expandtab": {"aliases": ["et"], "key": "translate_tabs_to_spaces", "value": true}, | ||
| "noexpandtab": {"aliases": ["noet"], "key": "translate_tabs_to_spaces", "value": false}, | ||
| /* Show/hide line number. */ | ||
| "number": {"aliases": ["nu"], "key": "line_numbers", "value": true}, | ||
| "nonumber": {"aliases": ["nonu"], "key": "line_numbers", "value": false}, | ||
| /* Enable/disable word wrap. */ | ||
| "wrap": {"key": "word_wrap", "value": true}, | ||
| "nowrap": {"key": "word_wrap", "value": false}, | ||
| /* Set file encoding. */ | ||
| "fileencoding": {"aliases": ["fenc"], "key": "set_encoding()", "value-transforms": [ | ||
| {"type": "lowercase"}, | ||
| {"type": "map", "parameters": {"default": null, "table": { | ||
| /* null values are explicitly unsupported and will set the status line for the plugin to notify of the failure. | ||
| * If you use an encoding not in the list, it is implicitly unsupported and will also set the status line error. */ | ||
| "latin1": "Western (Windows 1252)", | ||
| "koi8-r": "Cyrillic (KOI8-R)", | ||
| "koi8-u": "Cyrillic (KOI8-U)", | ||
| "macroman": "Western (Mac Roman)", | ||
| "iso-8859-1": "Western (ISO 8859-1)", | ||
| "iso-8859-2": "Central European (ISO 8859-2)", | ||
| "iso-8859-3": "Western (ISO 8859-3)", | ||
| "iso-8859-4": "Baltic (ISO 8859-4)", | ||
| "iso-8859-5": "Cyrillic (ISO 8859-5)", | ||
| "iso-8859-6": "Arabic (ISO 8859-6)", | ||
| "iso-8859-7": "Greek (ISO 8859-7)", | ||
| "iso-8859-8": "Hebrew (ISO 8859-8)", | ||
| "iso-8859-9": "Turkish (ISO 8859-9)", | ||
| "iso-8859-10": "Nordic (ISO 8859-10)", | ||
| "iso-8859-13": "Estonian (ISO 8859-13)", | ||
| "iso-8859-14": "Celtic (ISO 8859-14)", | ||
| "iso-8859-15": "Western (ISO 8859-15)", | ||
| "iso-8859-16": "Romanian (ISO 8859-16)", | ||
| "cp437": "DOS (CP 437)", | ||
| "cp737": null, | ||
| "cp775": null, | ||
| "cp850": null, | ||
| "cp852": null, | ||
| "cp855": null, | ||
| "cp857": null, | ||
| "cp860": null, | ||
| "cp861": null, | ||
| "cp862": null, | ||
| "cp863": null, | ||
| "cp865": null, | ||
| "cp866": "Cyrillic (Windows 866)", | ||
| "cp869": null, | ||
| "cp874": null, | ||
| "cp1250": "Central European (Windows 1250)", | ||
| "cp1251": "Cyrillic (Windows 1251)", | ||
| "cp1252": "Western (Windows 1252)", | ||
| "cp1253": "Greek (Windows 1253)", | ||
| "cp1254": "Turkish (Windows 1254)", | ||
| "cp1255": "Hebrew (Windows 1255)", | ||
| "cp1256": "Arabic (Windows 1256)", | ||
| "cp1257": "Baltic (Windows 1257)", | ||
| "cp1258": "Vietnamese (Windows 1258)", | ||
| "cp932": null, | ||
| "euc-jp": null, | ||
| "sjis ": null, | ||
| "cp949": null, | ||
| "euc-kr": null, | ||
| "cp936": null, | ||
| "euc-cn": null, | ||
| "cp950": null, | ||
| "big5": null, | ||
| "euc-tw": null, | ||
| "utf-8": "utf-8", | ||
| "ucs-2le": "utf-16 le", | ||
| "utf-16": "utf-16 be", | ||
| "utf-16le": "utf-16 le", | ||
| "ucs-4": null, | ||
| "ucs-4le": null | ||
| }}}, | ||
| ]}, | ||
| }, | ||
| /* User mapping for VIM modelines (deep-merged for dictionaries; everything else is replaced; set a key to null to remove it from the default mapping). */ | ||
| "vim_mapping_user": {}, | ||
|
|
||
| /* Default Emacs commands mapping. | ||
| * Use can use `emacs_mapping_user` to define your own mapping while keeping this one. | ||
| * From <https://github.com/kvs/STEmacsModelines/blob/0a5487831c6ee5cedb924be4f1c64aa7651a3464/EmacsModelines.py>. */ | ||
| "emacs_mapping": { | ||
| /* Set line endings (DOS, Legacy MacOS, UNIX). */ | ||
| "coding": {"key": "set_line_endings()", "value-mapping": {"dos": "windows", "mac": "CR", "unix": "unix"}}, | ||
| /* Tabs → Spaces enable/disable. */ | ||
| "indent-tabs-mode": {"key": "translate_tabs_to_spaces", "value-mapping": {"nil": true, "0": true}, "value-mapping-default": false}, | ||
| /* Set the syntax of the file. */ | ||
| "mode": {"key": "syntax"}, | ||
| /* # of columns for each tab character. */ | ||
| "tab-width": {"key": "tab_size"}, | ||
| }, | ||
| /* User mapping for Emacs modelines (deep-merged for dictionaries; everything else is replaced; set a key to null to remove it from the default mapping). */ | ||
| "emacs_mapping_user": {}, | ||
|
|
||
| /* Whether debug logs should be enabled. | ||
| * Needs full plugin reload for the setting to take effect. */ | ||
| "verbose": false, | ||
| /* Whether to log to `/tmp/sublime_modelines_debug.log` in addition to stderr. | ||
| * This dates back to a time where I did not know how to show the console in Sublime (ctrl-`). | ||
| * I used to log to a temporary file that I tailed. | ||
| * Now this should probably always be `false`. */ | ||
| "log_to_tmp": false, | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.