Hi,

I see inconsistent results when typing "dit" to delete content of an XML 
element.  Result depends on whether the closing XML tag is indented or not.

Observed: Opening and closing tag end up ...
- on different lines when closing tag had no indent (see Case_A below)
- on same line when closing tag had some indent before deleting (see Case_B 
below)

Expected: Same result, regardless of indent.

How to reproduce - details
==========================

Case_A: closing tag w/o any indent

    1. contents:
        |<li>
        |foo
        |</li>
        ^ Note: pipe symbols mark window edge and are not part of contents
    2. type "dit"
    3. result: tags end up on different lines
        |<li>
        |</li>

Case_B: closing tag with some indent

    1. contents:
        |<li>
        |foo
        |    </li>
    2. type "dit"
    3. result: tags end up on same line
        |<li></li>

Additional Notes:
=================
- inconsistency goes away when using "vitd" instead of "dit"
- compare "dit" with "di{" - latter behaves more nicely, IMHO
- issue can be worked around with a custom mapping:
  :onoremap it :normal! vit<CR>
- unfortunately, this workaround doesn't fix "surround" plugin (ID 1697) which
  breaks for removing tags at end of buffer that have no indent
  (problem: line preceding opening tag ends up after XML element contents)

Regards,
Jan

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
uname -a
Linux 3.17.7-200.fc20.x86_64 #1 SMP Wed Dec 17 03:35:33 UTC 2014 x86_64 x86_64 
x86_64 GNU/Linux


VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2014 08:56:57)
Included patches: 1-207, 209-475
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI.  Features included (+) or not (-):
+acl             +cscope          +folding         +menu            
+netbeans_intg   -sniff           +virtualedit
+arabic          +cursorbind      -footer          +mksession       +path_extra 
     +startuptime     +visual
+autocmd         +cursorshape     +fork()          +modify_fname    +perl       
     +statusline      +visualextra
-balloon_eval    +dialog_con      +gettext         +mouse           
+persistent_undo -sun_workshop    +viminfo
-browse          +diff            -hangul_input    -mouseshape      +postscript 
     +syntax          +vreplace
++builtin_terms  +digraphs        +iconv           +mouse_dec       +printer    
     +tag_binary      +wildignore
+byte_offset     -dnd             +insert_expand   +mouse_gpm       +profile    
     +tag_old_static  +wildmenu
+cindent         -ebcdic          +jumplist        -mouse_jsbterm   +python/dyn 
     -tag_any_white   +windows
-clientserver    +emacs_tags      +keymap          +mouse_netterm   -python3    
     -tcl             +writebackup
-clipboard       +eval            +langmap         +mouse_sgr       +quickfix   
     +terminfo        -X11
+cmdline_compl   +ex_extra        +libcall         -mouse_sysmouse  +reltime    
     +termresponse    -xfontset
+cmdline_hist    +extra_search    +linebreak       +mouse_urxvt     +rightleft  
     +textobjects     -xim
+cmdline_info    +farsi           +lispindent      +mouse_xterm     +ruby/dyn   
     +title           -xsmp
+comments        +file_in_path    +listcmds        +multi_byte      +scrollbind 
     -toolbar         -xterm_clipboard
+conceal         +find_in_path    +localmap        +multi_lang      +signs      
     +user_commands   -xterm_save
+cryptv          +float           +lua/dyn         -mzscheme        
+smartindent     +vertsplit       -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall 
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 
-grecord-gcc-switches  -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic 
-Wl,--enable-new-dtags  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim   
     -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl   
-Wl,--enable-new-dtags  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl 
-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc       


--- Directories and Files ---
$VIM = "/usr/share/vim"
directory "/usr/share/vim" exists
$VIMRUNTIME = "/usr/share/vim/vim74"
directory "/usr/share/vim/vim74" exists
"/usr/share/vim/vim74/doc/help.txt" is readable
"/usr/share/vim/vim74/doc/tags" is readable
"/usr/share/vim/vim74/menu.vim" is readable
"/usr/share/vim/vim74/filetype.vim" is readable
"/usr/share/vim/vim74/syntax/synload.vim" is readable
--- Scripts sourced ---
  1: /usr/share/vim/vim74/bugreport.vim
