Ryan Phillips | 1 Nov 2006 01:17

Bufnext and bufprev problem

Hi all.

I have just noticed a problem with bufnext and bufprev with two
(plus+) different files open within (g)vim.

Attached my vim --version for review.

OS: Linux, Ubuntu Edgy

Steps to reproduce:
    * Create a file ~140 lines long with A'S, TEST_A
    * cp TEST_A TEST_A_2
    * vim TEST_A TEST_A_2 --noplugins
    * In buf #1 scroll to a line number > 30.  I selected 38 to be at
      the top of my terminal. (I have line numbers turned on)
    * :bn   # to go to TEST_A_2
    * :bp   # to return to Buf #1

The first buffer has jumped N lines forward within the file.  N
appears to be a constant 22 for me.  Can anyone else reproduce this?

Regards,
Ryan

VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 31 2006 14:19:56)
Included patches: 1-153
Compiled by rphillips <at> rphillips
Huge version without GUI.  Features included (+) or not (-):
(Continue reading)

Yakov Lerner | 1 Nov 2006 01:29
Picon

Re: Bufnext and bufprev problem

On 11/1/06, Ryan Phillips <ryan-vim <at> trolocsis.com> wrote:
> I have just noticed a problem with bufnext and bufprev with two
> (plus+) different files open within (g)vim.
>
> Attached my vim --version for review.
>
> OS: Linux, Ubuntu Edgy
>
> Steps to reproduce:
>     * Create a file ~140 lines long with A'S, TEST_A
>     * cp TEST_A TEST_A_2
>     * vim TEST_A TEST_A_2 --noplugins
>     * In buf #1 scroll to a line number > 30.  I selected 38 to be at
>       the top of my terminal. (I have line numbers turned on)
>     * :bn   # to go to TEST_A_2
>     * :bp   # to return to Buf #1
>
> The first buffer has jumped N lines forward within the file.  N
> appears to be a constant 22 for me.  Can anyone else reproduce this?

If I try your testcase with 'vim -u NONE', then current line
becomes vertically centered around after :bn,:bp. The current
line number is not changed, but the screen visual line is changed.

The autocommand trick to disable this jumping was posted
couple of months ago on this list.

Another option to disable this jumping is to use
'set scrolloff=999'.

(Continue reading)

Yakov Lerner | 1 Nov 2006 01:44
Picon

Re: Bufnext and bufprev problem

On 11/1/06, Ryan Phillips <ryan-vim <at> trolocsis.com> wrote:
> Hi all.
>
> I have just noticed a problem with bufnext and bufprev with two
> (plus+) different files open within (g)vim.
>
> Attached my vim --version for review.
>
> OS: Linux, Ubuntu Edgy
>
> Steps to reproduce:
>     * Create a file ~140 lines long with A'S, TEST_A
>     * cp TEST_A TEST_A_2
>     * vim TEST_A TEST_A_2 --noplugins
>     * In buf #1 scroll to a line number > 30.  I selected 38 to be at
>       the top of my terminal. (I have line numbers turned on)
>     * :bn   # to go to TEST_A_2
>     * :bp   # to return to Buf #1
>
> The first buffer has jumped N lines forward within the file.  N
> appears to be a constant 22 for me.  Can anyone else reproduce this?

You can try the following commands in your vimrc, which
remove the screen repositioning:

  " when switching buffers, preserve window view
  if v:version >= 700
  au BufLeave * let b:winview = winsaveview()
  au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif
  endif
(Continue reading)

Ryan Phillips | 1 Nov 2006 01:48

Re: Bufnext and bufprev problem

Yakov Lerner wrote:
> On 11/1/06, Ryan Phillips <ryan-vim <at> trolocsis.com> wrote:
>> Hi all.
>>
>> I have just noticed a problem with bufnext and bufprev with two
>> (plus+) different files open within (g)vim.
>>
>> Attached my vim --version for review.
>>
>> OS: Linux, Ubuntu Edgy
>>
>> Steps to reproduce:
>>     * Create a file ~140 lines long with A'S, TEST_A
>>     * cp TEST_A TEST_A_2
>>     * vim TEST_A TEST_A_2 --noplugins
>>     * In buf #1 scroll to a line number > 30.  I selected 38 to be at
>>       the top of my terminal. (I have line numbers turned on)
>>     * :bn   # to go to TEST_A_2
>>     * :bp   # to return to Buf #1
>>
>> The first buffer has jumped N lines forward within the file.  N
>> appears to be a constant 22 for me.  Can anyone else reproduce this?
> 
> You can try the following commands in your vimrc, which
> remove the screen repositioning:
> 
>  " when switching buffers, preserve window view
>  if v:version >= 700
>  au BufLeave * let b:winview = winsaveview()
>  au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | 
(Continue reading)

