Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doge#helpers#trim (vim version compatibility) #42

Merged
merged 23 commits into from
Sep 10, 2019
Merged

doge#helpers#trim (vim version compatibility) #42

merged 23 commits into from
Sep 10, 2019

Conversation

mg979
Copy link
Contributor
@mg979 mg979 commented Sep 7, 2019

Prelude

Thank you for helping out DoGe!

By contributing to DoGe you agree to the following statements (Replace [ ] with [x] with those you agree with):

Why this PR?

Compatibility with older vim version.
How older? I don't know, but it works with vim 8 debian stretch.

An helper function that can replace the trim() function introduced in
patch 7.4.1630.
It guarantees compatibility with at least vim 8 (debian stretch).
@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

What vim version are you running?

@mg979
Copy link
Contributor Author
mg979 commented Sep 8, 2019

I'm on debian stretch at the moment, so 8.0, but without the 1630 patch that has the trim() function.

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

@mg979 That's still no answer to my question. What Vim version are you using? I specifically need the patch number. Open Vim and check the startup screen.

@mg979
Copy link
Contributor Author
mg979 commented Sep 8, 2019
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 21 2019 04:10:35)                                                                                                                                     
Patch incluse: 1-197, 322, 377-378, 550, 649, 651, 703, 706-707                                                                                                                                        
Patch aggiuntive: 8.1.1401, 8.1.1382, 8.1.1368, 8.1.1367, 8.1.1366, 8.1.1365, 8.1.1046, 8.1.0613, 8.1.0547, 8.1.0546, 8.1.0544, 8.1.0540, 8.1.0539, 8.1.0538, 8.1.0506, 8.1.0208, 8.1.0206, 8.1.0205, 8
.1.0189, 8.1.0177, 8.1.0067, 8.1.0066                                                                                                                                                                  
Modificato da pkg-vim-maintainers@lists.alioth.debian.org                                                                                                                                              
Compilato da pkg-vim-maintainers@lists.alioth.debian.org                                                                                                                                               
Versione gigante con GUI GTK2.  Funzionalità incluse (+) o escluse (-):                                                                                                                                
+acl             +cmdline_compl   +digraphs        +folding         +langmap         +mouseshape      -mzscheme        +python3         +syntax          +toolbar         +writebackup                 
+arabic          +cmdline_hist    +dnd             -footer          +libcall         +mouse_dec       +netbeans_intg   +quickfix        +tag_binary      +user_commands   +X11                         
+autocmd         +cmdline_info    -ebcdic          +fork()          +linebreak       +mouse_gpm       +num64           +reltime         +tag_old_static  +vertsplit       -xfontset                    
+balloon_eval    +comments        +emacs_tags      +gettext         +lispindent      -mouse_jsbterm   +packages        +rightleft       -tag_any_white   +virtualedit     +xim                         
+browse          +conceal         +eval            -hangul_input    +listcmds        +mouse_netterm   +path_extra      +ruby            +tcl             +visual          +xpm                         
++builtin_terms  +cryptv          +ex_extra        +iconv           +localmap        +mouse_sgr       +perl            +scrollbind      +termguicolors   +visualextra     +xsmp_interact               
+byte_offset     +cscope          +extra_search    +insert_expand   +lua             -mouse_sysmouse  +persistent_undo +signs           +terminfo        +viminfo         +xterm_clipboard             
+channel         +cursorbind      +farsi           +job             +menu            +mouse_urxvt     +postscript      +smartindent     +termresponse    +vreplace        -xterm_save                  
+cindent         +cursorshape     +file_in_path    +jumplist        +mksession       +mouse_xterm     +printer         +startuptime     +textobjects     +wildignore                                   
+clientserver    +dialog_con_gui  +find_in_path    +keymap          +modify_fname    +multi_byte      +profile         +statusline      +timers          +wildmenu                                     
+clipboard       +diff            +float           +lambda          +mouse           +multi_lang      -python          -sun_workshop    +title           +windows                                      
   file vimrc di sistema: "$VIM/vimrc"                                                                                                                                                                 
       file vimrc utente: "$HOME/.vimrc"                                                                                                                                                               
    II file vimrc utente: "~/.vim/vimrc"                                                                                                                                                               
        file exrc utente: "$HOME/.exrc"                                                                                                                                                                
  file gvimrc di sistema: "$VIM/gvimrc"                                                                                                                                                                
      file gvimrc utente: "$HOME/.gvimrc"                                                                                                                                                              
   II file gvimrc utente: "~/.vim/gvimrc"                                                                                                                                                              
       defaults file: "$VIMRUNTIME/defaults.vim"                                                                                                                                                       
    file menu di sistema: "$VIMRUNTIME/menu.vim"                                                                                                                                                       
         $VIM di riserva: "/usr/share/vim"                                                                                                                                                             
