# HG changeset patch
# User ZyX <[email protected]>
# Date 1354721282 -14400
# Node ID fdde3db8b31e1b37a0e29441471d19be9adf35c2
# Parent  baf3d5da0a1c9f2334a472f7690abfbc235fbf74
Added undo_indent and cpo saving/setting

diff -r baf3d5da0a1c -r fdde3db8b31e runtime/indent/yaml.vim
--- a/runtime/indent/yaml.vim   Wed Dec 05 08:44:50 2012 +0400
+++ b/runtime/indent/yaml.vim   Wed Dec 05 19:28:02 2012 +0400
@@ -3,18 +3,23 @@
 " Maintainer:       Nikolai Pavlov <[email protected]>
 
 " Only load this indent file when no other was loaded.
-if exists("b:did_indent")
+if exists('b:did_indent')
   finish
 endif
 
+let s:save_cpo = &cpo
+set cpo&vim
+
 let b:did_indent = 1
 
 setlocal indentexpr=GetYAMLIndent(v:lnum)
 setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-
 setlocal nosmartindent
 
+let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<'
+
 " Only define the function once.
-if exists("*GetYAMLIndent")
+if exists('*GetYAMLIndent')
     finish
 endif
 
@@ -123,3 +128,5 @@
     endif
     return previndent
 endfunction
+
+let &cpo = s:save_cpo

-- 
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
*** /tmp/extdiff.e5D3Lw/vim.baf3d5da0a1c/runtime/indent/yaml.vim	2012-12-05 19:28:30.489121102 +0400
--- vim.fdde3db8b31e/runtime/indent/yaml.vim	2012-12-05 19:28:30.491121080 +0400
***************
*** 3,20 ****
  " Maintainer:       Nikolai Pavlov <[email protected]>
  
  " Only load this indent file when no other was loaded.
! if exists("b:did_indent")
    finish
  endif
  
  let b:did_indent = 1
  
  setlocal indentexpr=GetYAMLIndent(v:lnum)
  setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-
  setlocal nosmartindent
  
  " Only define the function once.
! if exists("*GetYAMLIndent")
      finish
  endif
  
--- 3,25 ----
  " Maintainer:       Nikolai Pavlov <[email protected]>
  
  " Only load this indent file when no other was loaded.
! if exists('b:did_indent')
    finish
  endif
  
+ let s:save_cpo = &cpo
+ set cpo&vim
+ 
  let b:did_indent = 1
  
  setlocal indentexpr=GetYAMLIndent(v:lnum)
  setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-
  setlocal nosmartindent
  
+ let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<'
+ 
  " Only define the function once.
! if exists('*GetYAMLIndent')
      finish
  endif
  
***************
*** 123,125 ****
--- 128,132 ----
      endif
      return previndent
  endfunction
+ 
+ let &cpo = s:save_cpo

Raspunde prin e-mail lui