Skip to content

Commit af6611f

Browse files
authored
test(popup): resolve symlink in popup window (#2)
* test(fixture): prepare tagged.link.vim * test(vader): add test to resolve symlink in popup window
1 parent 98ab648 commit af6611f

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ clean:
1717
test: test/vader.vim
1818
@cd test && $(VIM) $(VIM_FLAGS) -c 'Vader! symlink.vader'
1919
@cd test && $(VIM) $(VIM_FLAGS) -R -c 'Vader! symlink.vader'
20+
@cd test && $(VIM) $(VIM_FLAGS) -c 'Vader! symlink-edit-in-popup.vader'
2021
@cd test && $(VIM) $(VIM_FLAGS) -o fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-horizontal.vader'
2122
@cd test && $(VIM) $(VIM_FLAGS) -O fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-vertical.vader'
2223
@cd test && $(VIM) $(VIM_FLAGS) -d fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-vertical.vader'

test/fixture/tagged.original.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
command! Foo :
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../tagged.original.vim

test/fixture/tagged/tags

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/
2+
!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/
3+
!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/
4+
!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/
5+
!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/
6+
!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/
7+
!_TAG_FIELD_DESCRIPTION input /input file/
8+
!_TAG_FIELD_DESCRIPTION name /tag name/
9+
!_TAG_FIELD_DESCRIPTION pattern /pattern/
10+
!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/
11+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
12+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
13+
!_TAG_KIND_DESCRIPTION!Vim C,constant /constant definitions/
14+
!_TAG_KIND_DESCRIPTION!Vim a,augroup /autocommand groups/
15+
!_TAG_KIND_DESCRIPTION!Vim c,command /user-defined commands/
16+
!_TAG_KIND_DESCRIPTION!Vim f,function /function definitions/
17+
!_TAG_KIND_DESCRIPTION!Vim k,class /vim9script classes/
18+
!_TAG_KIND_DESCRIPTION!Vim m,map /maps/
19+
!_TAG_KIND_DESCRIPTION!Vim n,filename /vimball filename/
20+
!_TAG_KIND_DESCRIPTION!Vim v,variable /variable definitions/
21+
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
22+
!_TAG_OUTPUT_FILESEP slash /slash or backslash/
23+
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
24+
!_TAG_OUTPUT_VERSION 1.1 /current.age/
25+
!_TAG_PARSER_VERSION!Vim 1.1 /current.age/
26+
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
27+
!_TAG_PROC_CWD /home/aileot/.local/share/nvim/lazy/vim-symlink/test/fixture/tagged/ //
28+
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
29+
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
30+
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
31+
!_TAG_PROGRAM_VERSION 6.2.0 //
32+
Foo tagged.link.vim /^command! Foo :$/;" c

test/symlink-edit-in-popup.vader

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Before:
2+
execute 'cd' fnameescape(fnamemodify(g:vader_file, ':p:h'))
3+
4+
" It should follow the symlinks for every file
5+
Execute (skip the 2 Vader.vim buffers):
6+
quit!
7+
quit!
8+
9+
Then (opening a symlinked file to a popup window):
10+
if !has('&previewpopup')
11+
finish
12+
endif
13+
set previewpopup=height:10,width:60
14+
execute 'set tags='.. fnamemodify(g:vader_file, ':p:h') ..'/fixture/tagged/tags'
15+
ptag Foo
16+
AssertEqual 'fixture/tagged.original.vim', bufname('$')

0 commit comments

Comments
 (0)