Dominique Leuenberger 2021-04-26 14:39:27 +00:00 committed by Git OBS Bridge
commit 62fbe2516c
7 changed files with 130 additions and 18 deletions

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:58cb89e9ac8c3a65e7ef01782b99ea15ef63171d40977645a3970c230b183678
size 26135

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5e41447efc3493161a34488bcb273f7cb1576b95be27d2453bc765e11ceac6e3
size 10423

View File

@ -0,0 +1,86 @@
From: Sam Protsenko <semen.protsenko@linaro.org>
Date: Wed, 12 Jun 2019 17:12:56 +0300
Subject: Fix other plugins loading
Git-repo: https://github.com/joe-skb7/file-line
Git-commit: f1bf6c52f1948ebe639af9189ac240854cb84076
Patch-mainline: https://github.com/bogado/file-line/pull/77 pending
References: https://github.com/bogado/file-line/issues/62
It was noticed that file_line plugin breaks the loading of
other plugins. For example, when having next line in ~/.vimrc:
au BufNewFile main.c silent! 0r ~/.vim/skeleton/template.c
this line loads the content from template file when I'm creating new
main.c file. But when file-line plugin is installed this functionality
doesn't work (newly created main.c is blank). This patch fixes that.
Also, it was reported that file_line breaks vim-go plugin. I haven't
check if this patch fixes it though.
Fixes: #62
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
plugin/file_line.vim | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/plugin/file_line.vim b/plugin/file_line.vim
index 7244014c47e4..afa8012ece40 100644
--- a/plugin/file_line.vim
+++ b/plugin/file_line.vim
@@ -35,7 +35,10 @@ function! s:reopenAndGotoLine(file_name, line_num, col_num)
exec "filetype detect"
endfunction
-function! s:gotoline()
+" Returns actual file name (without :* part)
+" If is_goto parameter is 1, then file will be re-opened at the line parsed from
+" :* part
+function! s:get_file_name_and_goto(is_goto)
let file = bufname("%")
" :e command calls BufRead even though the file is a new one.
@@ -53,14 +56,27 @@ function! s:gotoline()
if ! empty(l:names)
let file_name = l:names[1]
let line_num = l:names[2] == ''? '0' : l:names[2]
- let col_num = l:names[3] == ''? '0' : l:names[3]
- call s:reopenAndGotoLine(file_name, line_num, col_num)
+ let col_num = l:names[3] == ''? '0' : l:names[3]
+ if (a:is_goto == 1)
+ call s:reopenAndGotoLine(file_name, line_num,
+ \ col_num)
+ endif
return file_name
endif
endfor
return file
endfunction
+" Get the actual file name
+function! s:file_name()
+ return s:get_file_name_and_goto(0)
+endfunction
+
+" Open file at the line after :* part
+function! s:gotoline()
+ return s:get_file_name_and_goto(1)
+endfunction
+
" Handle entry in the argument list.
" This is called via `:argdo` when entering Vim.
function! s:handle_arg()
@@ -87,6 +103,7 @@ function! s:startup()
endif
endfunction
-if !isdirectory(expand("%:p"))
+" Only use file_line upon files (not directory), and only if file already exists
+if (!isdirectory(expand("%:p")) && filereadable(expand(s:file_name())))
autocmd VimEnter * call s:startup()
endif
--
2.31.1

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Apr 26 07:09:59 UTC 2021 - Jiri Slaby <jslaby@suse.cz>
- Fix bufexplorer's source link.
-------------------------------------------------------------------
Fri Apr 23 06:56:31 UTC 2021 - Jiri Slaby <jslaby@suse.cz>
- Update several plugins
* bufexplorer to 7.4.21
* calendar to 2.5
- add file-line-Fix-other-plugins-loading.patch
-------------------------------------------------------------------
Tue Apr 13 05:40:02 UTC 2021 - Jiri Slaby <jslaby@suse.cz>

View File