Compilazione: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/i
nclude/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/incl
ude/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-xBMBkh/vim-8.0.01
97=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1                                                                                                   
Link: 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-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0
 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -la
ttr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.24/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.5/config-3.5m-x
86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

What specific Vim version is your Vim mentioning in your startup screen when you run vim -Nu NONE? Is it 8.0.707?

@mg979
Copy link
Contributor Author
mg979 commented Sep 8, 2019

Yes, 8.0.707

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

I will look into it later. Thanks for the effort of the PR. Also, I did merge master in your branch, since I noticed that I didn't include Vim 8.0 in the travis tests, which is highly critical for this PR.

@mg979
Copy link
Contributor Author
mg979 commented Sep 8, 2019

Ok thanks. There's another PR that is more involving (and more important I think). One test is failing though, could be because of the last commit.

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

I suggest you pull from the master branch and push that to your second pull request its branch.

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

Can you figureout which Vim version (including patch) is required now besides 8.0.1630? Otherwise I will test this.

@mg979
Copy link
Contributor Author
mg979 commented Sep 8, 2019

I don't know how I could test it, but at least saying >800 would be safe I think.

@kkoomen
Copy link
Owner
kkoomen commented Sep 8, 2019

I use the docker to built different images and then I test hem individually. I'll do that later today, thanks anyway.

plugin/doge.vim Show resolved Hide resolved
autoload/doge/helpers.vim Outdated Show resolved Hide resolved
plugin/doge.vim Outdated Show resolved Hide resolved
@kkoomen
Copy link
Owner
kkoomen commented Sep 9, 2019

Ugh, tests are failing. I'll fix this tomorrow. Probably we have to go higher than Vim 7.4.2119. I'll check it tomorrow.

@mg979
Copy link
Contributor Author
mg979 commented Sep 9, 2019

It could be because of the different pattern, a test is failing after that change, and it was ok before. I can try to revert that commit and see if it fixes it.

@mg979
Copy link
Contributor Author
mg979 commented Sep 9, 2019

Tests run fine now, it could be the caret, is it ok if I force-push some patterns and see what's the reason?

Add caret but keep \r and \n (because of failing tests with d5b7f76)
@mg979
Copy link
Contributor Author
mg979 commented Sep 9, 2019

I added the caret but restored \n\r, tests pass now and I'm leaving it like this.

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

Yes I get the unsupported message on 7.4.

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

Yes I get the unsupported message on 7.4.

Which patch version?

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

It's in 7.4 with no patches applied (welcome screen shows just 7.4).

autoload/doge/helpers.vim Outdated Show resolved Hide resolved
@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

@mg979 Do you have anything else? I think we can merge into master.

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

I was saying, maybe reword last commit and force-push 😃 (patch not path), but it's not the last one anymore. For the rest it seems to be working in vim 8.0.

Now just saying (hoping I'm not sounding critic), but hyper-optimizing things can be harmful, last commit for example, vim is sensitive about quote types for patterns and I couldn't be sure if printf() returns the right kind of quote, you could have used string concatenation but it's a waste of time mostly. I would just revert the last commit unless you're sure there's some real gain from it (I don't think there is).

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

I couldn't be sure if printf() returns the right kind of quote

It seems that it does. Tests are doing perfect.

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

Mhm, I tried to reword the commit using rebase as described here but that didn't do what I want (._.)

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

@mg979 Shall I merge?

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

For me it's ok, just one thing: how is it that tests didn't catch the trim() error before (from the missing dash in the patch version check)?

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

how is it that tests didn't catch the trim() error before?

"the trim() error" as in: the error that you get in version 7?

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

No, when you forgot the dash in the patch version (fixed in 1703e00), I had an error while executing doge in vim8, but tests were not failing (commits bf8296c and c9eb506 were broken and tests were ok).

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

Can you provide the full version number that you've tested?

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

Still the same as in

#42 (comment)

@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

The trim() function is supported since 8.0.1630+ and I did not have tests for below this version. You used a version where it wasn't supported yet and I'm not going to test a version that is below the minimum supported version.

The docker versions all supported the trim() function so it didn't error on that, but we fixed that now since we support 7.4.

@mg979
Copy link
Contributor Author
mg979 commented Sep 10, 2019

Understood, the important thing is that tests work as intended. For me it's ok!

@kkoomen kkoomen merged commit c30b97e into kkoomen:master Sep 10, 2019
@kkoomen
Copy link
Owner
kkoomen commented Sep 10, 2019

This feature has been merged and released in v1.12.0.

Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution.

@mg979 mg979 deleted the pre1630_compat branch September 10, 2019 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants