Bug (?) in :s command

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug (?) in :s command

Jürgen Krämer

Hello,

suppose I have a buffer containing following lines (please ignore
leading whitespace):

  1
  2
  3

Now I execute

  :%s/\n/;/

As result I would expect

  1;2;3;

but VIM 7.0c01 gives

  1;2;3;1;2;3

Can anybody confirm this misbehaviour? Or is my expectation wrong?

Regards,
Jürgen

P.S.: VIM was started with "-u NONE" and this is the output of ":ver":

VIM - Vi IMproved 7.0c01 BETA (2006 Mar 27, compiled Mar 28 2006 08:20:43)
MS-Windows 32 bit GUI version with OLE support
Compiled by Jürgen Krämer <[hidden email]>
Huge version with GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse +mouseshape +multi_byte +multi_lang -mzscheme
+netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript +printer
+profile +python/dyn +quickfix +rightleft -ruby +scrollbind +signs +smartindent
 -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title +toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32

   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -DWIN32  -D_WIN32 -D_MT -MT -I. -Iproto -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG      -DWINVER=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLYT/ /Ox -DNDEBUG  -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl84.dll\" -DDYNAMIC_TCL_VER=\"8.4\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python23.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\" -DFEAT_HUGE /Zi /Fd.\ObjGOLYT/
Linking: link /RELEASE /nologo /subsystem:windows /incremental:no /nodefaultlib:libc advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib oldnames.lib kernel32.lib gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib     /nodefaultlib:python23.lib   C:\Programme\Tcl\lib\tclstub84.lib WSock32.lib  /PDB:.\ObjGOLYT/gvim.pdb -debug

--
Jürgen Krämer                              Softwareentwicklung
HABEL GmbH & Co. KG                        mailto:[hidden email]
Hinteres Öschle 2                          Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-Weilheim                    Fax: +49 / 74 61 / 93 53 - 99
Reply | Threaded
Open this post in threaded view
|

Odp: Bug (?) in :s command

Zbigniew Kowalski
I guess you are right as my 6.4a beta behaves as you'd wanted
ie i get just 1;2;3

regards
zbikow

Dnia 6-04-2006 o godz. 8:50 Jürgen Krämer napisał(a):

>
> Hello,
>
> suppose I have a buffer containing following lines (please ignore
> leading whitespace):
>
>   1
>   2
>   3
>
> Now I execute
>
>   :%s/\n/;/
>
> As result I would expect
>
>   1;2;3;
>
> but VIM 7.0c01 gives
>
>   1;2;3;1;2;3
>
> Can anybody confirm this misbehaviour? Or is my expectation wrong?
>
> Regards,
> Jürgen
>
> P.S.: VIM was started with "-u NONE" and this is the output of ":ver":
>
> VIM - Vi IMproved 7.0c01 BETA (2006 Mar 27, compiled Mar 28 2006
> 08:20:43)
> MS-Windows 32 bit GUI version with OLE support
> Compiled by Jürgen Krämer <[hidden email]>
> Huge version with GUI.  Features included (+) or not (-):
> +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
> +cindent
> +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
> +comments
> +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
> +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
> +find_in_path
> +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand
> +jumplist
>  +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
> +menu
> +mksession +modify_fname +mouse +mouseshape +multi_byte +multi_lang
> -mzscheme
> +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript
> +printer
> +profile +python/dyn +quickfix +rightleft -ruby +scrollbind +signs
> +smartindent
>  -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
> -tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title
> +toolbar
> +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
> +vreplace
> +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save
> -xpm_w32
>
>    system vimrc file: "$VIM\vimrc"
>      user vimrc file: "$HOME\_vimrc"
>  2nd user vimrc file: "$VIM\_vimrc"
>       user exrc file: "$HOME\_exrc"
>   2nd user exrc file: "$VIM\_exrc"
>   system gvimrc file: "$VIM\gvimrc"
>     user gvimrc file: "$HOME\_gvimrc"
> 2nd user gvimrc file: "$VIM\_gvimrc"
>     system menu file: "$VIMRUNTIME\menu.vim"
> Compilation: cl -c /W3 /nologo -DWIN32  -D_WIN32 -D_MT -MT -I. -Iproto
> -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG      
> -DWINVER=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLYT/ /Ox -DNDEBUG  
> -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL
> -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl84.dll\" -DDYNAMIC_TCL_VER=\"8.4\"
> -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python23.dll\"
> -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\" -DFEAT_HUGE
> /Zi /Fd.\ObjGOLYT/
> Linking: link /RELEASE /nologo /subsystem:windows /incremental:no
> /nodefaultlib:libc advapi32.lib shell32.lib gdi32.lib comdlg32.lib
> ole32.lib uuid.lib oldnames.lib kernel32.lib gdi32.lib version.lib  
> winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386
> /nodefaultlib libcmt.lib oleaut32.lib  user32.lib    
> /nodefaultlib:python23.lib   C:\Programme\Tcl\lib\tclstub84.lib
> WSock32.lib  /PDB:.\ObjGOLYT/gvim.pdb -debug
>
> --
> Jürgen Krämer                              Softwareentwicklung
> HABEL GmbH & Co. KG                        mailto:[hidden email]
> Hinteres Öschle 2                          Tel: +49 / 74 61 / 93 53 - 15
> 78604 Rietheim-Weilheim                    Fax: +49 / 74 61 / 93 53 - 99
>
Zbigniew Kowalski
http://zbikow1.webpark.pl/


