aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Reintroduce FILE_SAVE_POST hookHEADmasterFrank Seifferth2023-10-081-0/+4
|
* Set values on WIN_OPEN rather than FILE_OPENFrank Seifferth2023-10-081-9/+9
| | | | | | | | | | This prepares the editorconfig plugin for upcoming changes in vis version 0.9. See the following two commits: https://github.com/martanne/vis/commit/450dc2df6a3b6443e372dc86cbefc8fede71b54d https://github.com/martanne/vis/commit/de315f878fba5b6abf2810a05995ae1f5b00d45d Thanks to Florian Fischer for bringing the issue to my attention.
* Inline ec_parse_cmd functionFrank Seifferth2023-10-081-2/+3
|
* Remove FILE_SAVE_POST hookFrank Seifferth2023-10-081-4/+0
| | | | | | | | | This hook was intended to be used to re-parse editorconfig files after writing changes to disk. The idea was that, if the file being written to disk should be an editorconfig file, the changes to that file might be applied directly. Since this does not seem to work properly at the moment, removing this hook should at least make the code more straightforward.
* remove the unused path parameterFlorian Fischer2023-10-051-7/+7
|
* use a module table to hold module local variablesFlorian Fischer2023-10-051-14/+17
| | | | | | | | | | | | | | | | Define the plugin specific variables that are accessed multiple times from within the plugin as members in the module table. Return the module table to allow the user of the plugin to modify those values. To enable the hooks the user can write ```lua local edconf = require('plugins/vis-editorconfig') edconf.hooks_enabled = true ``` in their visrc.lua file.
* make most plugin specific functions and variables localFlorian Fischer2023-10-051-17/+17
| | | | | edconf_hooks_enabled can not be made local because it is referenced before its declaration.
* declare function-local variables as localFlorian Fischer2023-10-051-3/+3
| | | | | | Lua uses the global scope per default. To not clutter the global namespace define function-local variables as local.
* Rename 'spell_language' to 'spelling_language'Frank Seifferth2023-09-251-2/+2
| | | | | | | | | | | | | | | | | | | Discussion on the editorconfig standard seems to converge on calling the property 'spelling_language' rather than 'spell_language' (see [1]). This commit adjusts both the value that is expected to be found in .editorconfig files as well as the internal variable that stores this property. Note to editorconfig users: This commit changes the plugin's behaviour in a non backwards compatible way. All editorconfig files that contain the 'spell_language' property need to be updated. Note to spellchecker plugin developers: Since this commit also updates the internal variable name, plugins need to update this name as well. [1] https://github.com/editorconfig/specification/pull/41
* Merge pull request #12 from fischerling/safe-empty-fileseifferth2022-09-051-1/+1
|\ | | | | fix insert_final_newline for empty files
| * fix insert_final_newline for empty filesFlorian Fischer2022-09-051-1/+1
|/ | | | | | | | | | When saving an empty file in a directory containing an editorconfig using the insert_final_newline option the content lookup 'file.size-1' fails. Fix this by only adding a final newline if the file contains any data. Signed-off-by: Florian Fischer <florian.fischer@muhq.space>
* Add note to readme warning about infinite recursionFrank Seifferth2022-03-151-2/+9
|
* Update repo url in readmeFrank Seifferth2022-02-121-1/+1
|
* Merge pull request #10 from raedwulf/fix-nil-pathseifferth2021-10-161-1/+1
|\ | | | | Fix incorrect path variable check
| * Fix incorrect path variable checkTai Chi Minh Ralph Eastwood2021-10-161-1/+1
|/ | | | Signed-off-by: Tai Chi Minh Ralph Eastwood <tcmreastwood@gmail.com>
* Revert "Allow setting arbitrary options via 'vis_*' keys"Frank Seifferth2021-10-072-29/+2
| | | | | | | | This reverts commit 556370f35d4486ad01d549a7f6ff24618a547908. It looks like nobody is interested in using 'vis_*' keys. If that changes, drop me a note to revert the revert. Until then, not having this feature seems to be the cleaner way.
* Add spell_languageFrank Seifferth2021-10-072-7/+17
| | | | | This is not part of the editorconfig specs, but has been proposed (cf. https://github.com/editorconfig/editorconfig/issues/315).
* Allow setting arbitrary options via 'vis_*' keysFrank Seifferth2021-10-072-1/+28
|
* Merge pull request #7 from fischerling/add-init-luaseifferth2021-05-111-0/+4
|\ | | | | Add init.lua sourcing edconf.lua
| * add init.lua sourcing edconf.luaFlorian Fischer2021-05-111-0/+4
| | | | | | | | | | This allows vis-editorconfig to be loaded in visrc.lua by simply using `require('path/to/vis-editorconfig')`
* | Add help message for edconfhooksFrank Seifferth2021-05-111-1/+1
| |
* | Simplify handling of insert_final_newlineFrank Seifferth2021-05-111-7/+2
|/
* Strip trailing newlines if insert_final_newline = falseFrank Seifferth2021-05-111-1/+24
| | | | | | | | | | | | | | | According to the editorconfig specification, insert_final_newline = false is supposed to mean stripping final newlines, if present. See https://editorconfig-specification.readthedocs.io/#supported-pairs > insert_final_newline Set to true ensure file ends with a > newline when saving and false to ensure it doesn’t. To my understanding, ensuring that a file doesn't end with a newline means stripping all trailing newlines.
* Fix usage of `file:content` for insert_final_newlineFrank Seifferth2021-05-111-1/+1
|
* Adjust original README.md a little for consistencyFrank Seifferth2021-05-111-2/+3
|
* Deactivate pre-save-hooks by default (including docs in readme)Frank Seifferth2021-05-112-0/+72
|
* Implement additional settings as pre-save-hooksFrank Seifferth2021-05-111-3/+100
|
* Bugfix for call to ec_set_values in FILE_SAVE_POST hookFrank Seifferth2021-05-111-1/+1
| | | | | | | Editorconfig tends to complain that the path should be a full path. Adjusting the call to the one specified for the FILE_OPEN hook solves that for me. I'm not sure if this also occurs with editorconfig-core-lua < 0.3.0, though.
* Merge pull request #4 from seifferth/update_editorconfigseifferth2021-05-112-9/+4
|\ | | | | Update to editorconfig-core-lua v0.3.0
| * ec.INDENT_STYLE_SPACE doesn't seem to work in v0.3.0Frank Seifferth2019-10-091-1/+1
| |
| * Update comment stating editorconfig version compatibilityFrank Seifferth2019-10-091-6/+1
| |
| * Update to editorconfig-core-lua v0.3.0Frank Seifferth2019-10-092-3/+3
|/ | | | | | | | | The lua module has been renamed to editorconfig in v0.3.0.[1] The rename could trigger a naming conflict with the `editorconfig.lua` module in vis. This commit includes a rename of the script to `edconf.lua` to prevent the naming conflict. [1]: https://github.com/editorconfig/editorconfig-core-lua/commit/3393dcf59cdc9e86102a56b2cd4b7aca60f45cee
* Add installation of editorconfig-core to instructionsSamadi van Koten2019-07-191-0/+2
| | | | Closes #3
* Merge pull request #2 from NoctuaNivalis/masterSamadi van Koten2018-10-301-1/+1
|\ | | | | use editorconfig_core constant for comparison
| * use editorconfig_core constant for comparisonFelix Van der Jeugt2018-10-081-1/+1
|/
* Create an editorconfig plugin for visSamadi van Koten2018-02-063-0/+96