Re: Tabs are not correctly expanded with 2html

2018-11-30 Fir de Conversatie Ben Fritz
On Wednesday, November 28, 2018 at 5:11:35 AM UTC-6, Axel Bender wrote:
> Using GVim 8.1. (Windows 10 64-bit), after applying a syntax scheme, 
> 2html.vim fails to correcly expand the tabs contained in the base document.
> 
> Sample files:
> 
> - sample.lang# The source file
> - lang.vim   # The syntax file
> - [sample.htm]   # Resulting output file

Thanks for reporting, and for the clear reproducible example. I see slightly 
different behavior, but still wrong, on my end, probably due to differing 
settings.

I guess I know what I'm doing this weekend. :-(

I entered an issue in my tracker: 
https://bitbucket.org/fritzophrenic/vim-tohtml/issues/19/expand-tabs-broken-for-long-tabstops

If this is a show-stopper for you you can try downloading an older copy of the 
scripts. I assume those worked for you.

-- 
-- 
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: RFC: VimL functions for managing signs

2018-11-30 Fir de Conversatie Yegappan Lakshmanan
Hi Christian,

On Mon, Nov 19, 2018 at 10:40 PM Christian Brabandt  wrote:
>
> On Mo, 19 Nov 2018, Yegappan Lakshmanan wrote:
>
> > Hi all,
> >
> > In the recent thread about adding features helpful to plugin developers,
> > there was a request to add VimL functions for natively managing signs.
> >
> > I am attaching the help text for the new functions for managing signs.
> > These are modeled after the existing ":sign ..." commands.
> > Any comments/suggestions about these new functions?
>
> Thanks for that. I think one thing that is missing is a function that
> returns the next available (unique) ID. This is currently one of the
> biggest annoyances, that we have to pick IDs somewhat arbitrarily and
> cannot be sure another plugin uses the same.
>

I just now noticed that there is patch from you in the todo list for adding
sign functions:

Patch to add functions for signs. (Christian Brabandt, 2013 Jan 27)

Is there any functionality from your patch that is missing here?
BTW, the latest updated code is available at:

https://github.com/yegappan/vim/tree/signs

Thanks,
Yegappan

