1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Makes /clear behavior configurable.

This commit is contained in:
Spiridonov Alexander 2016-11-07 03:26:15 +03:00
parent 0d6aef68e7
commit fd2346ccb4
No known key found for this signature in database
GPG Key ID: AC9873E078F58E92
3 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

@ -562,6 +562,11 @@ win_sub_page_up(ProfWin *window)
void void
win_clear(ProfWin *window) win_clear(ProfWin *window)
{ {
if (!prefs_get_boolean(PREF_CLEAR_PERSIST_HISTORY)) {
werase(window->layout->win);
return;
}
int y = getcury(window->layout->win); int y = getcury(window->layout->win);
int *page_start = &(window->layout->y_pos); int *page_start = &(window->layout->y_pos);
*page_start = y; *page_start = y;