Commit Graph

415 Commits

Author SHA1 Message Date
lethal-guitar
a7009a9688 Correctly remove newline at end of file on Windows
The code for removing a newline at the end of a file was assuming that each
`eol` in `possible_eols` would be 1 character in length. This assumption
doesn't hold on Windows, where a newline is 2 characters long (`\r\n`). As a
result, auto-formatting files that have a Windows-style line ending would
result in the file's last line being terminated by `\r` (the full EOL cut in
half, essentially).

With this patch, we not only check that the last character of `stdoutdata`
matches the candidate `eol`, but instead check the full sequence of
characters depending on the length of `eol`.
2019-07-08 20:57:07 +02:00
Chiel ten Brinke
4f993fad63
Merge pull request #260 from dlunde/patch-1
Fix incorrect html-beautify command
2018-12-19 13:18:05 +01:00
Daniel Lundén
411ab72930
Fix incorrect html-beautify command
"html-beautify -f -" attempts to read from the file "-". To read from stdin, the correct command is "html-beautify -". 

Cheers
2018-12-19 12:58:55 +01:00
Chiel ten Brinke
c203080645 Fix code flow issue in python 2 code path. 2018-12-10 10:13:07 +01:00
Chiel ten Brinke
db17ccbacb
Merge pull request #255 from Chiel92/dev
Inspect returncode of formatter process
2018-10-22 13:52:44 +02:00
Chiel ten Brinke
8da4de80fb Inspect returncode of formatters as well. 2018-10-22 09:23:41 +02:00
Chiel ten Brinke
fc01fdf90f Simplify code. 2018-10-22 09:07:54 +02:00
Chiel ten Brinke
9ecbae7220
Merge pull request #254 from Mattias1/fix-formatterpath-on-windows-253
#253 Fix formatterpath seperator char on windows
2018-10-21 18:45:59 +02:00
Mattias
3c06476e73 #253 Fix formatterpath seperator char on windows 2018-10-21 17:05:45 +02:00
Chiel ten Brinke
3c09aec853
Update README.md 2018-10-16 18:18:44 +02:00
Chiel ten Brinke
f30546e894
Update README.md 2018-10-16 18:11:37 +02:00
Chiel ten Brinke
eda08fa331
Merge pull request #252 from Chiel92/add-black
Add basic definition for black formatter.
2018-10-16 12:08:16 +02:00
Chiel ten Brinke
d74fa6656e Add basic definition for black formatter. 2018-10-12 18:23:28 +02:00
Chiel ten Brinke
4b65df2444
Merge pull request #251 from Chiel92/write-read-viminfo
Write and read from the viminfo before and after formatting.
2018-10-12 18:01:51 +02:00
Chiel ten Brinke
f749df790c Write and read from the viminfo before and after formatting.
This should preserve the marks. Fixes #96.
2018-10-10 18:57:12 +02:00
Chiel ten Brinke
98233b8f35
Merge pull request #248 from junkblocker/patch-1
Add missing expand() for perltidyrc
2018-09-08 10:43:50 +02:00
Manpreet Singh
db967ab583
Add missing expand() for perltidyrc 2018-09-07 13:34:15 -07:00
Chiel ten Brinke
b8173cde86 Add sqlformat support. 2018-08-07 11:39:02 +02:00
Chiel ten Brinke
3c50ddb506 Improve prettier definition. 2018-05-28 17:09:12 +02:00
Chiel ten Brinke
d65d35ebe7 Merge branch 'master' into JulioJu-improve-prettier-config 2018-05-28 16:55:45 +02:00
Chiel ten Brinke
7d199cd124 Prettier: don't require a local config. 2018-05-24 10:24:53 +02:00
Chiel ten Brinke
7a2907b1e1
Merge pull request #240 from taketwo/patch-1
Use normal! to autointent code
2018-05-14 14:59:05 +02:00
Sergey Alexandrov
bde5b4ff63
Use normal! to autointent code
... otherwise might not work as expected if the user mapped any of the commands used. See [here](http://learnvimscriptthehardway.stevelosh.com/chapters/29.html) about `normal!`.
2018-05-13 14:31:43 -04:00
JulioJu
87fff48941 improve prettier configuration 2018-04-13 10:19:45 +02:00
Chiel ten Brinke
e63b4e957a
Update README.md 2018-03-02 11:59:24 +01:00
Chiel ten Brinke
481557f9bb
Merge pull request #231 from AndrewVos/add-prettier
Add support for prettier for JavaScript
2018-02-21 16:29:15 +01:00
Andrew Vos
be7a44c2e2 Add support for prettier for JavaScript
https://prettier.io/
2018-02-21 15:16:15 +00:00
Chiel ten Brinke
bfa82d7f99
Merge pull request #230 from mqudsi/eslint_global
Fall back to globally-installed `eslint` if not found locally
2018-02-05 10:11:27 +01:00
Chiel ten Brinke
92ad3b6593
Merge pull request #229 from mqudsi/eslint_fix
Fix eslint configuration file search
2018-02-05 10:10:38 +01:00
Mahmoud Al-Qudsi
64e80ccb19 Fall back to globally-installed eslint if not found locally
`sudo npm install -g eslint` installs `eslint` to `/usr/local/bin/`
from where it can be found and used.
2018-01-31 13:15:40 -06:00
Mahmoud Al-Qudsi
4de2e93753 Fix eslint configuration file search
`fnamemodify` called on a null/empty result of `findfile` results in a
non-empty value. `fnamemodify` was being called in this way prior to the
evaluation of the `if empty(l:tcfg)` rule, meaning Autoformat never
picked up on the fact that there was no configuration file, and instead
tried to call `eslint -c /path/to/project/` (with the folder path
instead of the .eslintrc path).
2018-01-31 13:15:11 -06:00
Chiel ten Brinke
298e7d5fa8
Merge pull request #226 from Cimbali/master
Add shfmt as a default formatter for shell files
2018-01-16 09:10:49 +01:00
Cimbali
18d5938363 Add shfmt as a default formatter for shell files
Taking into account vim indentation style dynamically (shiftwidth or
tabs).
2018-01-15 15:48:50 +01:00
Chiel ten Brinke
5661686e75 Merge branch 'dsissitka-elixir' 2018-01-15 14:28:20 +01:00
Chiel ten Brinke
e5048ad12a
Merge branch 'master' into elixir 2018-01-15 14:25:04 +01:00
Chiel ten Brinke
88ca36c8d8
Merge pull request #225 from rhysd/fixjson
Support fixjson; a JSON fixer/formatter
2018-01-15 14:21:23 +01:00
rhysd
5b5c0a9718 Support fixjson; a JSON fixer/formatter
https://github.com/rhysd/fixjson
2018-01-15 03:32:00 +09:00
David Sissitka
7a7c0d109f Add Elixir support. 2018-01-13 06:16:54 -05:00
Chiel ten Brinke
d2161ef6a3
Merge pull request #222 from Cimbali/master
Respect global YAPF config file
2018-01-11 10:00:37 +01:00
Cimbali
8b55636b2c Respect global YAPF config file 2018-01-11 09:21:56 +01:00
Chiel ten Brinke
dacf435019
Merge pull request #219 from gohxs/eslint-configuration-file
choose the closest eslintrc based on filename length
2018-01-02 10:25:44 +01:00
luis
cdb4e84a25 choose the closest eslintrc based on filename length
possible fix for #216
2017-12-12 05:18:46 -02:00
Chiel ten Brinke
27f0e48a9b
Merge pull request #218 from gohxs/eslint-extension
Added current file extension to eslint tmp file
2017-12-06 11:30:34 +01:00
luis
36f2a83ec6 corrected the indent on last change 2017-12-05 19:02:34 -02:00
luis
3a9e28959b Added current file extension to eslint tmp file 2017-12-05 18:53:51 -02:00
Chiel ten Brinke
0cd1a4d8b8
Merge pull request #217 from mqudsi/tidy_svg
Set tidy_xml as the default formatter for SVG files
2017-11-28 11:16:48 +01:00
Mahmoud Al-Qudsi
7186a54af9 Set tidy_xml as the default formatter for SVG files
SVG is just XML + namespace, so tidy_xml is a good default formatter for
SVG files.
2017-11-19 12:41:01 -06:00
Chiel ten Brinke
c32b27cd40 Merge pull request #213 from Chiel92/only_write_changes
Check for changes before writing to buffer
2017-10-23 09:09:32 +02:00
Chiel ten Brinke
a4b3c40e8c Solve #128. 2017-10-20 14:45:24 +02:00
Chiel ten Brinke
f68c2cc9b6 Minor rewording. 2017-10-05 11:17:03 +02:00