--- Options ---
  aleph=224         nocscopeverbose     nohidden              mouse=            
  shiftwidth=8      notitle
noarabic            nocursorbind          history=0           mousemodel=extend 
  shortmess=          titlelen=85
  arabicshape       nocursorcolumn      nohkmap               mousetime=500     
noshortname           titlestring=
noallowrevins       nocursorline        nohkmapp            nonumber            
  showbreak=        nottimeout
noaltkeymap           debug=            nohlsearch            numberwidth=8     
noshowcmd             ttimeoutlen=-1
  ambiwidth=single  nodelcombine        noicon                omnifunc=         
noshowfulltag         ttybuiltin
noautochdir           dictionary=         iconstring=         operatorfunc=     
noshowmatch           ttyfast
noautoindent        nodiff              noignorecase        nopaste             
noshowmode            ttymouse=xterm
noautoread            diffexpr=           iminsert=0          pastetoggle=      
  showtabline=1       ttyscroll=999
noautowrite           diffopt=filler      imsearch=0          patchexpr=        
  sidescroll=0        undodir=.
noautowriteall      nodigraph             includeexpr=        patchmode=        
  sidescrolloff=0   noundofile
  background=light    display=          noincsearch         nopreserveindent    
nosmartcase           undolevels=1000
  backspace=          eadirection=both    indentexpr=         previewheight=12  
nosmartindent         undoreload=10000
nobackup            noedcompatible      noinfercase         nopreviewwindow     
nosmarttab            updatecount=200
  backupcopy=yes      encoding=utf-8    noinsertmode          printdevice=      
  softtabstop=0       updatetime=4000
  backupext=~         endofline           isprint=@,161-255   printencoding=    
nospell               verbose=0
  backupskip=/tmp/*   equalalways         joinspaces          printfont=courier 
  spellfile=          verbosefile=
nobinary              equalprg=           key=                printmbcharset=   
  spelllang=en        viminfo=
nobomb              noerrorbells          keymap=             printmbfont=      
  spellsuggest=best   virtualedit=
nobreakindent       noesckeys             keymodel=           printoptions=     
nosplitbelow        novisualbell
  breakindentopt=     eventignore=        keywordprg=man      prompt            
nosplitright          warn
  bufhidden=        noexpandtab           langmap=            pumheight=0       
  startofline       noweirdinvert
  buflisted         noexrc                langmenu=           quoteescape=\     
  statusline=         whichwrap=
  buftype=            fileencoding=       laststatus=1      noreadonly          
  suffixesadd=        wildchar=^E
  cdpath=,,           fileformat=unix   nolazyredraw          redrawtime=2000   
  swapfile            wildcharm=0
  cedit=              fileformats=      nolinebreak           regexpengine=0    
  swapsync=fsync      wildignore=
  charconvert=      nofileignorecase      lines=30          norelativenumber    
  switchbuf=        nowildignorecase
nocindent             filetype=         nolisp                remap             
  synmaxcol=3000    nowildmenu
  cinoptions=       nofkmap             nolist                report=2          
  syntax=             wildmode=full
  cmdheight=1         foldclose=          listchars=eol:$   norevins            
  tabline=            wildoptions=
  cmdwinheight=7      foldcolumn=0      noloadplugins       norightleft         
  tabpagemax=10       window=29
  colorcolumn=        foldenable          magic             noruler             
  tabstop=8           winheight=1
  columns=131         foldexpr=0          makeef=             rulerformat=      
  tagbsearch        nowinfixheight
  compatible          foldignore=#        makeprg=make        scroll=14         
  taglength=0       nowinfixwidth
  concealcursor=      foldlevel=0         matchtime=5       noscrollbind        
notagrelative         winminheight=1
  conceallevel=0      foldlevelstart=-1   maxcombine=2        scrolljump=1      
  tagstack            winminwidth=1
  completefunc=       foldmethod=manual   maxfuncdepth=100    scrolloff=0       
notermbidi            winwidth=20
noconfirm             foldminlines=1      maxmapdepth=1000  nosecure            
  termencoding=       wrap
nocopyindent          foldnestmax=20      maxmem=3981626      selectmode=       
noterse               wrapmargin=0
  cryptmethod=zip     formatexpr=         maxmemtot=3981626   shell=/bin/bash   
notextauto            wrapscan
  cscopepathcomp=0    formatoptions=vt    menuitems=25        shellcmdflag=-c   
notextmode            write
  cscopeprg=cscope    formatprg=        nomodeline            shellquote=       
  textwidth=0       nowriteany
  cscopequickfix=     fsync               modelines=5       noshelltemp         
  thesaurus=          writebackup
nocscoperelative    nogdefault            modifiable          shellxquote=      
notildeop             writedelay=0
nocscopetag           helpheight=20     nomodified            shellxescape=     
  timeout
  cscopetagorder=0    helplang=en       nomore              noshiftround        
  timeoutlen=1000
  backupdir=.,~/tmp,~/
  breakat= ^I!@*-+;:,./?
  casemap=internal,keepascii
  cinkeys=0{,0},0),:,0#,!^F,o,O,e
  cinwords=if,else,while,do,for,switch
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  commentstring=/*%s*/
  complete=.,w,b,u,t,i
  completeopt=menu,preview
  cpoptions=aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;
  define=^\s*#\s*define
  directory=.,~/tmp,/var/tmp,/tmp
  errorfile=errors.err
  errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared 
