Skip to content

Commit

Permalink
Fix for wrapping of large string in preview mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nimitbhardwaj committed Apr 20, 2018
1 parent 1e7d5e8 commit f17729d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/nvim/ex_docmd.c
Expand Up @@ -568,14 +568,19 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
* from a script or when being called recursive (e.g. for ":e
* +command file").
*/
if (!(flags & DOCMD_NOWAIT) && !recursive) {
bool isPreview = (State & CMDPREVIEW) == 0 ? false : true;
if (!((flags & DOCMD_NOWAIT) || recursive) || isPreview) {
msg_didout_before_start = msg_didout;
msg_didany = FALSE; /* no output yet */
msg_didany = false; // no output yet
msg_start();
msg_scroll = TRUE; /* put messages below each other */
++no_wait_return; /* don't wait for return until finished */
++RedrawingDisabled;
did_inc = TRUE;
msg_scroll = true; // put messages below each other
if (!isPreview) {
// For execution of a preview command we have to wait for a return
// key, but we don't want the message for it pop out
no_wait_return++; // don't wait for return until finished
}
RedrawingDisabled++;
did_inc = true;
}
}

Expand Down
18 changes: 18 additions & 0 deletions test/functional/ui/inccommand_spec.lua
Expand Up @@ -1217,6 +1217,24 @@ describe("inccommand=nosplit", function()
]])
end)

it("don't wrap the text in cmdline in inccommand", function()
feed([[ggdG]])
insert('hello\nhello')
feed(':%s/hello/hellooooooooooooooooooooooooooooooo')
screen:expect([[
{12:helloooooooooooooooo}|
{12:ooooooooooooooo} |
{15:~ }|
{15:~ }|
{15:~ }|
{15:~ }|
{15:~ }|
:%s/hello/helloooooo|
oooooooooooooooooooo|
ooooo^ |
]])
end)

it("shows preview when cmd modifiers are present", function()
-- one modifier
feed(':keeppatterns %s/tw/to')
Expand Down

0 comments on commit f17729d

Please sign in to comment.