@ -19,8 +19,8 @@
%define ack_version 1.0.9
%define align_version 36.42
%define a_version 2.18
%define bufexplorer_version 7.2.8
%define calendar_version 2.4
%define bufexplorer_version 7.4.21
%define calendar_version 2.5
%define colorsel_version 20110107
%define colorschemes_version 1.0
%define diffchanges_version 0.6.346dae2
@ -63,8 +63,8 @@ Group: Productivity/Text/Editors
URL: http://www.vim.org/
Source0: vimplugin-align-%{align_version}.tar.bz2
Source1: vimplugin-a-%{a_version}.tar.bz2
Source2: vimplugin-bufexplorer-%{bufexplorer_version}.tar.bz2
Source3: vimplugin-calendar-%{calendar_version}.tar.bz2
Source2: https://github.com/jlanzarotta/bufexplorer/archive/refs/tags/v%{bufexplorer_version}.tar.gz#/bufexplorer-%{bufexplorer_version}.tar.gz
Source3: https://github.com/vim-scripts/calendar.vim--Matsumoto/archive/refs/tags/%{calendar_version}.tar.gz#/calendar.vim--Matsumoto-%{calendar_version}.tar.gz
Source4: vimplugin-colorsel-%{colorsel_version}.tar.bz2
Source5: vimplugin-colorschemes-%{colorschemes_version}.tar.bz2
Source6: vimplugin-diffchanges-%{diffchanges_version}.tar.bz2
@ -103,6 +103,7 @@ Source101: vim-latex-%{latex_version}.tar.xz
Source1000: https://raw.githubusercontent.com/openSUSE/pack-tools/master/contrib/vim/spec.snippets
Patch1: locateopen-1.3-locate-support.patch
Patch2: showmarks-signs.patch
Patch3: file-line-Fix-other-plugins-loading.patch
BuildRequires: vim
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@ -157,17 +158,24 @@ different.
Version: %bufexplorer_version
Release: 0
Summary: Buffer Explorer / Browser
License: ISC
License: BSD-3-Clause
Group: Productivity/Text/Editors
Requires: vim
%description -n vim-plugin-bufexplorer
With bufexplorer, you can quickly switch between buffers by using '\be' to open
the explorer.vim. Then by using the normal movement keys or mouse to select the
needed buffer and then finally pressing <Enter> or <Left Mouse Click> to open
the buffer in the current window or <Shift Enter> or 't' to open that buffer in
a new tab. If the buffer is in another tab already, bufexplorer can switch to
that tab if you would like.
With bufexplorer, you can quickly and easily switch between buffers by using
the one of the default public interfaces:
\<Leader\>be normal open
\<Leader\>bt toggle open / close
\<Leader\>bs force horizontal split open
\<Leader\>bv force vertical split open
Once the bufexplorer window is open you can use the normal movement keys (hjkl)
to move around and then use or to select the buffer you would like to open. If
you would like to have the selected buffer opened in a new tab, simply press
either or 't'. Please note that when opening a buffer in a tab, that if the
buffer is already in another tab, bufexplorer can switch to that tab
automatically for you if you would like.
%package -n vim-plugin-calendar
Version: %calendar_version
@ -630,12 +638,15 @@ popd
pushd vimplugin-showmarks-%showmarks_version
%patch2 -p1
popd
pushd file-line-%file_line_version
%patch3 -p1
popd
%build
%install
mkdir -p %buildroot/%vimplugin_dir
for i in vimplugin-* file-line-*; do
for i in vimplugin-* calendar.vim--Matsumoto-* bufexplorer-* file-line-*; do
pushd $i
cp -av * %buildroot/%vimplugin_dir/
popd
@ -677,6 +688,7 @@ popd
cp %{SOURCE1000} %{buildroot}/%vimplugin_dir/snippets/
# delete unneeded files
rm -rf %{buildroot}/%vimplugin_dir/LICENSE
rm -rf %{buildroot}/%vimplugin_dir/README*
rm -rf %{buildroot}/%vimplugin_dir/doc/Makefile*
rm -rf %{buildroot}/%vimplugin_dir/doc/README*
@ -973,6 +985,7 @@ fi
%files -n vim-plugin-bufexplorer
%defattr(-,root,root,0755)
%license bufexplorer-%{bufexplorer_version}/LICENSE
%vimplugin_dir/doc/bufexplorer.txt
%vimplugin_dir/plugin/bufexplorer.vim

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d3faf0d9215da31c59b0259c942238b7ee1bdcb6383255a0c6ce3ba4d9eb3081
size 16861

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28b349dfc27303132fab141023d11fb6e130227fd9ba927e688ed573d7fdebc7
size 9805