Reply | Threaded
Open this post in threaded view
|

Re: Bug (?) in :s command

Bram Moolenaar
In reply to this post by Jürgen Krämer

Jürgen Krämer wrote:

> suppose I have a buffer containing following lines (please ignore
> leading whitespace):
>
>   1
>   2
>   3
>
> Now I execute
>
>   :%s/\n/;/
>
> As result I would expect
>
>   1;2;3;
>
> but VIM 7.0c01 gives
>
>   1;2;3;1;2;3
>
> Can anybody confirm this misbehaviour? Or is my expectation wrong?

This was fixed a few snapshots ago.  The last line was accidentally
doubled.

--
All good vision statements are created by groups of people with bloated
bladders who would rather be doing anything else.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         ///
Reply | Threaded
Open this post in threaded view
|

Re: Bug (?) in :s command

Jürgen Krämer

Hi

Bram Moolenaar wrote:
>
> Jürgen Krämer wrote:
> >
> > Can anybody confirm this misbehaviour? Or is my expectation wrong?
>
> This was fixed a few snapshots ago.  The last line was accidentally
> doubled.


ah, thanks. Guessing from your other e-mail I was not able to fetch the
current snapshot from sourceforge due to CVS problems.

Regards,
Jürgen

--
Jürgen Krämer                              Softwareentwicklung
HABEL GmbH & Co. KG                        mailto:[hidden email]
Hinteres Öschle 2                          Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-Weilheim                    Fax: +49 / 74 61 / 93 53 - 99
Reply | Threaded
Open this post in threaded view
|

Re: Bug (?) in :s command

Georg Dahn
In reply to this post by Jürgen Krämer
Hi!

I have done this in Vim 7.0c10 and got 1;2;3;

Best wishes,
Georg


Jürgen Krämer schrieb:

> Hello,
>
> suppose I have a buffer containing following lines (please ignore
> leading whitespace):
>
>   1
>   2
>   3
>
> Now I execute
>
>   :%s/\n/;/
>
> As result I would expect
>
>   1;2;3;
>
> but VIM 7.0c01 gives
>
>   1;2;3;1;2;3
>
> Can anybody confirm this misbehaviour? Or is my expectation wrong?
>
> Regards,
> Jürgen
>
> P.S.: VIM was started with "-u NONE" and this is the output of ":ver":
>
> VIM - Vi IMproved 7.0c01 BETA (2006 Mar 27, compiled Mar 28 2006 08:20:43)
> MS-Windows 32 bit GUI version with OLE support
> Compiled by Jürgen Krämer <[hidden email]>
> Huge version with GUI.  Features included (+) or not (-):
> +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
> +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
> +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
> +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
> +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist
>  +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
> +mksession +modify_fname +mouse +mouseshape +multi_byte +multi_lang -mzscheme
> +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript +printer
> +profile +python/dyn +quickfix +rightleft -ruby +scrollbind +signs +smartindent
>  -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
> -tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title +toolbar
> +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
> +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32
>
>    system vimrc file: "$VIM\vimrc"
>      user vimrc file: "$HOME\_vimrc"
>  2nd user vimrc file: "$VIM\_vimrc"
>       user exrc file: "$HOME\_exrc"
>   2nd user exrc file: "$VIM\_exrc"
>   system gvimrc file: "$VIM\gvimrc"
>     user gvimrc file: "$HOME\_gvimrc"
> 2nd user gvimrc file: "$VIM\_gvimrc"
>     system menu file: "$VIMRUNTIME\menu.vim"
> Compilation: cl -c /W3 /nologo -DWIN32  -D_WIN32 -D_MT -MT -I. -Iproto -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG      -DWINVER=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLYT/ /Ox -DNDEBUG  -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl84.dll\" -DDYNAMIC_TCL_VER=\"8.4\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python23.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\" -DFEAT_HUGE /Zi /Fd.\ObjGOLYT/
> Linking: link /RELEASE /nologo /subsystem:windows /incremental:no /nodefaultlib:libc advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib oldnames.lib kernel32.lib gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib     /nodefaultlib:python23.lib   C:\Programme\Tcl\lib\tclstub84.lib WSock32.lib  /PDB:.\ObjGOLYT/gvim.pdb -debug
>

               
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com