forked from maksimr/vim-jsbeautify
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
24 changes: 24 additions & 0 deletions
24
test/vim/test_08/It should restore position cursor after the beautification
This file contains 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 @@ | ||
#!/bin/bash | ||
|
||
# test_07 | ||
# It should format javascript file | ||
# when we open it in new buffer | ||
# with default settings | ||
|
||
TMP_FILE='_tmp' | ||
|
||
echo $(cat file) > $TMP_FILE | ||
|
||
vim -u vimrc -c "execute 'bnext' | call setpos('.', [0,1,23,0]) | execute 'silent call JsBeautify()' | call setline('1', getpos('.')) | w | q | q" cap $TMP_FILE | ||
|
||
RESULT=$(cat $TMP_FILE) | ||
|
||
#clean | ||
if [ -f $TMP_FILE ] | ||
then | ||
rm $TMP_FILE | ||
fi | ||
|
||
clear | ||
|
||
[ "$RESULT" = "$(cat expected)" ] |
This file contains 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,4 @@ | ||
0 | ||
2 | ||
15 | ||
0 |
This file contains 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 @@ | ||
(function(){return "1";}()); |
This file contains 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,12 @@ | ||
" vim -u vimrc | ||
set nocompatible | ||
|
||
set nowrap | ||
|
||
let root = '~/.vim/bundle' | ||
|
||
filetype off | ||
syntax on | ||
|
||
runtime macros/matchit.vim | ||
exec 'set rtp+='.root.'/vim-jsbeautify' |