mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-01 19:02:22 +01:00
Merge remote-tracking branch 'origin/master' into fix-1063
This commit is contained in:
@@ -30,13 +30,11 @@ fn all_themes_are_present() {
|
||||
"Solarized (light)",
|
||||
"Sublime Snazzy",
|
||||
"TwoDark",
|
||||
"ansi-dark",
|
||||
"ansi-light",
|
||||
"ansi",
|
||||
"base16",
|
||||
"base16-256",
|
||||
"gruvbox",
|
||||
"gruvbox-dark",
|
||||
"gruvbox-light",
|
||||
"gruvbox-white",
|
||||
"zenburn"
|
||||
]
|
||||
);
|
||||
|
4
tests/benchmarks/comparison.sh
vendored
4
tests/benchmarks/comparison.sh
vendored
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
||||
|
||||
if ! which hyperfine > /dev/null 2>&1; then
|
||||
if ! command -v hyperfine > /dev/null 2>&1; then
|
||||
echo "'hyperfine' does not seem to be installed."
|
||||
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
||||
exit 1
|
||||
|
4
tests/benchmarks/run-benchmarks.sh
vendored
4
tests/benchmarks/run-benchmarks.sh
vendored
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
||||
|
||||
if ! which hyperfine > /dev/null 2>&1; then
|
||||
if ! command -v hyperfine > /dev/null 2>&1; then
|
||||
echo "'hyperfine' does not seem to be installed."
|
||||
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
||||
exit 1
|
||||
|
@@ -837,3 +837,41 @@ fn show_all_mode() {
|
||||
.stdout("hello·world␊\n├──┤␍␀␇␈␛")
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plain_mode_does_not_add_nonexisting_newline() {
|
||||
bat()
|
||||
.arg("--paging=never")
|
||||
.arg("--color=never")
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=plain")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("Single Line");
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/sharkdp/bat/issues/299
|
||||
#[test]
|
||||
fn grid_for_file_without_newline() {
|
||||
bat()
|
||||
.arg("--paging=never")
|
||||
.arg("--color=never")
|
||||
.arg("--terminal-width=80")
|
||||
.arg("--wrap=never")
|
||||
.arg("--decorations=always")
|
||||
.arg("--style=full")
|
||||
.arg("single-line.txt")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
"\
|
||||
───────┬────────────────────────────────────────────────────────────────────────
|
||||
│ File: single-line.txt
|
||||
───────┼────────────────────────────────────────────────────────────────────────
|
||||
1 │ Single Line
|
||||
───────┴────────────────────────────────────────────────────────────────────────
|
||||
",
|
||||
)
|
||||
.stderr("");
|
||||
}
|
||||
|
@@ -175,4 +175,4 @@
|
||||
[38;2;117;113;94m\u{ad}[0m[38;2;249;38;114m␊[0m
|
||||
[38;2;117;113;94m\u{ae}[0m[38;2;249;38;114m␊[0m
|
||||
[38;2;249;38;114m␊[0m
|
||||
[38;2;248;248;242mHere's[0m[38;2;102;217;239m·[0m[38;2;248;248;242ma[0m[38;2;102;217;239m·[0m[38;2;248;248;242mline[0m[38;2;102;217;239m·[0m[38;2;248;248;242mwith[0m[38;2;102;217;239m·[0m[38;2;248;248;242mmultiple[0m[38;2;102;217;239m·[0m[38;2;248;248;242mcharacters.[0m
|
||||
[38;2;248;248;242mHere's[0m[38;2;102;217;239m·[0m[38;2;248;248;242ma[0m[38;2;102;217;239m·[0m[38;2;248;248;242mline[0m[38;2;102;217;239m·[0m[38;2;248;248;242mwith[0m[38;2;102;217;239m·[0m[38;2;248;248;242mmultiple[0m[38;2;102;217;239m·[0m[38;2;248;248;242mcharacters.[0m[38;2;249;38;114m␊[0m
|
||||
|
92
tests/syntax-tests/highlighted/VimL/source.vim
Normal file
92
tests/syntax-tests/highlighted/VimL/source.vim
Normal file
@@ -0,0 +1,92 @@
|
||||
[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255m&compatible[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mset[0m[38;2;248;248;242m nocompatible[0m
|
||||
[38;2;249;38;114mendif[0m
|
||||
|
||||
[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;102;217;239mhas[0m[38;2;248;248;242m([0m[38;2;230;219;116m'win32'[0m[38;2;248;248;242m) [0m[38;2;249;38;114m||[0m[38;2;248;248;242m has ([0m[38;2;230;219;116m'win64'[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mlet[0m[38;2;248;248;242m $VIMHOME = $HOME [0m[38;2;249;38;114m.[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/vimfiles"[0m
|
||||
[38;2;249;38;114melseif[0m[38;2;248;248;242m [0m[38;2;255;255;255mv:false[0m[38;2;248;248;242m [0m[38;2;249;38;114m&&[0m[38;2;248;248;242m [0m[38;2;255;255;255mv:true[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Can't get here"[0m
|
||||
[38;2;249;38;114melse[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mlet[0m[38;2;248;248;242m $VIMHOME = $HOME [0m[38;2;249;38;114m.[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/.vim"[0m
|
||||
[38;2;249;38;114mendif[0m
|
||||
|
||||
[38;2;117;113;94m" show existing tab with 2 spaces width[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m tabstop=[0m[38;2;190;132;255m2[0m
|
||||
[38;2;117;113;94m" when indenting with '>', use 2 spaces width[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m shiftwidth=[0m[38;2;190;132;255m2[0m
|
||||
[38;2;117;113;94m" always set autoindenting on[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m autoindent[0m
|
||||
|
||||
[38;2;102;217;239mautocmd[0m[38;2;248;248;242m VimEnter [0m[38;2;249;38;114m*[0m[38;2;248;248;242m [0m[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello Vim"[0m
|
||||
|
||||
[38;2;117;113;94m" Allow :W and :Wq to save too[0m
|
||||
[38;2;102;217;239mcommand[0m[38;2;248;248;242m! Wq :wq[0m
|
||||
[38;2;102;217;239mcommand[0m[38;2;248;248;242m! W :w[0m
|
||||
|
||||
[38;2;249;38;114maugroup[0m[38;2;248;248;242m vimrc[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mautocmd[0m[38;2;248;248;242m![0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mautocmd[0m[38;2;248;248;242m [0m[38;2;248;248;242mFileType[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;248;248;242m [0m[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"New filetype"[0m
|
||||
[38;2;249;38;114maugroup[0m[38;2;248;248;242m END[0m
|
||||
|
||||
[38;2;249;38;114mfunction[0m[38;2;248;248;242m! [0m[38;2;166;226;46ms:echo[0m[38;2;248;248;242m([0m[38;2;248;248;242mwhat)[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;102;217;239ma[0m[38;2;249;38;114m:[0m[38;2;248;248;242mwhat[0m
|
||||
[38;2;249;38;114mendfunction[0m
|
||||
|
||||
[38;2;249;38;114mfunction[0m[38;2;248;248;242m! [0m[38;2;166;226;46mHelloWorld[0m[38;2;248;248;242m([0m[38;2;248;248;242mname)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255ml:function_local[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"function_local_var"[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255ml:parts[0m[38;2;248;248;242m = [0m[38;2;102;217;239msplit[0m[38;2;248;248;242m([0m[38;2;255;255;255ml:function_local[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"_"[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255ml:greeting[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"Hello "[0m[38;2;248;248;242m [0m[38;2;249;38;114m.[0m[38;2;248;248;242m [0m[38;2;102;217;239ma[0m[38;2;249;38;114m:[0m[38;2;248;248;242mname[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;102;217;239ms:echo[0m[38;2;248;248;242m([0m[38;2;255;255;255ml:greeting[0m[38;2;248;248;242m)[0m
|
||||
[38;2;249;38;114mendfunction[0m
|
||||
|
||||
[38;2;249;38;114mfunction[0m[38;2;248;248;242m! [0m[38;2;166;226;46msource#Hello[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello from namespace"[0m
|
||||
[38;2;249;38;114mendfunction[0m
|
||||
|
||||
[38;2;249;38;114mfunction[0m[38;2;248;248;242m! [0m[38;2;166;226;46mEchoFunc[0m[38;2;248;248;242m([0m[38;2;249;38;114m.[0m[38;2;249;38;114m.[0m[38;2;249;38;114m.[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m s [0m[38;2;249;38;114min[0m[38;2;248;248;242m [0m[38;2;102;217;239ma[0m[38;2;249;38;114m:[0m[38;2;190;132;255m000[0m
|
||||
[38;2;248;248;242m echon [0m[38;2;230;219;116m' '[0m[38;2;248;248;242m [0m[38;2;249;38;114m.[0m[38;2;248;248;242m s[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mendfor[0m
|
||||
[38;2;249;38;114mendfunction[0m
|
||||
|
||||
[38;2;102;217;239mimap[0m[38;2;248;248;242m [0m[3;38;2;166;226;46m<C-h>[0m[38;2;248;248;242m [0m[3;38;2;166;226;46m<C-r>[0m[38;2;248;248;242m=[0m[38;2;102;217;239mHelloWorld[0m[38;2;248;248;242m([0m[38;2;230;219;116m"World"[0m[38;2;248;248;242m)[0m[3;38;2;166;226;46m<CR>[0m
|
||||
|
||||
[38;2;102;217;239mcommand[0m[38;2;248;248;242m! [0m[3;38;2;166;226;46m-nargs=[0m[38;2;248;248;242m? Echo :call [0m[38;2;102;217;239mEchoFunc[0m[38;2;248;248;242m([0m[3;38;2;166;226;46m<args>[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;117;113;94m" TODO test stuff[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:global[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"global var"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255ms:script_var[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"script var"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mw:window_var[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"window war"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mb:buffer_var[0m[38;2;248;248;242m = [0m[38;2;230;219;116m"buffer war"[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m t[0m[38;2;249;38;114m:[0m[38;2;248;248;242mtab_var = [0m[38;2;230;219;116m"tab war"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;255;255;255mv:false[0m
|
||||
|
||||
[38;2;190;132;255m3[0m[38;2;248;248;242m + [0m[38;2;190;132;255m5[0m
|
||||
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m==#[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m==?[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m is [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114misnot[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m=~[0m[38;2;248;248;242m [0m[38;2;230;219;116m'xx*'[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m!~[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello"[0m[38;2;248;248;242m [0m[38;2;249;38;114m!~[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Hello2"[0m
|
||||
|
||||
[38;2;102;217;239mecho[0m[38;2;248;248;242m [0m[38;2;230;219;116m"/This/should/not/be/a/regex"[0m
|
||||
|
||||
[38;2;117;113;94m" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)[0m
|
||||
[38;2;102;217;239mset[0m[38;2;248;248;242m runtimepath[0m[38;2;249;38;114m=~[0m[38;2;248;248;242m/foo/bar[0m
|
||||
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mg/Aap/[0m[38;2;248;248;242mp[0m
|
||||
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict[0m[38;2;248;248;242m = {}[0m
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict[0m[38;2;249;38;114m.[0m[38;2;248;248;242mitem = [[0m[38;2;230;219;116m'l1'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'l2'[0m[38;2;248;248;242m][0m
|
||||
|
||||
[38;2;102;217;239mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255mg:dict2[0m[38;2;248;248;242m = {[0m[38;2;230;219;116m'dict_item'[0m[38;2;248;248;242m: [[0m[38;2;230;219;116m'l1'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'l2'[0m[38;2;248;248;242m], [0m[38;2;230;219;116m'di2'[0m[38;2;248;248;242m: [0m[38;2;230;219;116m'x'[0m[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mg/regex/[0m
|
||||
[38;2;248;248;242msilent [0m[38;2;246;170;17mv/regex/[0m
|
||||
[38;2;248;248;242msilent [0m[38;2;249;38;114m%[0m[38;2;246;170;17ms/regex/[0m[38;2;248;248;242mnot_regex/[0m
|
||||
|
||||
[38;2;102;217;239mfiletype[0m[38;2;248;248;242m plugin indent on[0m
|
||||
[38;2;102;217;239msyntax[0m[38;2;248;248;242m enable[0m
|
2
tests/syntax-tests/regression_test.sh
vendored
2
tests/syntax-tests/regression_test.sh
vendored
@@ -4,7 +4,7 @@ set -eou pipefail
|
||||
|
||||
script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
output_directory=$(mktemp -d --suffix=.bat-syntax-regression-test)
|
||||
output_directory=$(mktemp -d)
|
||||
|
||||
"$script_directory"/create_highlighted_versions.py --output="$output_directory"
|
||||
|
||||
|
@@ -72,4 +72,4 @@ package TestSyntax {
|
||||
var sndChannel:SoundChannel = mySound.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -56,4 +56,4 @@ set LDLIBS= ^
|
||||
@set "LINK_FILES=%LINK_FILES% %%~f"
|
||||
)
|
||||
|
||||
lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS%
|
||||
lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS%
|
||||
|
@@ -55,4 +55,4 @@
|
||||
(println (factorial 5))
|
||||
(log)
|
||||
(log "Message"))
|
||||
|
||||
|
||||
|
@@ -16,4 +16,4 @@ EXPOSE 80/tcp
|
||||
|
||||
VOLUME [/var/lib/mysql/data]
|
||||
|
||||
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
||||
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
||||
|
@@ -13,4 +13,4 @@
|
||||
*.patch -text
|
||||
|
||||
.gitattributes linguist-language=gitattributes
|
||||
.gitkeep export-ignore
|
||||
.gitkeep export-ignore
|
||||
|
@@ -104,4 +104,4 @@
|
||||
[user]
|
||||
email = f.nord@example.com
|
||||
name = Frank Nord
|
||||
signingkey = AAAAAAAAAAAAAAAA
|
||||
signingkey = AAAAAAAAAAAAAAAA
|
||||
|
@@ -5,4 +5,4 @@
|
||||
192.160.0.200 try.sample.test try #another comment
|
||||
216.58.223.238 google.com
|
||||
|
||||
::1 localhost.try ip6-localhost
|
||||
::1 localhost.try ip6-localhost
|
||||
|
@@ -382,4 +382,4 @@ install: all
|
||||
@ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
|
||||
|
||||
uninstall:
|
||||
rm -f $(INSTALL_BIN)/{$(REDIS_SERVER_NAME),$(REDIS_BENCHMARK_NAME),$(REDIS_CLI_NAME),$(REDIS_CHECK_RDB_NAME),$(REDIS_CHECK_AOF_NAME),$(REDIS_SENTINEL_NAME)}
|
||||
rm -f $(INSTALL_BIN)/{$(REDIS_SERVER_NAME),$(REDIS_BENCHMARK_NAME),$(REDIS_CLI_NAME),$(REDIS_CHECK_RDB_NAME),$(REDIS_CHECK_AOF_NAME),$(REDIS_SENTINEL_NAME)}
|
||||
|
@@ -108,4 +108,4 @@ $doe->setName('John Doe');
|
||||
|
||||
$ending = 2 > 3 ? "yep" : "nah";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -5,4 +5,4 @@ pywheels>=12.4 #a whitespace followed by comments
|
||||
Nuitka<0.6.8.4
|
||||
wxPython>=1.0, <=2.1
|
||||
|
||||
#this is another comment
|
||||
#this is another comment
|
||||
|
92
tests/syntax-tests/source/VimL/source.vim
Normal file
92
tests/syntax-tests/source/VimL/source.vim
Normal file
@@ -0,0 +1,92 @@
|
||||
if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
|
||||
if has('win32') || has ('win64')
|
||||
let $VIMHOME = $HOME . "/vimfiles"
|
||||
elseif v:false && v:true
|
||||
echo "Can't get here"
|
||||
else
|
||||
let $VIMHOME = $HOME . "/.vim"
|
||||
endif
|
||||
|
||||
" show existing tab with 2 spaces width
|
||||
set tabstop=2
|
||||
" when indenting with '>', use 2 spaces width
|
||||
set shiftwidth=2
|
||||
" always set autoindenting on
|
||||
set autoindent
|
||||
|
||||
autocmd VimEnter * echo "Hello Vim"
|
||||
|
||||
" Allow :W and :Wq to save too
|
||||
command! Wq :wq
|
||||
command! W :w
|
||||
|
||||
augroup vimrc
|
||||
autocmd!
|
||||
autocmd FileType * echo "New filetype"
|
||||
augroup END
|
||||
|
||||
function! s:echo(what)
|
||||
return a:what
|
||||
endfunction
|
||||
|
||||
function! HelloWorld(name)
|
||||
let l:function_local = "function_local_var"
|
||||
let l:parts = split(l:function_local, "_")
|
||||
let l:greeting = "Hello " . a:name
|
||||
return s:echo(l:greeting)
|
||||
endfunction
|
||||
|
||||
function! source#Hello()
|
||||
return "Hello from namespace"
|
||||
endfunction
|
||||
|
||||
function! EchoFunc(...)
|
||||
for s in a:000
|
||||
echon ' ' . s
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
imap <C-h> <C-r>=HelloWorld("World")<CR>
|
||||
|
||||
command! -nargs=? Echo :call EchoFunc(<args>)
|
||||
|
||||
" TODO test stuff
|
||||
let g:global = "global var"
|
||||
let s:script_var = "script var"
|
||||
let w:window_var = "window war"
|
||||
let b:buffer_var = "buffer war"
|
||||
let t:tab_var = "tab war"
|
||||
echo v:false
|
||||
|
||||
3 + 5
|
||||
|
||||
echo "Hello" ==# "Hello2"
|
||||
echo "Hello" ==? "Hello2"
|
||||
echo "Hello" == "Hello2"
|
||||
echo "Hello" is "Hello2"
|
||||
echo "Hello" isnot "Hello2"
|
||||
echo "Hello" =~ 'xx*'
|
||||
echo "Hello" !~ "Hello2"
|
||||
echo "Hello" !~ "Hello2"
|
||||
|
||||
echo "/This/should/not/be/a/regex"
|
||||
|
||||
" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
|
||||
set runtimepath=~/foo/bar
|
||||
|
||||
silent g/Aap/p
|
||||
|
||||
let g:dict = {}
|
||||
let g:dict.item = ['l1', 'l2']
|
||||
|
||||
let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
|
||||
|
||||
silent g/regex/
|
||||
silent v/regex/
|
||||
silent %s/regex/not_regex/
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
@@ -31,4 +31,4 @@ emails:
|
||||
- bob@example.com
|
||||
- bill@example.com
|
||||
supervisors:
|
||||
- george@example.com
|
||||
- george@example.com
|
||||
|
@@ -317,4 +317,4 @@ blank lines before and after.)
|
||||
..
|
||||
|
||||
So this block is not "lost",
|
||||
despite its indentation.
|
||||
despite its indentation.
|
||||
|
2
tests/syntax-tests/update.sh
vendored
2
tests/syntax-tests/update.sh
vendored
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
||||
|
||||
python="python3"
|
||||
if ! command -v python3 &>/dev/null; then python="python"; fi
|
||||
|
Reference in New Issue
Block a user