+29
-2
lines changedFilter options
+29
-2
lines changed Original file line number Diff line number Diff line change
@@ -5857,11 +5857,11 @@ void win_drag_status_line(win_T *dragwin, int offset)
5857
5857
} else { // drag down
5858
5858
up = false;
5859
5859
// Only dragging the last status line can reduce p_ch.
5860
-
room = Rows - cmdline_row - global_stl_height();
5860
+
room = Rows - cmdline_row;
5861
5861
if (curfr->fr_next == NULL) {
5862
5862
room -= 1;
5863
5863
} else {
5864
-
room -= p_ch;
5864
+
room -= p_ch + global_stl_height();
5865
5865
}
5866
5866
if (room < 0) {
5867
5867
room = 0;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1
1
local helpers = require('test.functional.helpers')(after_each)
2
2
local Screen = require('test.functional.ui.screen')
3
3
local clear, command, feed = helpers.clear, helpers.command, helpers.feed
4
+
local eq, funcs, meths = helpers.eq, helpers.funcs, helpers.meths
4
5
5
6
describe('global statusline', function()
6
7
local screen
@@ -230,4 +231,30 @@ describe('global statusline', function()
230
231
[3] = {reverse = true, bold = true};
231
232
}}
232
233
end)
234
+
235
+
it('win_move_statusline() can reduce cmdheight to 1', function()
236
+
eq(1, meths.get_option('cmdheight'))
237
+
funcs.win_move_statusline(0, -1)
238
+
eq(2, meths.get_option('cmdheight'))
239
+
funcs.win_move_statusline(0, -1)
240
+
eq(3, meths.get_option('cmdheight'))
241
+
funcs.win_move_statusline(0, 1)
242
+
eq(2, meths.get_option('cmdheight'))
243
+
funcs.win_move_statusline(0, 1)
244
+
eq(1, meths.get_option('cmdheight'))
245
+
end)
246
+
247
+
it('mouse dragging can reduce cmdheight to 1', function()
248
+
command('set mouse=a')
249
+
meths.input_mouse('left', 'press', '', 0, 14, 10)
250
+
eq(1, meths.get_option('cmdheight'))
251
+
meths.input_mouse('left', 'drag', '', 0, 13, 10)
252
+
eq(2, meths.get_option('cmdheight'))
253
+
meths.input_mouse('left', 'drag', '', 0, 12, 10)
254
+
eq(3, meths.get_option('cmdheight'))
255
+
meths.input_mouse('left', 'drag', '', 0, 13, 10)
256
+
eq(2, meths.get_option('cmdheight'))
257
+
meths.input_mouse('left', 'drag', '', 0, 14, 10)
258
+
eq(1, meths.get_option('cmdheight'))
259
+
end)
233
260
end)
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