diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-02-19 14:20:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-19 14:20:52 +0100 |
commit | 22337b1c014433fef957c6078d4b11dd44852246 (patch) | |
tree | f0a8862c6d5fa7f6828c568d6e58855b3b9a0fe2 /src/nvim/ops.c | |
parent | b0bbe82a60ea65e94d6fd4fdc2a13b45aa457973 (diff) | |
parent | baab49ee89a927f63bfefdb432155a1037afa93a (diff) | |
download | rneovim-22337b1c014433fef957c6078d4b11dd44852246.tar.gz rneovim-22337b1c014433fef957c6078d4b11dd44852246.tar.bz2 rneovim-22337b1c014433fef957c6078d4b11dd44852246.zip |
Merge #6137 from justinmk/cmdline-ctrl-r
cmdline: CTRL-R: Omit trailing ^M character
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index d58c8700ca..8bfda3c193 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1260,7 +1260,7 @@ int get_spec_reg( /// Paste a yank register into the command line. /// Only for non-special registers. -/// Used by CTRL-R command in command-line mode +/// Used by CTRL-R in command-line mode. /// insert_reg() can't be used here, because special characters from the /// register contents will be interpreted as commands. /// @@ -1278,9 +1278,8 @@ bool cmdline_paste_reg(int regname, bool literally, bool remcr) for (size_t i = 0; i < reg->y_size; i++) { cmdline_paste_str(reg->y_array[i], literally); - // Insert ^M between lines and after last line if type is kMTLineWise. - // Don't do this when "remcr" is true. - if ((reg->y_type == kMTLineWise || i < reg->y_size - 1) && !remcr) { + // Insert ^M between lines, unless `remcr` is true. + if (i < reg->y_size - 1 && !remcr) { cmdline_paste_str((char_u *)"\r", literally); } |