matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.2k stars 56 forks source link

Only first line is indented when moving multiple lines into another indentation level #55

Closed neur1n closed 3 years ago

neur1n commented 3 years ago

For example, in the following snippet:

if  (foo)
{
  a = 0;
}
b = 1;
c = 2;

when I tried to move b = 1; and c = 2; into the if block, only b = 1; is indented:

if  (foo)
{
  a = 0;
  b = 1;
c = 2;
}

Also tested on Python codes.

matze commented 3 years ago

I cannot reproduce this behavior. If you haven't updated: could you? And if that does not help what's your system?

neur1n commented 3 years ago

Sorry about the late response. I'm using the latest vim-move, with Neovim 0.5.0, Windows 10 OS. And this is the minimal config:

if has('win32')
  let $VIMCONFIG=$HOME.'/AppData/Local/nvim'
  let g:python3_host_prog='python'
else
  let $VIMCONFIG=$HOME.'/.config/nvim'
  let g:python3_host_prog='/usr/bin/python3'
endif

call plug#begin('$VIMCONFIG/plugged')
Plug 'matze/vim-move'
call plug#end()
Daniel-M commented 3 years ago

I have the same issue as described by @Neur1n

My nvim configuration is,

$ nvim --version
NVIM v0.5.0-dev+1002-gae63dc264
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/opt/neovim/build/config -I/opt/neovim/src -I/opt/neovim/.deps/usr/include -I/usr/include -I/opt/neovim/build/src/nvim/auto -I/opt/neovim/build/include
Compilado por damejia@huitaca

Features: +acl +iconv +tui
See ":help feature-compile"

     archivo "vimrc" del sistema: "$VIM/sysinit.vim"
            predefinido para $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

I'm 100% sure I have the latest vim-move version pulled by vim-plug

Sorry about the late response. I'm using the latest vim-move, with Neovim 0.5.0, Windows 10 OS. And this is the minimal config:

if has('win32')
  let $VIMCONFIG=$HOME.'/AppData/Local/nvim'
  let g:python3_host_prog='python'
else
  let $VIMCONFIG=$HOME.'/.config/nvim'
  let g:python3_host_prog='/usr/bin/python3'
endif

call plug#begin('$VIMCONFIG/plugged')
Plug 'matze/vim-move'
call plug#end()
matze commented 3 years ago

Okay, I just built nvim master and I can reproduce the issue. It definitely regressed from the last stable nvim 0.4.4. No idea what it could be though :shrug:

Daniel-M commented 3 years ago

I don't really know how to contribute, besides I don't know enough vimscript to understand whats going on and help to solve it, this plugin is one of the most useful plugins I know

matze commented 3 years ago

Since I will be affected at some point (really looking forward to 0.5!) I will certainly have a look what's going on.