identifier is reported only once,%-G%f:%l: for each function it appears 
in.),%-GIn file included from %f:%l:%c:,%-GIn file included from 
%f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from 
%f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ 
]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] 
%m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory 
%*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory 
%*[`']%f',%DMaking %*\a in %f,%f|%l| %m
  fileencodings=ucs-bom,utf-8,default,latin1
  fillchars=vert:|,fold:-
  foldmarker={{{,}}}
  foldopen=block,hor,mark,percent,quickfix,search,tag,undo
  foldtext=foldtext()
  formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
  grepprg=grep -n $* /dev/null
  guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block
  helpfile=/usr/share/vim/vim74/doc/help.txt
  
highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn
  include=^\s*#\s*include
  indentkeys=0{,0},:,0#,!^F,o,O,e
  isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
  isident=@,48-57,_,192-255
  iskeyword=@,48-57,_
  
lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object
  matchpairs=(:),{:},[:]
  maxmempattern=1000
  mkspellmem=460000,2000,500
  nrformats=octal,hex
  paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
  path=.,/usr/include,,
  printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' 
' . v:fname_in) . delete(v:fname_in) + v:shell_error
  printheader=%<%f%h%m%=Page %N
  rightleftcmd=search
  
runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,~/.vim/after
  scrollopt=ver,jump
  sections=SHNHH HUnhsh
  selection=inclusive
  sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize
  shellpipe=2>&1| tee
  shellredir=>%s 2>&1
  spellcapcheck=[.?!]\_[\])'"^I ]\+
  suffixes=.bak,~,.o,.h,.info,.swp,.obj
  tags=./tags,./TAGS,tags,TAGS
  term=xterm-256color
  titleold=Thanks for flying Vim
  ttytype=xterm-256color
  viewdir=~/.vim/view
  viewoptions=folds,options,cursor
--- Terminal codes ---
  t_AL=^[[%p1%dL      t_CV=               t_IS=^[]1;          t_ms=y            
  t_se=^[[27m         t_vi=^[[?25l
  t_al=^[[L           t_ut=y              t_ke=^[[?1l^[>      t_nd=^[[C         
  t_so=^[[7m          t_vs=^[[?12;25h
  t_bc=               t_da=               t_ks=^[[?1h^[=      t_op=^[[39;49m    
  t_sr=^[M            t_SI=
  t_cd=^[[J           t_db=               t_le=^H             t_RI=^[[%p1%dC    
  t_ts=^[]2;          t_EI=
  t_ce=^[[K           t_DL=^[[%p1%dM      t_mb=^[[5m          t_RV=^[[>c        
  t_te=^[[?1049l      t_xs=
  t_cl=^[[H^[[2J      t_dl=^[[M           t_md=^[[1m          t_u7=^[[6n        
  t_ti=^[[?1049h      t_ZH=^[[7m
  t_Co=256            t_fs=^G             t_me=^[[m           t_Sb=             
  t_ue=^[[m           t_ZR=^[[m
  t_CS=               t_IE=^G             t_mr=^[[7m          t_Sf=             
  t_us=^[[4m
  t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m
  t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m
  t_cm=^[[%i%p1%d;%p2%dH
  t_cs=^[[%i%p1%d;%p2%dr
  t_vb=^[[?5h$<100/>^[[?5l
  t_ve=^[[?12l^[[?25h
  t_WP=^[[3;%p1%d;%p2%dt
  t_WS=^[[8;%p1%d;%p2%dt
--- Terminal keys ---
t_#2 <S-Home>    ^[[1;2H   t_K8 <kDivide>   ^[O*o     t_k; <F10>       ^[[21;*~ 
      <xF1>       ^[[11~
t_#4 <S-Left>    ^[[1;2D   t_K9 <kMultiply> ^[O*j     t_kB <S-Tab>     ^[[Z     
      <xF2>       ^[[12~
t_%1 <Help>      ^[[28;*~  t_KA <kEnter>    ^[O*M     t_kD <Del>       ^[[3~    
      <xF3>       ^[[13~
t_%i <S-Right>   ^[[1;2C   t_KB <kPoint>    ^[O*n     t_kI <Insert>    ^[[2;*~  
      <xF4>       ^[[14~
t_&8 <Undo>      ^[[26;*~  t_k1 <F1>        ^[OP      t_kN <PageDown>  ^[[6;*~  
      <xEnd>      ^[O*F
t_*7 <S-End>     ^[[1;2F   t_k2 <F2>        ^[OQ      t_kP <PageUp>    ^[[5;*~  
      <zEnd>      ^[[8;*~
t_@7 <End>       ^[[1;*F   t_k3 <F3>        ^[OR      t_kb <BS>        ^?       
      <xHome>     ^[O*H
t_F1 <F11>       ^[[23;*~  t_k4 <F4>        ^[OS      t_kd <Down>      ^[O*B    
      <zHome>     ^[[7;*~
t_F2 <F12>       ^[[24;*~  t_k5 <F5>        ^[[15;*~  t_kh <Home>      ^[[1;*H  
      <xUp>       ^[[1;*A
t_K1 <kHome>     ^[[1;*~   t_k6 <F6>        ^[[17;*~  t_kl <Left>      ^[O*D    
      <xDown>     ^[[1;*B
t_K4 <kEnd>      ^[[4;*~   t_k7 <F7>        ^[[18;*~  t_kr <Right>     ^[O*C    
      <xLeft>     ^[[1;*D
t_K6 <kPlus>     ^[O*k     t_k8 <F8>        ^[[19;*~  t_ku <Up>        ^[O*A    
      <xRight>    ^[[1;*C
t_K7 <kMinus>    ^[O*m     t_k9 <F9>        ^[[20;*~       <Mouse>     ^[[M     
      <kDel>      ^[[3;*~
--- Auto-Commands ---
--- Normal/Visual mode mappings ---

No mapping found
--- Insert/Command-line mode mappings ---

No mapping found
--- Abbreviations ---

No abbreviation found
--- Highlighting ---
SpecialKey     xxx term=bold ctermfg=4 guifg=Blue
NonText        xxx term=bold ctermfg=12 gui=bold guifg=Blue
Directory      xxx term=bold ctermfg=4 guifg=Blue
ErrorMsg       xxx term=standout ctermfg=15 ctermbg=1 guifg=White guibg=Red
IncSearch      xxx term=reverse cterm=reverse gui=reverse
Search         xxx term=reverse ctermbg=11 guibg=Yellow
MoreMsg        xxx term=bold ctermfg=2 gui=bold guifg=SeaGreen
ModeMsg        xxx term=bold cterm=bold gui=bold
LineNr         xxx term=underline ctermfg=130 guifg=Brown
CursorLineNr   xxx term=bold ctermfg=130 gui=bold guifg=Brown
Question       xxx term=standout ctermfg=2 gui=bold guifg=SeaGreen
StatusLine     xxx term=bold,reverse cterm=bold,reverse gui=bold,reverse
StatusLineNC   xxx term=reverse cterm=reverse gui=reverse
VertSplit      xxx term=reverse cterm=reverse gui=reverse
Title          xxx term=bold ctermfg=5 gui=bold guifg=Magenta
Visual         xxx term=reverse ctermbg=7 guibg=LightGrey
VisualNOS      xxx cleared
WarningMsg     xxx term=standout ctermfg=1 guifg=Red
WildMenu       xxx term=standout ctermfg=0 ctermbg=11 guifg=Black guibg=Yellow
Folded         xxx term=standout ctermfg=4 ctermbg=248 guifg=DarkBlue 
guibg=LightGrey
FoldColumn     xxx term=standout ctermfg=4 ctermbg=248 guifg=DarkBlue guibg=Grey
DiffAdd        xxx term=bold ctermbg=224 guibg=LightBlue
DiffChange     xxx term=bold ctermbg=225 guibg=LightMagenta
DiffDelete     xxx term=bold ctermfg=12 ctermbg=159 gui=bold guifg=Blue 
guibg=LightCyan
DiffText       xxx term=reverse cterm=bold ctermbg=9 gui=bold guibg=Red
SignColumn     xxx term=standout ctermfg=4 ctermbg=248 guifg=DarkBlue guibg=Grey
Conceal        xxx ctermfg=7 ctermbg=242 guifg=LightGrey guibg=DarkGrey
SpellBad       xxx term=reverse ctermbg=224 gui=undercurl guisp=Red
SpellCap       xxx term=reverse ctermbg=81 gui=undercurl guisp=Blue
SpellRare      xxx term=reverse ctermbg=225 gui=undercurl guisp=Magenta
SpellLocal     xxx term=underline ctermbg=14 gui=undercurl guisp=DarkCyan
Pmenu          xxx ctermfg=0 ctermbg=225 guibg=LightMagenta
PmenuSel       xxx ctermfg=0 ctermbg=7 guibg=Grey
PmenuSbar      xxx ctermbg=248 guibg=Grey
PmenuThumb     xxx ctermbg=0 guibg=Black
TabLine        xxx term=underline cterm=underline ctermfg=0 ctermbg=7 
gui=underline guibg=LightGrey
TabLineSel     xxx term=bold cterm=bold gui=bold
TabLineFill    xxx term=reverse cterm=reverse gui=reverse
CursorColumn   xxx term=reverse ctermbg=7 guibg=Grey90
CursorLine     xxx term=underline cterm=underline guibg=Grey90
ColorColumn    xxx term=reverse ctermbg=224 guibg=LightRed
MatchParen     xxx term=reverse ctermbg=14 guibg=Cyan
--- Variables ---
more_save             #0
b:changedtick         #2
v:version             #704
v:beval_winnr         #0
v:lnum                #0
v:hlsearch            #1
v:scrollstart          /usr/share/vim/vim74/bugreport.vim line 21
v:oldfiles            []
v:dying               #0
v:windowid            #0
v:lang                 en_US.utf8
v:count               #0
v:progpath             /usr/bin/vim
v:progname             vim
v:cmdbang             #0
v:foldlevel           #0
v:ctype                en_US.utf8
v:prevcount           #0
v:register             "
v:mouse_win           #0
v:count1              #1
v:foldstart           #0
v:foldend             #0
v:profiling           #0
v:beval_col           #0
v:beval_lnum          #0
v:mouse_lnum          #0
v:beval_bufnr         #0
v:shell_error         #0
v:lc_time              en_US.utf8
v:searchforward       #1
v:mouse_col           #0
v:statusmsg            No abbreviation found

Raspunde prin e-mail lui