Browse Groups

• Patch 6.1.440 Problem: The @* command doesn t obtain the actual contents of the clipboard. (Hari Krishna Dara) Solution: Obtain the clipboard text
Message 1 of 1 , Apr 6, 2003
View Source
Patch 6.1.440
Problem: The "@*" command doesn't obtain the actual contents of the
clipboard. (Hari Krishna Dara)
Solution: Obtain the clipboard text before executing the command.
Files: src/ops.c

*** ../vim61.439/src/ops.c Sun Mar 23 21:06:00 2003
--- src/ops.c Thu Apr 3 22:05:00 2003
***************
*** 1036,1041 ****
--- 1036,1070 ----
return OK;
}

+ #ifdef FEAT_CLIPBOARD
+ /*
+ * When "regname" is a clipboard register, obtain the selection. If it's not
+ * available return zero, otherwise return "regname".
+ */
+ static int may_get_selection __ARGS((int regname));
+
+ static int
+ may_get_selection(regname)
+ int regname;
+ {
+ if (regname == '*')
+ {
+ if (!clip_star.available)
+ regname = 0;
+ else
+ clip_get_selection(&clip_star);
+ }
+ else if (regname == '+')
+ {
+ if (!clip_plus.available)
+ regname = 0;
+ else
+ clip_get_selection(&clip_plus);
+ }
+ return regname;
+ }
+ #endif
+
/*
* execute a yank register: copy it into the stuff buffer
*
***************
*** 1060,1065 ****
--- 1089,1098 ----
return FAIL;
lastc = regname;

+ #ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+ #endif
+
if (regname == '_') /* black hole: don't stuff anything */
return OK;

***************
*** 1176,1195 ****
return FAIL;

#ifdef FEAT_CLIPBOARD
! if (regname == '*')
! {
! if (!clip_star.available)
! regname = 0;
! else
! clip_get_selection(&clip_star);
! }
! else if (regname == '+')
! {
! if (!clip_plus.available)
! regname = 0;
! else
! clip_get_selection(&clip_plus);
! }
#endif

if (regname == '.') /* insert last inserted text */
--- 1209,1215 ----
return FAIL;

#ifdef FEAT_CLIPBOARD
! regname = may_get_selection(regname);
#endif

if (regname == '.') /* insert last inserted text */
***************
*** 1380,1399 ****
return FAIL;

#ifdef FEAT_CLIPBOARD
! if (regname == '*')
! {
! if (!clip_star.available)
! regname = 0;
! else
! clip_get_selection(&clip_star);
! }
! else if (regname == '+')
! {
! if (!clip_plus.available)
! regname = 0;
! else
! clip_get_selection(&clip_plus);
! }
#endif

if (get_spec_reg(regname, &arg, &allocated, TRUE))
--- 1400,1406 ----
return FAIL;

#ifdef FEAT_CLIPBOARD
! regname = may_get_selection(regname);
#endif

if (get_spec_reg(regname, &arg, &allocated, TRUE))
***************
*** 2951,2960 ****
#ifdef FEAT_CLIPBOARD
/* Adjust register name for "unnamed" in 'clipboard'. */
! if (regname == '*')
! clip_get_selection(&clip_star);
! else if (regname == '+')
! clip_get_selection(&clip_plus);
#endif

if (flags & PUT_FIXINDENT)
--- 2958,2964 ----
#ifdef FEAT_CLIPBOARD
/* Adjust register name for "unnamed" in 'clipboard'. */
! (void)may_get_selection(regname);
#endif

if (flags & PUT_FIXINDENT)
***************
*** 5283,5302 ****
return NULL;

#ifdef FEAT_CLIPBOARD
! if (regname == '*')
! {
! if (!clip_star.available)
! regname = 0;
! else
! clip_get_selection(&clip_star); /* may fill * register */
! }
! else if (regname == '+')
! {
! if (!clip_plus.available)
! regname = 0;
! else
! clip_get_selection(&clip_plus); /* may fill + register */
! }
#endif

if (get_spec_reg(regname, &retval, &allocated, FALSE))
--- 5287,5293 ----
return NULL;

#ifdef FEAT_CLIPBOARD
! regname = may_get_selection(regname);
#endif

if (get_spec_reg(regname, &retval, &allocated, FALSE))
*** ../vim61.439/src/version.c Sun Apr 6 14:41:10 2003
--- src/version.c Sun Apr 6 14:42:34 2003
***************
*** 613,614 ****
--- 613,616 ----
{ /* Add new patch number below this line */
+ /**/
+ 440,
/**/

--
Q: What do you call a fish without an eye?
A: fsh!
Q: What do you call a deer with no eyes?
A: no eye deer.
Q: What do you call a deer with no eyes and no legs?
A: still no eye deer.

/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
Your message has been successfully submitted and would be delivered to recipients shortly.
• Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
• Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer. We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.