diff options
author | pgen <p.gen.progs@gmail.com> | 2022-09-06 16:14:29 +0200 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2022-09-06 16:19:25 +0200 |
commit | 60c5b99b83f6b1d67e5828c3fd053ef79987f03b (patch) | |
tree | c4384aa25dec37c9382a1ef4ac5a102382a78fd8 | |
parent | 1082ebf1bb1d328dccffcb415f03226086f339d1 (diff) |
Add and improve comments
-rw-r--r-- | smenu.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -4451,9 +4451,10 @@ move_left(win_t * win, term_t * term, toggle_t * toggles, term, last_line, tmp_word, langinfo); } -/* ============================= */ -/* Shift the window to the left. */ -/* ============================= */ +/* ============================================ */ +/* Shift the content of the window to the left. */ +/* Stop if the cursor will stop to be visible. */ +/* ============================================ */ void shift_left(win_t * win, term_t * term, toggle_t * toggles, search_data_t * search_data, langinfo_t * langinfo, long * nl, @@ -4596,9 +4597,10 @@ move_right(win_t * win, term_t * term, toggle_t * toggles, term, last_line, tmp_word, langinfo); } -/* ============================== */ -/* Shift the window to the right. */ -/* ============================== */ +/* ============================================= */ +/* Shift content of the the window to the right. */ +/* Stop if the cursor will stop to be visible. */ +/* ============================================= */ void shift_right(win_t * win, term_t * term, toggle_t * toggles, search_data_t * search_data, langinfo_t * langinfo, long * nl, @@ -4649,6 +4651,8 @@ shift_right(win_t * win, term_t * term, toggle_t * toggles, if (pos < count - 1 && word_a[pos + 1].start > 0) pos++; + /* Make sure the word under the cursor remains visible. */ + /* """""""""""""""""""""""""""""""""""""""""""""""""""" */ if (word_a[pos].start <= word_a[current].start) win->first_column = word_a[pos].start; else |