Mercurial > vim
comparison src/ex_getln.c @ 31410:f09c92cf3786 v9.0.1038
patch 9.0.1038: function name does not match what it is used for
Commit: https://github.com/vim/vim/commit/ffa4e9b43a3d6d7f412f54637a4b1076ed2bc2f4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri Dec 9 11:36:36 2022 +0000
patch 9.0.1038: function name does not match what it is used for
Problem: Function name does not match what it is used for.
Solution: Include the modifier in the name. (closes https://github.com/vim/vim/issues/11679)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 09 Dec 2022 12:45:04 +0100 |
parents | ff4473b3fc58 |
children | 742b7bf2fefc |
comparison
equal
deleted
inserted
replaced
31409:e9572de53c6d | 31410:f09c92cf3786 |
---|---|
796 { | 796 { |
797 CLEAR_FIELD(ccline); | 797 CLEAR_FIELD(ccline); |
798 } | 798 } |
799 | 799 |
800 /* | 800 /* |
801 * Handle the backslash key pressed in the command-line mode. CTRL-\ CTRL-N | 801 * Handle CTRL-\ pressed in Command-line mode: |
802 * goes to Normal mode, CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is | 802 * - CTRL-\ CTRL-N goes to Normal mode |
803 * set, CTRL-\ e prompts for an expression. | 803 * - CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is set |
804 * - CTRL-\ e prompts for an expression. | |
804 */ | 805 */ |
805 static int | 806 static int |
806 cmdline_handle_backslash_key(int c, int *gotesc) | 807 cmdline_handle_ctrl_bsl(int c, int *gotesc) |
807 { | 808 { |
808 ++no_mapping; | 809 ++no_mapping; |
809 ++allow_keys; | 810 ++allow_keys; |
810 c = plain_vgetc(); | 811 c = plain_vgetc(); |
811 --no_mapping; | 812 --no_mapping; |
830 char_u *p = NULL; | 831 char_u *p = NULL; |
831 int len; | 832 int len; |
832 | 833 |
833 /* | 834 /* |
834 * Replace the command line with the result of an expression. | 835 * Replace the command line with the result of an expression. |
835 * Need to save and restore the current command line, to be | 836 * This will call getcmdline() recursively in get_expr_register(). |
836 * able to enter a new one... | |
837 */ | 837 */ |
838 if (ccline.cmdpos == ccline.cmdlen) | 838 if (ccline.cmdpos == ccline.cmdlen) |
839 new_cmdpos = 99999; // keep it at the end | 839 new_cmdpos = 99999; // keep it at the end |
840 else | 840 else |
841 new_cmdpos = ccline.cmdpos; | 841 new_cmdpos = ccline.cmdpos; |
842 | 842 |
843 c = get_expr_register(); | 843 c = get_expr_register(); |
844 if (c == '=') | 844 if (c == '=') |
845 { | 845 { |
846 // Need to save and restore ccline. And set "textlock" | 846 // Evaluate the expression. Set "textlock" to avoid nasty things |
847 // to avoid nasty things like going to another buffer when | 847 // like going to another buffer. |
848 // evaluating an expression. | |
849 ++textlock; | 848 ++textlock; |
850 p = get_expr_line(); | 849 p = get_expr_line(); |
851 --textlock; | 850 --textlock; |
852 | 851 |
853 if (p != NULL) | 852 if (p != NULL) |
1907 | 1906 |
1908 // CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert | 1907 // CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert |
1909 // mode when 'insertmode' is set, CTRL-\ e prompts for an expression. | 1908 // mode when 'insertmode' is set, CTRL-\ e prompts for an expression. |
1910 if (c == Ctrl_BSL) | 1909 if (c == Ctrl_BSL) |
1911 { | 1910 { |
1912 res = cmdline_handle_backslash_key(c, &gotesc); | 1911 res = cmdline_handle_ctrl_bsl(c, &gotesc); |
1913 if (res == CMDLINE_CHANGED) | 1912 if (res == CMDLINE_CHANGED) |
1914 goto cmdline_changed; | 1913 goto cmdline_changed; |
1915 else if (res == CMDLINE_NOT_CHANGED) | 1914 else if (res == CMDLINE_NOT_CHANGED) |
1916 goto cmdline_not_changed; | 1915 goto cmdline_not_changed; |
1917 else if (res == GOTO_NORMAL_MODE) | 1916 else if (res == GOTO_NORMAL_MODE) |
1918 goto returncmd; // back to cmd mode | 1917 goto returncmd; // back to cmd mode |
1919 c = Ctrl_BSL; // backslash key not processed by | 1918 c = Ctrl_BSL; // backslash key not processed by |
1920 // cmdline_handle_backslash_key() | 1919 // cmdline_handle_ctrl_bsl() |
1921 } | 1920 } |
1922 | 1921 |
1923 if (c == cedit_key || c == K_CMDWIN) | 1922 if (c == cedit_key || c == K_CMDWIN) |
1924 { | 1923 { |
1925 // TODO: why is ex_normal_busy checked here? | 1924 // TODO: why is ex_normal_busy checked here? |