1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Merge pull request #874 from spiridoncha/master

Change /clear behaviour. Closes issue #855.
This commit is contained in:
Michael Vetter 2019-10-05 15:12:44 +02:00 committed by GitHub
commit d7c00360ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -1646,6 +1646,7 @@ _get_group(preference_t pref)
{
switch (pref)
{
case PREF_CLEAR_PERSIST_HISTORY:
case PREF_SPLASH:
case PREF_BEEP:
case PREF_THEME:
@ -1773,6 +1774,8 @@ _get_key(preference_t pref)
{
switch (pref)
{
case PREF_CLEAR_PERSIST_HISTORY:
return "clear.persist_history";
case PREF_SPLASH:
return "splash";
case PREF_BEEP:

View File

@ -46,6 +46,7 @@
// represents all settings in .profrc
// each enum value is mapped to a group and key in .profrc (see preferences.c)
typedef enum {
PREF_CLEAR_PERSIST_HISTORY,
PREF_SPLASH,
PREF_BEEP,
PREF_VERCHECK,

View File

@ -620,7 +620,15 @@ win_sub_page_up(ProfWin *window)
void
win_clear(ProfWin *window)
{
werase(window->layout->win);
if (!prefs_get_boolean(PREF_CLEAR_PERSIST_HISTORY)) {
werase(window->layout->win);
return;
}
int y = getcury(window->layout->win);
int *page_start = &(window->layout->y_pos);
*page_start = y;
window->layout->paged = 1;
win_update_virtual(window);
}