mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
99429e5f41
@ -1409,8 +1409,13 @@ static void win_update(win_T *wp)
|
|||||||
if (wp->w_p_rnu) {
|
if (wp->w_p_rnu) {
|
||||||
// 'relativenumber' set: The text doesn't need to be drawn, but
|
// 'relativenumber' set: The text doesn't need to be drawn, but
|
||||||
// the number column nearly always does.
|
// the number column nearly always does.
|
||||||
|
fold_count = foldedCount(wp, lnum, &win_foldinfo);
|
||||||
|
if (fold_count != 0) {
|
||||||
|
fold_line(wp, fold_count, &win_foldinfo, lnum, row);
|
||||||
|
} else {
|
||||||
(void)win_line(wp, lnum, srow, wp->w_grid.Rows, true, true);
|
(void)win_line(wp, lnum, srow, wp->w_grid.Rows, true, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This line does not need to be drawn, advance to the next one.
|
// This line does not need to be drawn, advance to the next one.
|
||||||
row += wp->w_lines[idx++].wl_size;
|
row += wp->w_lines[idx++].wl_size;
|
||||||
|
@ -704,6 +704,26 @@ func Test_fold_last_line_with_pagedown()
|
|||||||
enew!
|
enew!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_folds_with_rnu()
|
||||||
|
if !CanRunVimInTerminal()
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call writefile([
|
||||||
|
\ 'set fdm=marker rnu foldcolumn=2',
|
||||||
|
\ 'call setline(1, ["{{{1", "nline 1", "{{{1", "line 2"])',
|
||||||
|
\ ], 'Xtest_folds_with_rnu')
|
||||||
|
let buf = RunVimInTerminal('-S Xtest_folds_with_rnu', {})
|
||||||
|
|
||||||
|
call VerifyScreenDump(buf, 'Test_folds_with_rnu_01', {})
|
||||||
|
call term_sendkeys(buf, "j")
|
||||||
|
call VerifyScreenDump(buf, 'Test_folds_with_rnu_02', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('Xtest_folds_with_rnu')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_folds_marker_in_comment2()
|
func Test_folds_marker_in_comment2()
|
||||||
new
|
new
|
||||||
call setline(1, ['Lorem ipsum dolor sit', 'Lorem ipsum dolor sit', 'Lorem ipsum dolor sit'])
|
call setline(1, ['Lorem ipsum dolor sit', 'Lorem ipsum dolor sit', 'Lorem ipsum dolor sit'])
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
|
local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
|
||||||
|
local command = helpers.command
|
||||||
local feed_command = helpers.feed_command
|
local feed_command = helpers.feed_command
|
||||||
local insert = helpers.insert
|
local insert = helpers.insert
|
||||||
|
local funcs = helpers.funcs
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
|
|
||||||
describe("folded lines", function()
|
describe("folded lines", function()
|
||||||
@ -26,6 +28,26 @@ describe("folded lines", function()
|
|||||||
screen:detach()
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("highlighting with relative line numbers", function()
|
||||||
|
command("set relativenumber foldmethod=marker")
|
||||||
|
feed_command("set foldcolumn=2")
|
||||||
|
funcs.setline(1, '{{{1')
|
||||||
|
funcs.setline(2, 'line 1')
|
||||||
|
funcs.setline(3, '{{{1')
|
||||||
|
funcs.setline(4, 'line 2')
|
||||||
|
feed("j")
|
||||||
|
screen:expect([[
|
||||||
|
{7:+ }{5: 1 +-- 2 lines: ·························}|
|
||||||
|
{7:+ }{5: 0 ^+-- 2 lines: ·························}|
|
||||||
|
{7: }{1:~ }|
|
||||||
|
{7: }{1:~ }|
|
||||||
|
{7: }{1:~ }|
|
||||||
|
{7: }{1:~ }|
|
||||||
|
{7: }{1:~ }|
|
||||||
|
:set foldcolumn=2 |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it("works with multibyte text", function()
|
it("works with multibyte text", function()
|
||||||
-- Currently the only allowed value of 'maxcombine'
|
-- Currently the only allowed value of 'maxcombine'
|
||||||
eq(6, meths.get_option('maxcombine'))
|
eq(6, meths.get_option('maxcombine'))
|
||||||
|
Loading…
Reference in New Issue
Block a user