File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,14 @@ function! s:project_root()
110110 return s: find_root (name, g: terminal_rootmarkers , 0 )
111111endfunc
112112
113+ function ! s: terminal_view (mode )
114+ if a: mode == 0
115+ let w: __terminal_view__ = winsaveview ()
116+ elseif exists (' w:__terminal_view__' )
117+ call winrestview (w: __terminal_view__ )
118+ unlet w: __terminal_view__
119+ endif
120+ endfunc
113121
114122" ----------------------------------------------------------------------
115123" open a new/previous terminal
@@ -119,14 +127,6 @@ function! TerminalOpen(...)
119127 let pos = get (g: , ' terminal_pos' , ' rightbelow' )
120128 let height = get (g: , ' terminal_height' , 10 )
121129 let succeed = 0
122- function ! s: terminal_view (mode )
123- if a: mode == 0
124- let w: __terminal_view__ = winsaveview ()
125- elseif exists (' w:__terminal_view__' )
126- call winrestview (w: __terminal_view__ )
127- unlet w: __terminal_view__
128- endif
129- endfunc
130130 let uid = win_getid ()
131131 keepalt noautocmd windo call s: terminal_view (0 )
132132 keepalt noautocmd call win_gotoid (uid)
You can’t perform that action at this time.
0 commit comments