Skip to content

Commit

Permalink
Add a preference to disable handling line changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oakkitten committed Dec 24, 2024
1 parent 577710f commit 81f6833
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ object BufferList {
}

add("_buffer_line_data_changed") { obj, _ ->
if (!P.handleBufferLineDataChanged) return@add

obj.forEach { entry ->
val spec = LineSpec(entry)
findByPointer(spec.bufferPointer)?.let { buffer ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ public static void applyThemeAfterActivityCreation(AppCompatActivity activity) {
static long pingIdleTime, pingTimeout;
public static int lineIncrement;
public static int searchLineIncrement;
public static boolean handleBufferLineDataChanged;

static String printableHost;
static boolean connectionSurelyPossibleWithCurrentPreferences;
Expand Down Expand Up @@ -275,6 +276,7 @@ public static void applyThemeAfterActivityCreation(AppCompatActivity activity) {

lineIncrement = Integer.parseInt(getString(PREF_LINE_INCREMENT, PREF_LINE_INCREMENT_D));
searchLineIncrement = Integer.parseInt(getString(PREF_SEARCH_LINE_INCREMENT, PREF_SEARCH_LINE_INCREMENT_D));
handleBufferLineDataChanged = p.getBoolean(PREF_HANDLE_BUFFER_LINE_DATA_CHANGED, PREF_HANDLE_BUFFER_LINE_DATA_CHANGED_D);

reconnect = p.getBoolean(PREF_RECONNECT, PREF_RECONNECT_D);
optimizeTraffic = p.getBoolean(PREF_OPTIMIZE_TRAFFIC, PREF_OPTIMIZE_TRAFFIC_D);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class Constants {
final public static String PREF_LINE_INCREMENT_D = "300";
final static public String PREF_SEARCH_LINE_INCREMENT = "line_number_to_request_when_starting_search";
final static public String PREF_SEARCH_LINE_INCREMENT_D = "4097";
final static public String PREF_HANDLE_BUFFER_LINE_DATA_CHANGED = "handle_buffer_line_data_changed";
final static public Boolean PREF_HANDLE_BUFFER_LINE_DATA_CHANGED_D = true;
final static public String PREF_RECONNECT = "reconnect";
final public static boolean PREF_RECONNECT_D = true;
final static public String PREF_BOOT_CONNECT = "boot_connect";
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@
Also note that due to WeeChat’s limitations
the app has to re-fetch all lines every times it requests more lines.</string>

<string name="pref__connection__synchronization__handle_buffer_line_data_changed">
Handle line changes</string>
<string name="pref__connection__synchronization__handle_buffer_line_data_changed_summary">
In rare circumstances displaying line changes may lead to jerky animation</string>

<!-- ############################## connection: miscellaneous ############################## -->

<string name="pref__connection__misc_group">Miscellaneous</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
android:summary="@string/pref__connection__synchronization_help"
android:persistent="false"
android:selectable="false" />
<CheckBoxPreference
android:key="handle_buffer_line_data_changed"
android:title="@string/pref__connection__synchronization__handle_buffer_line_data_changed"
android:summary="@string/pref__connection__synchronization__handle_buffer_line_data_changed_summary"
android:defaultValue="true" />
</PreferenceScreen>
</PreferenceCategory>

Expand Down

0 comments on commit 81f6833

Please sign in to comment.