File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ endfunction
30
30
31
31
" "
32
32
" Completion for :Note.
33
- function ! noteworthy#Completion (arg_lead, cmd_line, cursor_pos ) abort
33
+ function ! noteworthy#Completion (... ) abort
34
34
let l: fext = get (g: , ' noteworthy_ambiguous' , 0 ) ? ' *' : s: GetNoteFileExt ()
35
35
let l: dir = s: GetCurrentLibrary ()
36
36
if ! isdirectory (l: dir ) | return ' ' | endif
@@ -75,8 +75,22 @@ function! noteworthy#Delimiter(...) abort
75
75
\ get (g: , ' noteworthy_delimiter' , s: GetNoteDelimiter ()) . ' "'
76
76
endfunction
77
77
78
+ " "
79
+ " I don't know what I'm doing :(
80
+ function ! noteworthy#Visualize () abort
81
+ vert split ' __NOTES__'
82
+ let l: files = split (noteworthy#Completion (), " \n " )
83
+ call append (0 , l: files )
84
+ setlocal readonly
85
+ nnoremap <buffer> <CR> call s:Open()
86
+ endfunction
87
+
78
88
" PRIVATE API
79
89
90
+ function ! s: Open () abort
91
+ execute ' edit' s: GetCurrentLibrary () . getline (' .' )<CR>
92
+ endfunction
93
+
80
94
" "
81
95
" The current library in use.
82
96
function ! s: GetCurrentLibrary ()
Original file line number Diff line number Diff line change @@ -52,3 +52,5 @@ command! -nargs=0 NoteAmbiguousDisable let g:noteworthy_ambiguous = 0
52
52
" :NoteDelimiter [{delimiter}]
53
53
" Show or change the current delimiter.
54
54
command ! -nargs =? NoteDelimiter call noteworthy#Delimiter (<f-args> )
55
+
56
+ command ! -nargs =0 NoteVisualize call noteworthy#Visualize ()
You can’t perform that action at this time.
0 commit comments