Created
July 9, 2019 17:33
-
-
Save lawlist/84ffdde85880c0ddb158e909792840fc to your computer and use it in GitHub Desktop.
Feature request 16475.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* *************************************************************************** */ | |
/* BEGIN Feature Request # 16475: Automatically add/remove scroll bars. */ | |
finish_scroll_bars: | |
; | |
// ptrdiff_t bob_disregard_narrow = BUF_BEG (buffer); | |
ptrdiff_t eob_disregard_narrow = BUF_Z (buffer); | |
ptrdiff_t bob_respect_narrow = BUF_BEGV (buffer); | |
ptrdiff_t eob_respect_narrow = BUF_ZV (buffer); | |
ptrdiff_t window_start = marker_position (w->start); | |
ptrdiff_t window_end = eob_disregard_narrow - w->window_end_pos; | |
// ptrdiff_t buffer_size = eob_disregard_narrow - bob_disregard_narrow; | |
// bool buffer_narrowed_p = (eob_respect_narrow - bob_respect_narrow != buffer_size); | |
bool window_contents_visible_p = (bob_respect_narrow == window_start | |
&& eob_respect_narrow == window_end); | |
if (!window_contents_visible_p) | |
w->vertical_scroll_bar_type = Qright; | |
if (!window_contents_visible_p | |
&& (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) | |
|| WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))) | |
{ | |
if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) | |
/* Set the thumb's position and size. */ | |
set_vertical_scroll_bar (w); | |
if (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)) | |
/* Set the thumb's position and size. */ | |
set_horizontal_scroll_bar (w); | |
/* Note that we actually used the scroll bar attached to this | |
window, so it shouldn't be deleted at the end of redisplay. */ | |
if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook) | |
(*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); | |
} | |
else if (!MINI_WINDOW_P (w) | |
&& !NILP (w->vertical_scroll_bar_type)) | |
{ | |
w->vertical_scroll_bar_type = Qnil; | |
clear_glyph_matrix (w->desired_matrix); | |
SET_FRAME_GARBAGED (f); | |
} | |
/* END Feature Request # 16475: Automatically add/remove scroll bars. */ | |
/* *************************************************************************** */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment