On Do, 10 Sep 2015, Alexander Monakov wrote:

(CC'ing vim-dev)

> Hello,
> 
> I wonder if there's any reason that smarttab is enabled in paste mode? 
> Consider:
> 
> $ vim -u NONE
> :set nocp
> :set sw=2
> :set smarttab
> :set paste
> i<tab>
> 
> This inserts two spaces rather than a tab character in paste-mode, seemingly 
> in contradiction of the paste-mode's purpose. There's a number of options 
> that are temporarily disabled when paste mode is entered, shouldn't 
> 'smarttab' be added to the list?
> 
> (if it was discussed in the past, please point me; I couldn't find anything)

Thanks, this must have been there for very long and nobody noticed. Here 
is a patch, to fix this.

Best,
Christian
-- 
Schönheit ist nicht nur das Aussehen, sondern alles, was wir an einem
Menschen als schön empfinden.
                -- Wolperin

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -11640,6 +11640,7 @@ paste_option_changed()
 {
     static int	old_p_paste = FALSE;
     static int	save_sm = 0;
+    static int	save_sta = 0;
 #ifdef FEAT_CMDL_INFO
     static int	save_ru = 0;
 #endif
@@ -11668,6 +11669,7 @@ paste_option_changed()
 
 	    /* save global options */
 	    save_sm = p_sm;
+	    save_sta = p_sta;
 #ifdef FEAT_CMDL_INFO
 	    save_ru = p_ru;
 #endif
@@ -11697,6 +11699,7 @@ paste_option_changed()
 
 	/* set global options */
 	p_sm = 0;		    /* no showmatch */
+	p_sta = 0;		    /* no smarttab */
 #ifdef FEAT_CMDL_INFO
 # ifdef FEAT_WINDOWS
 	if (p_ru)
@@ -11731,6 +11734,7 @@ paste_option_changed()
 
 	/* restore global options */
 	p_sm = save_sm;
+	p_sta = save_sta;
 #ifdef FEAT_CMDL_INFO
 # ifdef FEAT_WINDOWS
 	if (p_ru != save_ru)

Raspunde prin e-mail lui