comparison src/ex_getln.c @ 634:1c586ee8dd45 v7.0183

updated for version 7.0183
author vimboss
date Fri, 20 Jan 2006 23:10:18 +0000
parents b6632d553df3
children a39b8af64334
comparison
equal deleted inserted replaced
633:7437be625546 634:1c586ee8dd45
659 save_cmdline(&save_ccline); 659 save_cmdline(&save_ccline);
660 c = get_expr_register(); 660 c = get_expr_register();
661 restore_cmdline(&save_ccline); 661 restore_cmdline(&save_ccline);
662 if (c == '=') 662 if (c == '=')
663 { 663 {
664 /* Need to save and restore ccline. And set cmdline_busy 664 /* Need to save and restore ccline. And set "textlock"
665 * to avoid nasty things like going to another buffer when 665 * to avoid nasty things like going to another buffer when
666 * evaluating an expression. */ 666 * evaluating an expression. */
667 save_cmdline(&save_ccline); 667 save_cmdline(&save_ccline);
668 ++cmdline_busy; 668 ++textlock;
669 p = get_expr_line(); 669 p = get_expr_line();
670 --cmdline_busy; 670 --textlock;
671 restore_cmdline(&save_ccline); 671 restore_cmdline(&save_ccline);
672 672
673 if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) 673 if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK)
674 { 674 {
675 ccline.cmdlen = STRLEN(p); 675 ccline.cmdlen = STRLEN(p);
1873 return s; 1873 return s;
1874 } 1874 }
1875 #endif 1875 #endif
1876 1876
1877 /* 1877 /*
1878 * Return TRUE when the command line is being edited. That means the current 1878 * Return TRUE when the text must not be changed and we can't switch to
1879 * buffer and window can't be changed. 1879 * another window or buffer. Used when editing the command line, evaluating
1880 * 'balloonexpr', etc.
1880 */ 1881 */
1881 int 1882 int
1882 editing_cmdline() 1883 text_locked()
1883 { 1884 {
1884 #ifdef FEAT_CMDWIN 1885 #ifdef FEAT_CMDWIN
1885 if (cmdwin_type != 0) 1886 if (cmdwin_type != 0)
1886 return TRUE; 1887 return TRUE;
1887 #endif 1888 #endif
1888 return cmdline_busy; 1889 return textlock != 0;
1889 } 1890 }
1890 1891
1891 /* 1892 /*
1892 * Give an error message for a command that isn't allowed while the cmdline 1893 * Give an error message for a command that isn't allowed while the cmdline
1893 * window is open or editing the cmdline in another way. 1894 * window is open or editing the cmdline in another way.
1894 */ 1895 */
1895 void 1896 void
1896 editing_cmdline_msg() 1897 text_locked_msg()
1897 { 1898 {
1898 #ifdef FEAT_CMDWIN 1899 #ifdef FEAT_CMDWIN
1899 if (cmdwin_type != 0) 1900 if (cmdwin_type != 0)
1900 EMSG(_(e_cmdwin)); 1901 EMSG(_(e_cmdwin));
1901 else 1902 else
2812 2813
2813 #ifdef FEAT_CLIPBOARD 2814 #ifdef FEAT_CLIPBOARD
2814 regname = may_get_selection(regname); 2815 regname = may_get_selection(regname);
2815 #endif 2816 #endif
2816 2817
2817 /* Need to save and restore ccline. And set cmdline_busy to avoid nasty 2818 /* Need to save and restore ccline. And set "textlock" to avoid nasty
2818 * things like going to another buffer when evaluating an expression. */ 2819 * things like going to another buffer when evaluating an expression. */
2819 save_cmdline(&save_ccline); 2820 save_cmdline(&save_ccline);
2820 ++cmdline_busy; 2821 ++textlock;
2821 i = get_spec_reg(regname, &arg, &allocated, TRUE); 2822 i = get_spec_reg(regname, &arg, &allocated, TRUE);
2822 --cmdline_busy; 2823 --textlock;
2823 restore_cmdline(&save_ccline); 2824 restore_cmdline(&save_ccline);
2824 2825
2825 if (i) 2826 if (i)
2826 { 2827 {
2827 /* Got the value of a special register in "arg". */ 2828 /* Got the value of a special register in "arg". */
3835 if (context == EXPAND_BUFFERS && fname[i] == '.') 3836 if (context == EXPAND_BUFFERS && fname[i] == '.')
3836 new_len++; /* "." becomes "\." */ 3837 new_len++; /* "." becomes "\." */
3837 3838
3838 /* Custom expansion takes care of special things, match 3839 /* Custom expansion takes care of special things, match
3839 * backslashes literally (perhaps also for other types?) */ 3840 * backslashes literally (perhaps also for other types?) */
3840 if ((context == EXPAND_USER_DEFINED || 3841 if ((context == EXPAND_USER_DEFINED
3841 context == EXPAND_USER_LIST) && fname[i] == '\\') 3842 || context == EXPAND_USER_LIST) && fname[i] == '\\')
3842 new_len++; /* '\' becomes "\\" */ 3843 new_len++; /* '\' becomes "\\" */
3843 } 3844 }
3844 retval = alloc(new_len); 3845 retval = alloc(new_len);
3845 if (retval != NULL) 3846 if (retval != NULL)
3846 { 3847 {