A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/e263afc0e972d11d3b9b663c3ac0b5575c4deb88 below:

escape control characters in Cmdline mode · neovim/neovim@e263afc · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+14

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+14

-1

lines changed Original file line number Diff line number Diff line change

@@ -175,7 +175,8 @@ do

175 175

if not got_line1 then

176 176

got_line1 = (#lines > 1)

177 177

vim.api.nvim_set_option('paste', true) -- For nvim_input().

178 -

local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub.

178 +

-- Escape "<" and control characters

179 +

local line1 = lines[1]:gsub('<', '<lt>'):gsub('(%c)', '\022%1')

179 180

vim.api.nvim_input(line1)

180 181

vim.api.nvim_set_option('paste', false)

181 182

end

Original file line number Diff line number Diff line change

@@ -1097,6 +1097,18 @@ describe('API', function()

1097 1097

:Foo^ |

1098 1098

]])

1099 1099

end)

1100 +

it('pasting text with control characters in Cmdline mode', function()

1101 +

local screen = Screen.new(20, 4)

1102 +

screen:attach()

1103 +

feed(':')

1104 +

nvim('paste', 'normal! \023\022\006\027', true, -1)

1105 +

screen:expect([[

1106 +

|

1107 +

~ |

1108 +

~ |

1109 +

:normal! ^W^V^F^[^ |

1110 +

]])

1111 +

end)

1100 1112

it('crlf=false does not break lines at CR, CRLF', function()

1101 1113

nvim('paste', 'line 1\r\n\r\rline 2\nline 3\rline 4\r', false, -1)

1102 1114

expect('line 1\r\n\r\rline 2\nline 3\rline 4\r')

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4