Ask for help about implementing double buffer in gui_win32.c
Recently, I am trying to implement a double buffer for gui_win32.c by: 1. rename s_hdc to s_hdc_real 2. creat a off-screen HDC named s_hdc, all the drawing from gui_win32.c should be redirected to it. 3. BitBlt from s_hdc to s_hdc_real after WndProc, the screen should be updated. It works in most of time, but when I press CTRL+D to scroll down half a screen I find only the bottom half of TextArea has been updated, the top half hasn't been updated yet, there are still old characters before CTRL+D on the top half. I search all the reference of s_hdc and s_textArea but can not find any clue. Can anybody figure out what's wrong here ? -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Vim :profile command was not covered by tests (#1383)
On Mon, 1/16/17, Bram Moolenaar wrote: Subject: Re: [vim/vim] Vim :profile command was not covered by tests (#1383) To: vim_dev@googlegroups.com Cc: "Dominique Pellé" Date: Monday, January 16, 2017, 11:38 PM Dominique Pellé wrote: > >> >> Vim :profile command was not covered by tests according to coveralls. See: > >> >> > >> >> https://coveralls.io/builds/9672985/source?filename=src%2Fex_cmds2.c#L1527 > >> >> > >> >> This pull requests adds test. > >> >> I does not test the ":profdel" command as I did not understand well what it does. > >> > > >> > Thanks, I'll include it. > >> > > >> > I wonder why it's so slow. I noticed the started Vim instances never > >> > explicitly exit, but adding :qall! didn't help. > >> > >> Indeed, I now see that running Test_profile_func > >> and Test_profile_file take about 2 sec each. That's > >> unexpectedly slow. > >> > >> Ah, I see! Adding the -es option to Vim makes > >> it almost instantaneous. I also see a that one of the > >> test had an error (l:count should be used instead of count). > >> I notice that by adding call assert_equal(0, v:shell_error) > >> which failed. > >> > >> I suspect that it's also why I had to disable the test on > >> Windows. I'll re-enable the test on Windows to see if > >> it passes on Appveyor all all those fixes. > >> > >> New pull request coming soon... > > > > Looking forward to that. I also noticed a failure on OS/X, where the > > "self" and "total" times happened to be the same. Only one time is > > displayed then. I just sent out a fix for that. > > Pull request https://github.com/vim/vim/pull/1384 > addresses the slow profile tests + other problems. > > But I still had to disable 2 profile tests on Windows > as system(…) fails in Appveyor. I hope that someone > with a Windows box can debug why Test_profile_file > and Test_profile_func fail on Windows. I managed to try it out. The problem is with the single quotes, on MS-Windows command arguments must be in double quotes. -- Facepalm statement #6: "Estland is a fantasy place, just like Middle Earth and Madagaskar" /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.lemente care disting poporul roman de celelalte popoare ale Europei il aflam la Constantin Radulescu-Motru 1868-1957 psiholog sociolog si filosof care isi ledica o parte a operei incercarii de definire a ceea ce el numea romanismul . 'reocuparile sale nu se limiteaza insa la acest aspect al cunoasterii el fiind de semenea autorul unei conceptii filosofice personalismul energetic un model ropriu de interpretare a lumii care il situeaza si in categoria personalitatilor iteresate de problematica general umana. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.0.0197
Patch 8.0.0197 Problem:On MS-Windows the system() test skips a few parts. Solution: Swap single and double quotes for the command. Files: src/testdir/test_system.vim *** ../vim-8.0.0196/src/testdir/test_system.vim 2017-01-14 19:38:32.449616516 +0100 --- src/testdir/test_system.vim 2017-01-16 22:50:52.735935225 +0100 *** *** 48,89 endfunction function! Test_system_exmode() ! if !has('unix') ! return endif - let cmd=" -es -u NONE -c 'source Xscript' +q; echo $?" - " Need to put this in a script, "catch" isn't found after an unknown - " function. - call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') - let a = system(v:progpath . cmd) - call assert_equal('0', a[0]) - call assert_equal(0, v:shell_error) - " Error before try does set error flag. call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') ! let a = system(v:progpath . cmd) ! call assert_notequal('0', a[0]) ! let cmd=" -es -u NONE -c 'source Xscript' +q" let a = system(v:progpath . cmd) call assert_notequal(0, v:shell_error) ! let cmd=" -es -u NONE -c 'call doesnotexist()' +q; echo $?" ! let a = system(v:progpath. cmd) ! call assert_notequal(0, a[0]) ! let cmd=" -es -u NONE -c 'call doesnotexist()' +q" let a = system(v:progpath. cmd) call assert_notequal(0, v:shell_error) ! let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q; echo $?" ! let a = system(v:progpath. cmd) ! call assert_notequal(0, a[0]) ! let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q" let a = system(v:progpath. cmd) call assert_notequal(0, v:shell_error) - - call delete('Xscript') endfunc --- 48,92 endfunction function! Test_system_exmode() ! if has('unix') " echo $? only works on Unix ! let cmd = ' -es -u NONE -c "source Xscript" +q; echo $?' ! " Need to put this in a script, "catch" isn't found after an unknown ! " function. ! call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') ! let a = system(v:progpath . cmd) ! call assert_equal('0', a[0]) ! call assert_equal(0, v:shell_error) endif " Error before try does set error flag. call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') ! if has('unix') " echo $? only works on Unix ! let a = system(v:progpath . cmd) ! call assert_notequal('0', a[0]) ! endif ! let cmd = ' -es -u NONE -c "source Xscript" +q' let a = system(v:progpath . cmd) call assert_notequal(0, v:shell_error) + call delete('Xscript') ! if has('unix') " echo $? only works on Unix ! let cmd = ' -es -u NONE -c "call doesnotexist()" +q; echo $?' ! let a = system(v:progpath. cmd) ! call assert_notequal(0, a[0]) ! endif ! let cmd = ' -es -u NONE -c "call doesnotexist()" +q' let a = system(v:progpath. cmd) call assert_notequal(0, v:shell_error) ! if has('unix') " echo $? only works on Unix ! let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q; echo $?' ! let a = system(v:progpath. cmd) ! call assert_notequal(0, a[0]) ! endif ! let cmd = ' -es -u NONE -c "call doesnotexist()|let a=1" +q' let a = system(v:progpath. cmd) call assert_notequal(0, v:shell_error) endfunc *** ../vim-8.0.0196/src/version.c 2017-01-16 22:37:39.520971858 +0100 --- src/version.c 2017-01-16 22:53:18.194680870 +0100 *** *** 766,767 --- 766,769 { /* Add new patch number below this line */ + /**/ + 197, /**/ -- Facepalm statement #8: "Drive faster, the petrol is running out" /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.0.0196
Patch 8.0.0196 (after 8.0.0194) Problem:The test for :profile is slow and does not work on MS-Windows. Solution: Use the "-es" argument. (Dominique Pelle) Swap single and double quotes for system() Files: src/testdir/test_profile.vim *** ../vim-8.0.0195/src/testdir/test_profile.vim2017-01-15 21:12:44.604730821 +0100 --- src/testdir/test_profile.vim2017-01-16 22:35:52.559857823 +0100 *** *** 4,19 endif func Test_profile_func() - if !has('unix') - return - endif let lines = [ \ "func! Foo1()", \ "endfunc", \ "func! Foo2()", ! \ " let count = 100", ! \ " while count > 0", ! \ "let count = count - 1", \ " endwhile", \ "endfunc", \ "func! Foo3()", --- 4,16 endif func Test_profile_func() let lines = [ \ "func! Foo1()", \ "endfunc", \ "func! Foo2()", ! \ " let l:count = 100", ! \ " while l:count > 0", ! \ "let l:count = l:count - 1", \ " endwhile", \ "endfunc", \ "func! Foo3()", *** *** 35,81 \ ] call writefile(lines, 'Xprofile_func.vim') ! let a = system(v:progpath ! \ . " -u NONE -i NONE --noplugin" ! \ . " -c 'profile start Xprofile_func.log'" ! \ . " -c 'profile func Foo*'" ! \ . " -c 'so Xprofile_func.vim'" ! \ . " -c 'qall!'") ! let lines = readfile('Xprofile_func.log') ! ! call assert_equal(28, len(lines)) ! call assert_equal('FUNCTION Foo1()', lines[0]) ! call assert_equal('Called 2 times', lines[1]) ! call assert_equal('FUNCTION Foo2()', lines[7]) ! call assert_equal('Called 1 time',lines[8]) " - Foo1() is called 3 times but should be reported as called twice " since one call is in between "profile pause" .. "profile continue". ! " - Foo2() should come before Foo1() since Foo1() does much more work.\ " - Foo3() is not reported because function is deleted. " - Unlike Foo3(), Foo2() should not be deleted since there is a check " for v:profiling. " - Bar() is not reported since it does not match "profile func Foo*". ! call assert_equal('FUNCTIONS SORTED ON TOTAL TIME',lines[18]) ! call assert_equal('count total (s) self (s) function', lines[19]) ! call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$',lines[20]) ! call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$',lines[21]) ! call assert_equal('', lines[22]) ! call assert_equal('FUNCTIONS SORTED ON SELF TIME', lines[23]) ! call assert_equal('count total (s) self (s) function', lines[24]) ! call assert_match('^\s*1\s\+\d\+\.\d\+\s\+Foo2()$',lines[25]) ! call assert_match('^\s*2\s\+\d\+\.\d\+\s\+Foo1()$',lines[26]) ! call assert_equal('', lines[27]) call delete('Xprofile_func.vim') call delete('Xprofile_func.log') endfunc func Test_profile_file() - if !has('unix') - return - endif let lines = [ \ 'func! Foo()', \ 'endfunc', --- 32,90 \ ] call writefile(lines, 'Xprofile_func.vim') ! call system(v:progpath ! \ . ' -es -u NONE -U NONE -i NONE --noplugin' ! \ . ' -c "profile start Xprofile_func.log"' ! \ . ' -c "profile func Foo*"' ! \ . ' -c "so Xprofile_func.vim"' ! \ . ' -c "qall!"') ! call assert_equal(0, v:shell_error) ! let lines = readfile('Xprofile_func.log') " - Foo1() is called 3 times but should be reported as called twice " since one call is in between "profile pause" .. "profile continue". ! " - Foo2() should come before Foo1() since Foo1() does much more work. " - Foo3() is not reported because function is deleted. " - Unlike Foo3(), Foo2() should not be deleted since there is a check " for v:profiling. " - Bar() is not reported since it does not match "profile func Foo*". ! call assert_equal(28, len(lines)) ! ! call assert_equal('FUNCTION Foo1()',lines[0]) ! call assert_equal('Called 2 times', lines[1]) ! call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[2]) ! call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[3]) ! call assert_equal('',lines[4]) ! call assert_equal('count total (s) self (s)', lines[5]) ! call assert_equal('',lines[6]) ! call assert_equal('FUNCTION Foo2()',lines[7]) ! call assert_equal('Called 1 time', lines[8]) ! call assert_match('^Total time:\s\+\d\+\.\d\+$', lines[9]) ! call assert_match('^ Self time:\s\+\d\+\.\d\+$', lines[10]) ! call assert_equal('',lines[11]) ! call assert_equal('count to
Re: [vim/vim] Vim :profile command was not covered by tests (#1383)
Dominique Pellé wrote: > >> >> Vim :profile command was not covered by tests according to coveralls. > >> >> See: > >> >> > >> >> https://coveralls.io/builds/9672985/source?filename=src%2Fex_cmds2.c#L1527 > >> >> > >> >> This pull requests adds test. > >> >> I does not test the ":profdel" command as I did not understand well > >> >> what it does. > >> > > >> > Thanks, I'll include it. > >> > > >> > I wonder why it's so slow. I noticed the started Vim instances never > >> > explicitly exit, but adding :qall! didn't help. > >> > >> Indeed, I now see that running Test_profile_func > >> and Test_profile_file take about 2 sec each. That's > >> unexpectedly slow. > >> > >> Ah, I see! Adding the -es option to Vim makes > >> it almost instantaneous. I also see a that one of the > >> test had an error (l:count should be used instead of count). > >> I notice that by adding call assert_equal(0, v:shell_error) > >> which failed. > >> > >> I suspect that it's also why I had to disable the test on > >> Windows. I'll re-enable the test on Windows to see if > >> it passes on Appveyor all all those fixes. > >> > >> New pull request coming soon... > > > > Looking forward to that. I also noticed a failure on OS/X, where the > > "self" and "total" times happened to be the same. Only one time is > > displayed then. I just sent out a fix for that. > > Pull request https://github.com/vim/vim/pull/1384 > addresses the slow profile tests + other problems. > > But I still had to disable 2 profile tests on Windows > as system(…) fails in Appveyor. I hope that someone > with a Windows box can debug why Test_profile_file > and Test_profile_func fail on Windows. I managed to try it out. The problem is with the single quotes, on MS-Windows command arguments must be in double quotes. -- Facepalm statement #6: "Estland is a fantasy place, just like Middle Earth and Madagaskar" /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Strange behavior with if/else and syntax contains=@Spell
2017-01-16 20:33 GMT+03:00 Taylor Venable : > Hello developers, I believe I may have found a bug related to if/else and > spell checking with syntax regions and @Spell. Here's my .vimrc for testing: > > > > set nocp > syntax on > > function! TweakSyntax1() > set spell > if 1 > syntax region test start=// > else > exit > syntax region test start=// contains=@Spell > endif > hi link test comment > endfunction > > function TweakSyntax2() > set spell > if 1 > syntax region test start=// > endif > hi link test comment > endfunction > > > > Here's my test file: > > > > notaword > > > > Here's a test script: > > > > $ vim -u dot-vimrc test.txt > :call TweakSyntax1() > :syn > --- Syntax items --- > test xxx start=// >links to Comment > Spell cluster=NONE > > > > $ vim -u dot-vimrc test.txt > :call TweakSyntax2() > :syn > --- Syntax items --- > test xxx start=// >links to Comment > > > > If you open this file and call TweakSyntax1(): *neither* word is marked as > being spelled wrong. If you open this file and call TweakSyntax2(): *both* > words are marked as spelled wrong. The only difference is the existence of > the else clause, which isn't executed. I can't see a reason for it, what am > I missing? > > My version is attached. > > Thanks for looking! Unlike most modern languages VimL does not have syntax parsing step, it directly executes strings. So in the first case in order to skip to `endif` it must first execute `else` part. Execution of parts which are not intended to be executed like here has a difference: `skip` argument is set to true (part of exarg_T structure for commands (`ex_*`), explicit argument for expressions (`eval*`)). Most of time you would not notice this implementation detail, but programs contain bugs and it leaks out. Specifically in your case when parsing the `else` clause `Spell` syntax cluster is implicitly defined. Implicitly defining syntax cluster if it appears in arguments like `contains=…` is actually intentional, but obviously not when in `else` clause. According to the documentation (:h spell-syntax) if there is Spell cluster spell checking should be limited only to groups in this cluster. Internally the offending function is `get_syn_options()`: while its callers have access to `exarg_T` argument which has `skip` member, `get_syn_options()` does not receive it and cannot determine whether it is skipping. Yet it calls `get_id_list()` which also does not have `skip` argument which in turn calls `syn_check_cluster()` which runs `syn_add_cluster()` if cluster was not found, so `Spell` cluster gets defined while it should not. Suggestion would be passing skip argument to `get_syn_options()` and then to `get_id_list()` which then should not run `syn_add_cluster()` (and better also avoid any memory allocations because result is supposed to be dropped in any case). > > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0190
James McCoy wrote: > On Jan 16, 2017 05:03, "Kazunobu Kuriyama" > wrote: > > 2017-01-16 0:53 GMT+09:00 Bram Moolenaar : > > > > > Patch 8.0.0190 > > Summary:finding duplicate tags uses a slow linear search > > Problem:Detecting duplicate tags uses a slow linear search. > > Solution: Use a much faster hash table solution. (James McCoy, closes > > #1046) > > But don't add hi_keylen, it makes hash tables 50% bigger. > > Files: src/tag.c > > > > > With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work > for me. > > For example, go to vim/src/ and open vim there. Do ":make tags" and ":edit > gui.c". Place the cursor at gui_attempt_start() at line 110 and press > CTRL-]. > > Then I got either of them, depending on circumstances: > > (1) no response > (2) an error message: E429: File "tags^A^Agui_attempt_start^ > Igui.c^I/^gui_attempt_start(void)$/ead_ref" does not exist (N.B. The > substring after $/ often varies). > (3) segfault > > Those clearly indicate that memory corruption takes place somewhere > (Therefore, I believe the procedure above is not necessarily useful to > reproduce the issue for everyone). > > > This should be fixed by PR #1387. Thanks for pinpointing the problem. However, having a NUL at the start means duplicate tags are not found. A better solution is to make sure the first byte is never NUL. But I also want to write a test that detects the problem. Looks like it requires a static item in the current file. -- Facepalm statement #4: "3000 year old graves? That's not possible, it's only 2014!" /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.0.0195
Patch 8.0.0195 (after 8.0.0190) Summary:fail to jump to static tag in current file Problem:Jumping to a tag that is a static item in the current file fails. (Kazunobu Kuriyama) Solution: Make sure the first byte of the tag key is not NUL. (Suggested by James McCoy, closes #1387) Files: src/tag.c, src/testdir/test_tagjump.vim *** ../vim-8.0.0194/src/tag.c 2017-01-15 16:52:47.226488764 +0100 --- src/tag.c 2017-01-16 20:47:10.965107866 +0100 *** *** 44,53 #define MT_GL_CUR 1 /* global match in current file */ #define MT_GL_OTH 2 /* global match in other file */ #define MT_ST_OTH 3 /* static match in other file */ - #define MT_IC_ST_CUR 4 /* icase static match in current file */ - #define MT_IC_GL_CUR 5 /* icase global match in current file */ - #define MT_IC_GL_OTH 6 /* icase global match in other file */ - #define MT_IC_ST_OTH 7 /* icase static match in other file */ #define MT_IC_OFF 4 /* add for icase match */ #define MT_RE_OFF 8 /* add for regexp match */ #define MT_MASK 7 /* mask for printing priority */ --- 44,49 *** *** 2317,2323 if (tagp.command + 2 < temp_end) { len = (int)(temp_end - tagp.command - 2); ! mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1); if (mfp != NULL) vim_strncpy(mfp, tagp.command + 2, len); } --- 2313,2319 if (tagp.command + 2 < temp_end) { len = (int)(temp_end - tagp.command - 2); ! mfp = (char_u *)alloc(len + 2); if (mfp != NULL) vim_strncpy(mfp, tagp.command + 2, len); } *** *** 2351,2356 --- 2347,2353 * Emacs tag: <0x01><0x01> * other tag: <0x01><0x01> * without Emacs tags: <0x01> +* Here is the "mtt" value plus 1 to avoid NUL. */ len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3; #ifdef FEAT_EMACS_TAGS *** *** 2366,2372 if (mfp != NULL) { p = mfp; ! p[0] = mtt; STRCPY(p + 1, tag_fname); #ifdef BACKSLASH_IN_FILENAME /* Ignore differences in slashes, avoid adding --- 2363,2369 if (mfp != NULL) { p = mfp; ! p[0] = mtt + 1; STRCPY(p + 1, tag_fname); #ifdef BACKSLASH_IN_FILENAME /* Ignore differences in slashes, avoid adding *** *** 2548,2557 vim_free(mfp); else { ! /* now change the TAG_SEP back to NUL */ ! for (p = mfp; *p != NUL; ++p) ! if (*p == TAG_SEP) ! *p = NUL; matches[match_count++] = (char_u *)mfp; } todo--; --- 2545,2560 vim_free(mfp); else { ! if (!name_only) ! { ! /* Change mtt back to zero-based. */ ! *mfp = *mfp - 1; ! ! /* change the TAG_SEP back to NUL */ ! for (p = mfp + 1; *p != NUL; ++p) ! if (*p == TAG_SEP) ! *p = NUL; ! } matches[match_count++] = (char_u *)mfp; } todo--; *** ../vim-8.0.0194/src/testdir/test_tagjump.vim2016-09-07 20:37:01.0 +0200 --- src/testdir/test_tagjump.vim2017-01-16 20:42:11.919082134 +0100 *** *** 23,28 --- 23,46 quit endfunc + func Test_static_tagjump() + set tags=Xtags + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "one\tXfile1\t/^one/;\"\tf\tfile:\tsignature:(void)", + \ "word\tXfile2\tcmd2"], + \ 'Xtags') + new Xfile1 + call setline(1, ['empty', 'one()', 'empty']) + write + tag one + call assert_equal(2, line('.')) + + set tags& + call delete('Xtags') + call delete('Xfile1') + bwipe! + endfunc + " Tests for [ CTRL-I and CTRL-W CTRL-I commands function Test_keyword_jump() call writefile(["#include Xinclude", "", *** ../vim-8.0.0194/src/version.c 2017-01-15 21:12:44.604730821 +0100 --- src/version.c 2017-01-16 20:51:15.23
Re: Patch 8.0.0190
Kazunobu Kuriyama wrote: > 2017-01-16 0:53 GMT+09:00 Bram Moolenaar : > > > > > Patch 8.0.0190 > > Summary:finding duplicate tags uses a slow linear search > > Problem:Detecting duplicate tags uses a slow linear search. > > Solution: Use a much faster hash table solution. (James McCoy, closes > > #1046) > > But don't add hi_keylen, it makes hash tables 50% bigger. > > Files: src/tag.c > > > > > With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work > for me. > > For example, go to vim/src/ and open vim there. Do ":make tags" and ":edit > gui.c". Place the cursor at gui_attempt_start() at line 110 and press > CTRL-]. > > Then I got either of them, depending on circumstances: > > (1) no response > (2) an error message: E429: File > "tags^A^Agui_attempt_start^Igui.c^I/^gui_attempt_start(void)$/ead_ref" does > not exist (N.B. The substring after $/ often varies). > (3) segfault > > Those clearly indicate that memory corruption takes place somewhere > (Therefore, I believe the procedure above is not necessarily useful to > reproduce the issue for everyone). Not sure why this wasn't caught by tests. I changed using NUL as separator to using 0x01, so that it works as a hash table key. > FWIW, I applied the patch of #1046 to 8.0.0176 to see if there was a > difference, and found that it worked fine. > > It appears to me that a big difference between 8.0.0190 and #1046 is the > usage of the local variable cmplen defined at tag.c:1320. > > #1046 defines a new variable of the same name at line 2215 of the patched > tag.c, although it shadows cmplen in the outer scope. > > On the other hand, 8.0.0190 does away with the one introduced by #1046. > > Does this make sense? I'll look into it as soon as I find time. It would help to have a test function that fails. Several tags just work, I wonder what's special about your example with gui_attempt_start. -- Facepalm reply #3: "I had a great time in Manhattan" "I thought you were going to New York?" /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Vim :profile command was not covered by tests (#1383)
Bram Moolenaar wrote: > Dominique Pellé wrote: > >> >> Vim :profile command was not covered by tests according to coveralls. See: >> >> >> >> https://coveralls.io/builds/9672985/source?filename=src%2Fex_cmds2.c#L1527 >> >> >> >> This pull requests adds test. >> >> I does not test the ":profdel" command as I did not understand well what >> >> it does. >> > >> > Thanks, I'll include it. >> > >> > I wonder why it's so slow. I noticed the started Vim instances never >> > explicitly exit, but adding :qall! didn't help. >> >> Indeed, I now see that running Test_profile_func >> and Test_profile_file take about 2 sec each. That's >> unexpectedly slow. >> >> Ah, I see! Adding the -es option to Vim makes >> it almost instantaneous. I also see a that one of the >> test had an error (l:count should be used instead of count). >> I notice that by adding call assert_equal(0, v:shell_error) >> which failed. >> >> I suspect that it's also why I had to disable the test on >> Windows. I'll re-enable the test on Windows to see if >> it passes on Appveyor all all those fixes. >> >> New pull request coming soon... > > Looking forward to that. I also noticed a failure on OS/X, where the > "self" and "total" times happened to be the same. Only one time is > displayed then. I just sent out a fix for that. Pull request https://github.com/vim/vim/pull/1384 addresses the slow profile tests + other problems. But I still had to disable 2 profile tests on Windows as system(…) fails in Appveyor. I hope that someone with a Windows box can debug why Test_profile_file and Test_profile_func fail on Windows. Regards Dominique -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Strange behavior with if/else and syntax contains=@Spell
Hello developers, I believe I may have found a bug related to if/else and spell checking with syntax regions and @Spell. Here's my .vimrc for testing: set nocp syntax on function! TweakSyntax1() set spell if 1 syntax region test start=// else exit syntax region test start=// contains=@Spell endif hi link test comment endfunction function TweakSyntax2() set spell if 1 syntax region test start=// endif hi link test comment endfunction Here's my test file: notaword Here's a test script: $ vim -u dot-vimrc test.txt :call TweakSyntax1() :syn --- Syntax items --- test xxx start=// links to Comment Spell cluster=NONE $ vim -u dot-vimrc test.txt :call TweakSyntax2() :syn --- Syntax items --- test xxx start=// links to Comment If you open this file and call TweakSyntax1(): *neither* word is marked as being spelled wrong. If you open this file and call TweakSyntax2(): *both* words are marked as spelled wrong. The only difference is the existence of the else clause, which isn't executed. I can't see a reason for it, what am I missing? My version is attached. Thanks for looking! -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 16 2017 09:41:39) Included patches: 1-194 Compiled by Arch Linux Huge version with GTK2 GUI. Features included (+) or not (-): +acl +file_in_path+mouse_sgr +tag_old_static +arabic +find_in_path-mouse_sysmouse -tag_any_white +autocmd +float +mouse_urxvt +tcl/dyn +balloon_eval+folding +mouse_xterm +termguicolors +browse -footer +multi_byte +terminfo ++builtin_terms +fork() +multi_lang +termresponse +byte_offset +gettext -mzscheme+textobjects +channel -hangul_input+netbeans_intg +timers +cindent +iconv +num64 +title +clientserver+insert_expand +packages+toolbar +clipboard +job +path_extra +user_commands +cmdline_compl +jumplist+perl/dyn+vertsplit +cmdline_hist+keymap +persistent_undo +virtualedit +cmdline_info+lambda +postscript +visual +comments+langmap +printer +visualextra +conceal +libcall +profile +viminfo +cryptv +linebreak +python/dyn +vreplace +cscope +lispindent +python3/dyn +wildignore +cursorbind +listcmds+quickfix+wildmenu +cursorshape +localmap+reltime +windows +dialog_con_gui +lua/dyn +rightleft +writebackup +diff+menu+ruby/dyn+X11 +digraphs+mksession +scrollbind -xfontset +dnd +modify_fname+signs +xim -ebcdic +mouse +smartindent +xpm +emacs_tags +mouseshape +startuptime +xsmp_interact +eval+mouse_dec +statusline +xterm_clipboard +ex_extra+mouse_gpm -sun_workshop-xterm_save +extra_search-mouse_jsbterm +syntax +farsi +mouse_netterm +tag_binary system vimrc file: "/etc/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "/etc/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-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_S
Re: Patch 8.0.0190
2017-01-17 1:49 GMT+09:00 James McCoy : > On Jan 16, 2017 05:03, "Kazunobu Kuriyama" > wrote: > > 2017-01-16 0:53 GMT+09:00 Bram Moolenaar : > >> >> Patch 8.0.0190 >> Summary:finding duplicate tags uses a slow linear search >> Problem:Detecting duplicate tags uses a slow linear search. >> Solution: Use a much faster hash table solution. (James McCoy, closes >> #1046) >> But don't add hi_keylen, it makes hash tables 50% bigger. >> Files: src/tag.c >> >> > With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work > for me. > > For example, go to vim/src/ and open vim there. Do ":make tags" and > ":edit gui.c". Place the cursor at gui_attempt_start() at line 110 and > press CTRL-]. > > Then I got either of them, depending on circumstances: > > (1) no response > (2) an error message: E429: File "tags^A^Agui_attempt_start^Igu > i.c^I/^gui_attempt_start(void)$/ead_ref" does not exist (N.B. The > substring after $/ often varies). > (3) segfault > > Those clearly indicate that memory corruption takes place somewhere > (Therefore, I believe the procedure above is not necessarily useful to > reproduce the issue for everyone). > > > This should be fixed by PR #1387. > Confirmed. Thanks! > > Cheers, > James > Kazunobu > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0190
On Jan 16, 2017 05:03, "Kazunobu Kuriyama" wrote: 2017-01-16 0:53 GMT+09:00 Bram Moolenaar : > > Patch 8.0.0190 > Summary:finding duplicate tags uses a slow linear search > Problem:Detecting duplicate tags uses a slow linear search. > Solution: Use a much faster hash table solution. (James McCoy, closes > #1046) > But don't add hi_keylen, it makes hash tables 50% bigger. > Files: src/tag.c > > With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work for me. For example, go to vim/src/ and open vim there. Do ":make tags" and ":edit gui.c". Place the cursor at gui_attempt_start() at line 110 and press CTRL-]. Then I got either of them, depending on circumstances: (1) no response (2) an error message: E429: File "tags^A^Agui_attempt_start^ Igui.c^I/^gui_attempt_start(void)$/ead_ref" does not exist (N.B. The substring after $/ often varies). (3) segfault Those clearly indicate that memory corruption takes place somewhere (Therefore, I believe the procedure above is not necessarily useful to reproduce the issue for everyone). This should be fixed by PR #1387. Cheers, James -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0190
2017-01-16 0:53 GMT+09:00 Bram Moolenaar : > > Patch 8.0.0190 > Summary:finding duplicate tags uses a slow linear search > Problem:Detecting duplicate tags uses a slow linear search. > Solution: Use a much faster hash table solution. (James McCoy, closes > #1046) > But don't add hi_keylen, it makes hash tables 50% bigger. > Files: src/tag.c > > With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work for me. For example, go to vim/src/ and open vim there. Do ":make tags" and ":edit gui.c". Place the cursor at gui_attempt_start() at line 110 and press CTRL-]. Then I got either of them, depending on circumstances: (1) no response (2) an error message: E429: File "tags^A^Agui_attempt_start^Igui.c^I/^gui_attempt_start(void)$/ead_ref" does not exist (N.B. The substring after $/ often varies). (3) segfault Those clearly indicate that memory corruption takes place somewhere (Therefore, I believe the procedure above is not necessarily useful to reproduce the issue for everyone). FWIW, I applied the patch of #1046 to 8.0.0176 to see if there was a difference, and found that it worked fine. It appears to me that a big difference between 8.0.0190 and #1046 is the usage of the local variable cmplen defined at tag.c:1320. #1046 defines a new variable of the same name at line 2215 of the patched tag.c, although it shadows cmplen in the outer scope. On the other hand, 8.0.0190 does away with the one introduced by #1046. Does this make sense? Best regards, Kazunobu Kuriyama -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.