-- 
-- 
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] Adjust size of inverted popupmenu when preview window is above. (#3414)

2018-11-30 Fir de Conversatie h_east
Hi Bram,

I found a reproducing procedure where the height of the popup window is 
extremely narrow in previous version of 8.1.0355.


How to reproduce (on 8.1.0354):
- Open a terminal emulator whose size is 80x24. < Size is important!!
- Prepare the following file named pp.vim.
set scrolloff=0
set previewheight=9
silent! pedit
echo setline(1, map(repeat(["ab"], 10), 'v:val. v:key'))
call feedkeys("G\\")

- Start Vim
  $ vim --clean -S pp.vim

- Type `o` to enter insert mode and display completion popup.
  o

Expected behavior:
- Completion popup height is 9.  And does not overlap the preview window.


Actual behavior:
  8.1.0354 or before:
  - Completion popup height is 2.  It's wrong!!

  8.1.0355 or after:
  - Completion popup height is 10.  And overlap the preview window.  It's 
wrong!!


Investigation result:
RPigott's patch is simply nice.
However, with the modification Bram added, the popup and the preview window 
overlapped.

I respected RPigott's patch.
And add a test.  (I confirmed that the test will be OK only after applying my 
patch)

Patch attached to vim_dev e-mail.
Check it out pleaseď‘Ť

--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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.
diff --git a/src/popupmnu.c b/src/popupmnu.c
index c481d4be7..ca84cdf2c 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -197,19 +197,10 @@ pum_display(
 
 #if defined(FEAT_QUICKFIX)
 	// If there is a preview window at the above avoid drawing over it.
-	// Do keep at least 10 entries.
-	if (pvwin != NULL && pum_row < above_row && pum_height > 10)
+	if (pvwin != NULL && pum_row < above_row && pum_height > above_row)
 	{
-	if (pum_win_row - above_row < 10)
-	{
-		pum_row = pum_win_row - 10;
-		pum_height = 10;
-	}
-	else
-	{
-		pum_row = above_row;
-		pum_height = pum_win_row - above_row;
-	}
+	pum_row = above_row;
+	pum_height = pum_win_row - above_row;
 	}
 #endif
 
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 9c25687ad..287d59d90 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -701,6 +701,28 @@ func Test_popup_and_preview_autocommand()
   bw!
 endfunc
 
+func Test_popup_and_previewwindow_dump()
+  if !CanRunVimInTerminal()
+return
+  endif
+  call writefile([
+\ 'set previewheight=9',
+\ 'silent! pedit',
+\ 'call setline(1, map(repeat(["ab"], 10), "v:val. v:key"))',
+\ 'exec "norm! G\\"',
+	\ ], 'Xscript')
+  let buf = RunVimInTerminal('-S Xscript', {})
+
+  " Test that popup and previewwindow do not overlap.
+  call term_sendkeys(buf, "o\\")
+  sleep 100m
+  call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {})
+
+  call term_sendkeys(buf, "\u")
+  call StopVimInTerminal(buf)
+  call delete('Xscript')
+endfunc
+
 func Test_balloon_split()
   if !exists('*balloon_split')
 return


Re: [vim/vim] Adjust size of inverted popupmenu when preview window is above. (#3414)

2018-11-30 Fir de Conversatie h_east
Ah, The attached patch does not include the difference of the newly added file..

New patch attached.
--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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.
diff --git a/src/popupmnu.c b/src/popupmnu.c
index c481d4be7..ca84cdf2c 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -197,19 +197,10 @@ pum_display(
 
 #if defined(FEAT_QUICKFIX)
 	// If there is a preview window at the above avoid drawing over it.
-	// Do keep at least 10 entries.
-	if (pvwin != NULL && pum_row < above_row && pum_height > 10)
+	if (pvwin != NULL && pum_row < above_row && pum_height > above_row)
 	{
-	if (pum_win_row - above_row < 10)
-	{
-		pum_row = pum_win_row - 10;
-		pum_height = 10;
-	}
-	else
-	{
-		pum_row = above_row;
-		pum_height = pum_win_row - above_row;
-	}
+	pum_row = above_row;
+	pum_height = pum_win_row - above_row;
 	}
 #endif
 
diff --git a/src/testdir/dumps/Test_popup_and_previewwindow_01.dump b/src/testdir/dumps/Test_popup_and_previewwindow_01.dump
new file mode 100644
index 0..71ff3990f
--- /dev/null
+++ b/src/testdir/dumps/Test_popup_and_previewwindow_01.dump
@@ -0,0 +1,20 @@

Patch 8.1.0553

2018-11-30 Fir de Conversatie Bram Moolenaar


Patch 8.1.0553
Problem:It is not easy to edit a script that was sourced.
Solution:   Add a count to ":scriptnames", so that ":script 40" edits the
script with script ID 40.
Files:  src/ex_cmds.h, src/ex_cmds2.c, src/testdir/test_scriptnames.vim,
src/Make_all.mak, src/testdir/Make_all.mak, runtime/doc/repeat.txt


*** ../vim-8.1.0552/src/ex_cmds.h   2018-10-19 22:35:04.885189994 +0200
--- src/ex_cmds.h   2018-11-30 22:16:01.339155261 +0100
***
*** 62,76 
  #define FILE1 (FILES | NOSPC) /* 1 file allowed, defaults to current file */
  
  /* values for cmd_addr_type */
! #define ADDR_LINES0
! #define ADDR_WINDOWS  1
! #define ADDR_ARGUMENTS2
! #define ADDR_LOADED_BUFFERS   3
! #define ADDR_BUFFERS  4
! #define ADDR_TABS 5
! #define ADDR_TABS_RELATIVE6   /* Tab page that only relative */
! #define ADDR_QUICKFIX 7
! #define ADDR_OTHER99
  
  #ifndef DO_DECLARE_EXCMD
  typedef struct exarg exarg_T;
--- 62,76 
  #define FILE1 (FILES | NOSPC) /* 1 file allowed, defaults to current file */
  
  /* values for cmd_addr_type */
! #define ADDR_LINES0   // buffer line numbers
! #define ADDR_WINDOWS  1   // window number
! #define ADDR_ARGUMENTS2   // argument number
! #define ADDR_LOADED_BUFFERS   3   // buffer number of loaded buffer
! #define ADDR_BUFFERS  4   // buffer number
! #define ADDR_TABS 5   // tab page number
! #define ADDR_TABS_RELATIVE6   // Tab page that only relative
! #define ADDR_QUICKFIX 7   // quickfix list entry number
! #define ADDR_OTHER99  // something else
  
  #ifndef DO_DECLARE_EXCMD
  typedef struct exarg exarg_T;
***
*** 1260,1267 
EDITCMD|TRLBAR,
ADDR_LINES),
  EX(CMD_scriptnames,   "scriptnames",  ex_scriptnames,
!   TRLBAR|CMDWIN,
!   ADDR_LINES),
  EX(CMD_scriptencoding,"scriptencoding", ex_scriptencoding,
WORD1|TRLBAR|CMDWIN,
ADDR_LINES),
--- 1260,1267 
EDITCMD|TRLBAR,
ADDR_LINES),
  EX(CMD_scriptnames,   "scriptnames",  ex_scriptnames,
!   BANG|RANGE|NOTADR|COUNT|TRLBAR|CMDWIN,
!   ADDR_OTHER),
  EX(CMD_scriptencoding,"scriptencoding", ex_scriptencoding,
WORD1|TRLBAR|CMDWIN,
ADDR_LINES),
*** ../vim-8.1.0552/src/ex_cmds2.c  2018-11-10 17:33:23.087518814 +0100
--- src/ex_cmds2.c  2018-11-30 22:21:44.041191333 +0100
***
*** 4690,4699 
   * ":scriptnames"
   */
  void
! ex_scriptnames(exarg_T *eap UNUSED)
  {
  int i;
  
  for (i = 1; i <= script_items.ga_len && !got_int; ++i)
if (SCRIPT_ITEM(i).sn_name != NULL)
{
--- 4690,4712 
   * ":scriptnames"
   */
  void
! ex_scriptnames(exarg_T *eap)
  {
  int i;
  
+ if (eap->addr_count > 0)
+ {
+   // :script {scriptId}: edit the script
+   if (eap->line2 < 1 || eap->line2 > script_items.ga_len)
+   EMSG(_(e_invarg));
+   else
+   {
+   eap->arg = SCRIPT_ITEM(eap->line2).sn_name;
+   do_exedit(eap, NULL);
+   }
+   return;
+ }
+ 
  for (i = 1; i <= script_items.ga_len && !got_int; ++i)
if (SCRIPT_ITEM(i).sn_name != NULL)
{
*** ../vim-8.1.0552/src/testdir/test_scriptnames.vim2018-11-30 
22:36:54.859349269 +0100
--- src/testdir/test_scriptnames.vim2018-11-30 22:39:33.306420278 +0100
***
*** 0 
--- 1,26 
+ " Test for :scriptnames
+ 
+ func Test_scriptnames()
+   call writefile(['let did_load_script = 123'], 'Xscripting')
+   source Xscripting
+   call assert_equal(123, g:did_load_script)
+ 
+   let scripts = split(execute('scriptnames'), "\n")
+   let last = scripts[-1]
+   call assert_match('\', last)
+   let lastnr = substitute(last, '\D*\(\d\+\):.*', '\1', '')
+   exe 'script ' . lastnr
+   call assert_equal('Xscripting', expand('%:t'))
+ 
+   call assert_fails('script ' . (lastnr + 1), 'E474:')
+   call assert_fails('script 0', 'E939:')
+ 
+   new
+   call setline(1, 'nothing')
+   call assert_fails('script ' . lastnr, 'E37:')
+   exe 'script! ' . lastnr
+   call assert_equal('Xscripting', expand('%:t'))
+ 
+   bwipe
+   call delete('Xscripting')
+ endfunc
*** ../vim-8.1.0552/src/Make_all.mak2018-11-10 18:54:40.656592081 +0100
--- src/Make_all.mak2018-11-30 22:30:44.813583693 +0100
***
*** 153,158 
--- 153,159 
test_reltime \
test_retab \
test_ruby \
+   test_scriptnames \
test_scroll_opt \
test_scrollbind \
test_search \
*** ../vim-8.1.0552/src/testdir/Make_all.mak2018-06-30 21:50:16.852674935 
+0200
--- src/testdir/Make_all.mak2018-11-30 22:31:08.813435000 +0100

Re: Tabs are not correctly expanded with 2html

2018-11-30 Fir de Conversatie Ben Fritz
On Wednesday, November 28, 2018 at 5:11:35 AM UTC-6, Axel Bender wrote:
> Using GVim 8.1. (Windows 10 64-bit), after applying a syntax scheme, 
> 2html.vim fails to correcly expand the tabs contained in the base document.
> 
> Sample files:
> 
> - sample.lang# The source file
> - lang.vim   # The syntax file
> - [sample.htm]   # Resulting output file

Please try this fix:

https://bitbucket.org/fritzophrenic/vim-tohtml/commits/07ce1eaa0a3f

I'll submit to Bram with a couple other bugfixes on my list later this weekend.

-- 
-- 
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 segfaults on macOS 10.13/14 on hitting `n` right after startup (#3647)

2018-11-30 Fir de Conversatie Christian Brabandt
It looks like there is a strlen call with a null Pointer in do_search(). 
However the mentioned bad commit does not change anything in do_search function 
not even touch search.c 

> Am 30.11.2018 um 20:49 schrieb chdiza (Vim Github Repository) 
> :
> 
> libsystem_platform.dylib`_platform_strlen

-- 
-- 
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.1.0552

2018-11-30 Fir de Conversatie Bram Moolenaar


Patch 8.1.0552
Problem:Saved last search pattern may not be restored.
Solution:   Call restore_last_search_pattern().  Add a check for balancing
saving and restoring the last search pattern.
Files:  src/ex_getln.c, src/search.c


*** ../vim-8.1.0551/src/ex_getln.c  2018-11-24 14:27:36.988474753 +0100
--- src/ex_getln.c  2018-11-30 21:43:13.477019050 +0100
***
*** 462,467 
--- 462,468 
  int   use_last_pat;
  
  // Parsing range may already set the last search pattern.
+ // NOTE: must call restore_last_search_pattern() before returning!
  save_last_search_pattern();
  
  if (!do_incsearch_highlighting(firstc, is_state, , ))
***
*** 633,638 
--- 634,640 
  int   save;
  
  // Parsing range may already set the last search pattern.
+ // NOTE: must call restore_last_search_pattern() before returning!
  save_last_search_pattern();
  
  if (!do_incsearch_highlighting(firstc, is_state, , ))
***
*** 735,740 
--- 737,743 
  int   skiplen, patlen;
  
  // Parsing range may already set the last search pattern.
+ // NOTE: must call restore_last_search_pattern() before returning!
  save_last_search_pattern();
  
  if (!do_incsearch_highlighting(firstc, is_state, , ))
***
*** 742,747 
--- 745,751 
restore_last_search_pattern();
return FAIL;
  }
+ restore_last_search_pattern();
  
  // Add a character from under the cursor for 'incsearch'.
  if (is_state->did_incsearch)
*** ../vim-8.1.0551/src/search.c2018-11-16 16:21:01.633310065 +0100
--- src/search.c2018-11-30 21:46:33.771924536 +0100
***
*** 96,101 
--- 96,102 
  /* copy of spats[RE_SEARCH], for keeping the search patterns while incremental
   * searching */
  static struct spat  saved_last_search_spat;
+ static intdid_save_last_search_spat = 0;
  static intsaved_last_idx = 0;
  static intsaved_no_hlsearch = 0;
  # endif
***
*** 364,369 
--- 365,375 
  void
  save_last_search_pattern(void)
  {
+ if (did_save_last_search_spat != 0)
+   IEMSG("did_save_last_search_spat is not zero");
+ else
+   ++did_save_last_search_spat;
+ 
  saved_last_search_spat = spats[RE_SEARCH];
  if (spats[RE_SEARCH].pat != NULL)
saved_last_search_spat.pat = vim_strsave(spats[RE_SEARCH].pat);
***
*** 374,381 
--- 380,395 
  void
  restore_last_search_pattern(void)
  {
+ if (did_save_last_search_spat != 1)
+ {
+   IEMSG("did_save_last_search_spat is not one");
+   return;
+ }
+ --did_save_last_search_spat;
+ 
  vim_free(spats[RE_SEARCH].pat);
  spats[RE_SEARCH] = saved_last_search_spat;
+ saved_last_search_spat.pat = NULL;
  # if defined(FEAT_EVAL)
  set_vv_searchforward();
  # endif
*** ../vim-8.1.0551/src/version.c   2018-11-28 21:20:34.096221686 +0100
--- src/version.c   2018-11-30 21:47:47.412181458 +0100
***
*** 794,795 
--- 794,797 
  {   /* Add new patch number below this line */
+ /**/
+ 552,
  /**/

-- 
SIGIRO -- irony detected (iron core dumped)

 /// 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.