knsh14 / vim-github-link

generate github link from selected lines in vim
MIT License
62 stars 15 forks source link

letter 's' are removed from result link #7

Closed kghost closed 5 years ago

kghost commented 5 years ago

For example, when I pick a link from some code, I expect this one:

https://github.com/antirez/redis/blob/unstable/src/db.c#L1483-L1487

but actually I got:

http://github.com/antirez/redi/blob/untable/rc/db.c#L1483-L1487

All letter 's' are removed.

I guess there is something wrong in this line

https://github.com/knsh14/vim-github-link/blob/master/plugin/github-link.vim#L44

This is the VIM I use:

:ve
VIM - Vi IMproved 8.1 (2018 May 18, compiled May 06 2019 03:41:10)
Included patches: 1-875, 878, 884, 948
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +clientserver      +diff              +folding           +libcall           +mouse_gpm         +packages          +ruby              +termguicolors     +virtualedit       +xpm
+arabic            +clipboard         +digraphs          -footer            +linebreak         -mouse_jsbterm     +path_extra        +scrollbind        +terminal          +visual            +xsmp_interact
+autocmd           +cmdline_compl     +dnd               +fork()            +lispindent        +mouse_netterm     +perl              +signs             +terminfo          +visualextra       +xterm_clipboard
+autochdir         +cmdline_hist      -ebcdic            +gettext           +listcmds          +mouse_sgr         +persistent_undo   +smartindent       +termresponse      +viminfo           -xterm_save
-autoservername    +cmdline_info      +emacs_tags        -hangul_input      +localmap          -mouse_sysmouse    +postscript        +startuptime       +textobjects       +vreplace
+balloon_eval      +comments          +eval              +iconv             +lua               +mouse_urxvt       +printer           +statusline        +textprop          +wildignore
+balloon_eval_term +conceal           +ex_extra          +insert_expand     +menu              +mouse_xterm       +profile           -sun_workshop      +timers            +wildmenu
+browse            +cryptv            +extra_search      +job               +mksession         +multi_byte        -python            +syntax            +title             +windows
++builtin_terms    +cscope            +farsi             +jumplist          +modify_fname      +multi_lang        +python3           +tag_binary        +toolbar           +writebackup
+byte_offset       +cursorbind        +file_in_path      +keymap            +mouse             -mzscheme          +quickfix          +tag_old_static    +user_commands     +X11
+channel           +cursorshape       +find_in_path      +lambda            +mouseshape        +netbeans_intg     +reltime           -tag_any_white     +vartabs           -xfontset
+cindent           +dialog_con_gui    +float             +langmap           +mouse_dec         +num64             +rightleft         +tcl               +vertsplit         +xim
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1
.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/in
clude/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/i
nclude/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-iWd92G/vim-8.1.0875=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D
_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-
gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-prot
ector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm -L/us
r/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm
Press ENTER or type command to continue
knsh14 commented 5 years ago

thank you for reporting.

this is investigation log. Current Code: https://wandbox.org/permlink/ep76ARFZ5d344JF0 Fixed Code: https://wandbox.org/permlink/BvPuOat9i6d8wn5G

I want remove whitespace with \s but removed only s letter. sorry, its my fault. I will fix it soon.

knsh14 commented 5 years ago

@kghost really thank you for reporting issue. i fixed in https://github.com/knsh14/vim-github-link/pull/9 , please check it.

kghost commented 5 years ago

Works like a charm, thank you.