summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2022-09-06 16:14:29 +0200
committerpgen <p.gen.progs@gmail.com>2022-09-06 16:19:25 +0200
commit60c5b99b83f6b1d67e5828c3fd053ef79987f03b (patch)
treec4384aa25dec37c9382a1ef4ac5a102382a78fd8
parent1082ebf1bb1d328dccffcb415f03226086f339d1 (diff)
Add and improve comments
-rw-r--r--smenu.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/smenu.c b/smenu.c
index a1ced49..26595a5 100644
--- a/smenu.c
+++ b/smenu.c
@@ -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