Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.745
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.745
Problem:    Automatically setting 'ttymouse' doesn't work.
Solution:   Reset the "option was set" flag when using the default.
Files:	    src/option.c, src/proto/option.pro, src/term.c


*** ../vim-7.3.744/src/option.c	2012-10-21 03:45:57.000000000 +0200
--- src/option.c	2012-12-03 20:07:32.000000000 +0100
***************
*** 11179,11184 ****
--- 11179,11197 ----
  }
  
  /*
+  * Reset the flag indicating option "name" was set.
+  */
+     void
+ reset_option_was_set(name)
+     char_u	*name;
+ {
+     int idx = findoption(name);
+ 
+     if (idx >= 0)
+ 	options[idx].flags &= ~P_WAS_SET;
+ }
+ 
+ /*
   * compatible_set() - Called when 'compatible' has been set or unset.
   *
   * When 'compatible' set: Set all relevant options (those that have the P_VIM)
*** ../vim-7.3.744/src/proto/option.pro	2012-10-21 00:10:29.000000000 +0200
--- src/proto/option.pro	2012-12-03 20:08:36.000000000 +0100
***************
*** 52,57 ****
--- 52,58 ----
  void vimrc_found __ARGS((char_u *fname, char_u *envname));
  void change_compatible __ARGS((int on));
  int option_was_set __ARGS((char_u *name));
+ void reset_option_was_set __ARGS((char_u *name));
  int can_bs __ARGS((int what));
  void save_file_ff __ARGS((buf_T *buf));
  int file_ff_differs __ARGS((buf_T *buf, int ignore_empty));
*** ../vim-7.3.744/src/term.c	2012-10-21 02:10:20.000000000 +0200
--- src/term.c	2012-12-03 20:09:28.000000000 +0100
***************
*** 1864,1870 ****
--- 1864,1875 ----
  	}
  #  endif
  	if (p != NULL)
+ 	{
  	    set_option_value((char_u *)"ttym", 0L, p, 0);
+ 	    /* Reset the WAS_SET flag, 'ttymouse' can be set to "sgr" or
+ 	     * "xterm2" in check_termcode(). */
+ 	    reset_option_was_set((char_u *)"ttym");
+ 	}
  	if (p == NULL
  #   ifdef FEAT_GUI
  		|| gui.in_use
*** ../vim-7.3.744/src/version.c	2012-11-29 20:09:55.000000000 +0100
--- src/version.c	2012-12-05 14:39:33.000000000 +0100
***************
*** 727,728 ****
--- 727,730 ----
  {   /* Add new patch number below this line */
+ /**/
+     745,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
97. Your mother tells you to remember something, and you look for
    a File/Save command.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///