Picon

Re: syntax region match with braces

В ср, 2006-11-01 в 10:53 +1100, Peter Hodge написа:
> --- ÐикÑоѬ ÐaожÑ&#146;Ñ&аѬов <vkojouharov <at> gmail.com> wrote:
> 
> > Hello,
> > 
> > I'm working on a syntax file for .edc files. The problem before me is
> > that I want to use a different syntax file for a "script" part. I've
> > created the syntax file for the script syntax, and I've read how yto use
> > "syn include".
> > 
> > The real problem is, that in the .edc files, scripts are located within:
> > script {
> >   SCRIPT HERE
> > }
> > ,however, the scripts themselves can also have {} braces. I've written
> > the following, but it only uncludes the script syntax upto the first "}"
> > brace, and I have no idea how to make it end on the _matching_ "}" brace
> > instead:
> > 
> > -----------------------------------------------------------------------
> > syn include 	 <at> edcEmbryo 	syntax/embryo.vim
> > unlet b:current_syntax
> > syn region 	edcScript	start="\<script\>\s*\n*\s*{" end="}"
> > contains= <at> edcEmbryo,edcScriptTag
> > syn keyword     edcScriptTag    contained script
> > -----------------------------------------------------------------------
> > 
> > So the question is, if I have:
> > script {
> > 	if (foo) {
(Continue reading)

Picon

Re: syntax region match with braces

В ср, 2006-11-01 в 10:53 +1100, Peter Hodge написа:
> --- ÐикÑоѬ ÐaожÑ&#146;Ñ&аѬов <vkojouharov <at> gmail.com> wrote:
> 
> > Hello,
> > 
> > I'm working on a syntax file for .edc files. The problem before me is
> > that I want to use a different syntax file for a "script" part. I've
> > created the syntax file for the script syntax, and I've read how yto use
> > "syn include".
> > 
> > The real problem is, that in the .edc files, scripts are located within:
> > script {
> >   SCRIPT HERE
> > }
> > ,however, the scripts themselves can also have {} braces. I've written
> > the following, but it only uncludes the script syntax upto the first "}"
> > brace, and I have no idea how to make it end on the _matching_ "}" brace
> > instead:
> > 
> > -----------------------------------------------------------------------
> > syn include 	 <at> edcEmbryo 	syntax/embryo.vim
> > unlet b:current_syntax
> > syn region 	edcScript	start="\<script\>\s*\n*\s*{" end="}"
> > contains= <at> edcEmbryo,edcScriptTag
> > syn keyword     edcScriptTag    contained script
> > -----------------------------------------------------------------------
> > 
> > So the question is, if I have:
> > script {
> > 	if (foo) {
(Continue reading)

Bram Moolenaar | 1 Nov 2006 12:44
Picon

Patch 7.0.154


Patch 7.0.154
Problem:    When 'foldnextmax' is negative Vim can hang. (James Vega)
Solution:   Avoid the fold level becoming negative.
Files:	    src/fold.c, src/syntax.c

*** ../vim-7.0.153/src/fold.c	Sun Apr 23 00:31:04 2006
--- src/fold.c	Sun Oct 29 20:23:21 2006
***************
*** 2971,2977 ****
--- 2971,2981 ----
      else
  	flp->lvl = get_indent_buf(buf, lnum) / buf->b_p_sw;
      if (flp->lvl > flp->wp->w_p_fdn)
+     {
  	flp->lvl = flp->wp->w_p_fdn;
+ 	if (flp->lvl < 0)
+ 	    flp->lvl = 0;
+     }
  }

  /* foldlevelDiff() {{{2 */
*** ../vim-7.0.153/src/syntax.c	Tue Oct  3 17:04:21 2006
--- src/syntax.c	Sun Oct 29 20:21:27 2006
***************
*** 6072,6078 ****
--- 6072,6082 ----
  		++level;
      }
      if (level > wp->w_p_fdn)
(Continue reading)

Peter Hodge | 1 Nov 2006 13:26
Picon
Favicon

Re: syntax region match with braces


--- Виктор Кожухаров <vkojouharov <at> gmail.com> wrote:

> В ср, 2006-11-01 в 10:53 +1100, Peter Hodge написа:
> > --- ÐикÑоѬ ÐaожђÑ&аѬов
> <vkojouharov <at> gmail.com> wrote:
> > 
> > > Hello,
> > > 
> > > I'm working on a syntax file for .edc files. The problem before me is
> > > that I want to use a different syntax file for a "script" part. I've
> > > created the syntax file for the script syntax, and I've read how yto use
> > > "syn include".
> > > 
> > > The real problem is, that in the .edc files, scripts are located within:
> > > script {
> > >   SCRIPT HERE
> > > }
> > > ,however, the scripts themselves can also have {} braces. I've written
> > > the following, but it only uncludes the script syntax upto the first "}"
> > > brace, and I have no idea how to make it end on the _matching_ "}" brace
> > > instead:
> > > 
> > > -----------------------------------------------------------------------
> > > syn include 	 <at> edcEmbryo 	syntax/embryo.vim
> > > unlet b:current_syntax
> > > syn region 	edcScript	start="\<script\>\s*\n*\s*{" end="}"
> > > contains= <at> edcEmbryo,edcScriptTag
> > > syn keyword     edcScriptTag    contained script
> > > -----------------------------------------------------------------------
(Continue reading)

Bram Moolenaar | 1 Nov 2006 15:31
Picon

Patch 7.0.155


Patch 7.0.155
Problem:    When getchar() returns a mouse button click there is no way to get
            the mouse coordinates.
Solution:   Add v:mouse_win, v:mouse_lnum and v:mouse_col.
Files:      runtime/doc/eval.txt, src/eval.c, src/vim.h

*** ../vim-7.0.154/runtime/doc/eval.txt	Tue Oct  3 14:43:31 2006
--- runtime/doc/eval.txt	Wed Nov  1 15:20:42 2006
***************
*** 1,4 ****
! *eval.txt*      For Vim version 7.0.  Last change: 2006 Sep 22

  
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
--- 1,4 ----
! *eval.txt*      For Vim version 7.0.  Last change: 2006 Nov 01

  
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
***************
*** 1374,1379 ****
--- 1380,1400 ----
  		'guitabtooltip'.  Only valid while one of these expressions is
  		being evaluated.  Read-only when in the |sandbox|.

+ 					*v:mouse_win* *mouse_win-variable*
+ v:mouse_win	Window number for a mouse click obtained with |getchar()|.
+ 		First window has number 1, like with |winnr()|.  The value is
+ 		zero when there was no mouse button click.
(Continue reading)

Bram Moolenaar | 1 Nov 2006 18:13
Picon

Patch 7.0.156


Patch 7.0.156 (extra)
Problem:    Vim doesn't compile for Amiga OS 4.
Solution:   Various changes for Amiga OS4. (Peter Bengtsson)
Files:	    src/feature.h, src/mbyte.c, src/memfile.c, src/memline.c,
	    src/os_amiga.c, src/os_amiga.h, src/pty.c

*** ../vim-7.0.155/src/feature.h	Thu Apr 27 01:54:09 2006
--- src/feature.h	Wed Nov  1 17:52:54 2006
***************
*** 1133,1139 ****
  /*
   * +ARP			Amiga only. Use arp.library, DOS 2.0 is not required.
   */
! #ifndef NO_ARP
  # define FEAT_ARP
  #endif

--- 1133,1139 ----
  /*
   * +ARP			Amiga only. Use arp.library, DOS 2.0 is not required.
   */
! #if !defined(NO_ARP) && !defined(__amigaos4__)
  # define FEAT_ARP
  #endif

*** ../vim-7.0.155/src/mbyte.c	Tue Aug 29 17:28:56 2006
--- src/mbyte.c	Wed Nov  1 17:52:54 2006
***************
*** 667,673 ****
(Continue reading)


Gmane