Remove "include newlines" checkbox from context formatting settings

a18dae8f69d245b468e5d760334cf60d1c31bf93

Cohee <18619528+Cohee1207@users.noreply.github.com>

32 files changed, +2 -57Showing whitespace changes
default/content/presets/context/Adventure.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": true,
1110 "name": "Adventure"
1211}
default/content/presets/context/Alpaca-Roleplay.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Alpaca-Roleplay"
1211}
default/content/presets/context/Alpaca-Single-Turn.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Alpaca-Single-Turn"
1211}
default/content/presets/context/Alpaca.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Alpaca"
1211}
default/content/presets/context/ChatML-Names.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "ChatML-Names"
1211}
default/content/presets/context/ChatML.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "ChatML"
1211}
default/content/presets/context/Command R.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Command R"
1211}
default/content/presets/context/Default.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Default"
1211}
default/content/presets/context/DreamGen Role-Play V1 ChatML.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": true,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "DreamGen Role-Play V1 ChatML"
1211}
default/content/presets/context/DreamGen Role-Play V1 Llama3.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": true,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "DreamGen Role-Play V1 Llama3"
1211}
default/content/presets/context/Gemma 2.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Gemma 2"
1211}
default/content/presets/context/Libra-32B.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Libra-32B"
1211}
default/content/presets/context/Lightning 1.1.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Lightning 1.1"
1211}
default/content/presets/context/Llama 2 Chat.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama 2 Chat"
1211}
default/content/presets/context/Llama 3 Instruct.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama 3 Instruct"
1211}
default/content/presets/context/Llama-3-Instruct-Names.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama-3-Instruct-Names"
1211}
default/content/presets/context/Minimalist.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Minimalist"
1211}
default/content/presets/context/Mistral V1.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V1"
1211}
default/content/presets/context/Mistral V2 & V3.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V2 & V3"
1211}
default/content/presets/context/Mistral V3-Tekken.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V3-Tekken"
1211}
default/content/presets/context/NovelAI.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "NovelAI"
1211}
default/content/presets/context/OldDefault.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "OldDefault"
1211}
default/content/presets/context/Phi.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Phi"
1211}
default/content/presets/context/Pygmalion.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Pygmalion"
1211}
default/content/presets/context/Story.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Story"
1211}
default/content/presets/context/Synthia.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Synthia"
1211}
default/content/presets/context/simple-proxy-for-tavern.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "simple-proxy-for-tavern"
1211}
default/content/settings.json+0 -1
@@ -90,7 +90,6 @@
9090 "pin_examples": false,
9191 "strip_examples": false,
9292 "trim_sentences": false,
93- "include_newline": false,
9493 "always_force_name2": true,
9594 "user_prompt_bias": "",
9695 "show_user_prompt_bias": true,
public/index.html+0 -5
@@ -3251,11 +3251,6 @@
32513251 Trim Incomplete Sentences
32523252 </small>
32533253 </label>
3254- <!-- Add margin since this is a child of above -->
3255- <label class="checkbox_label indent20p" for="include_newline_checkbox">
3256- <input id="include_newline_checkbox" type="checkbox" />
3257- <small data-i18n="Include Newline">Include Newline</small>
3258- </label>
32593254 <label class="checkbox_label" title="Add Chat Start and Example Separator to a list of stopping strings." data-i18n="[title]Add Chat Start and Example Separator to a list of stopping strings.">
32603255 <input id="context_use_stop_strings" type="checkbox" />
32613256 <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small>
public/script.js+1 -1
@@ -5480,7 +5480,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
54805480 }
54815481
54825482 if (!displayIncompleteSentences && power_user.trim_sentences) {
54835483 getMessage = trimToEndSentence(getMessage, power_user.include_newline);
54845484 }
54855485
54865486 if (power_user.trim_spaces) {
public/scripts/power-user.js+0 -16
@@ -114,7 +114,6 @@ let power_user = {
114114 pin_examples: false,
115115 strip_examples: false,
116116 trim_sentences: false,
117- include_newline: false,
118117 always_force_name2: false,
119118 user_prompt_bias: '',
120119 show_user_prompt_bias: true,
@@ -317,7 +316,6 @@ const contextControls = [
317316 // Existing power user settings
318317 { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true },
319318 { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
320- { id: 'include_newline_checkbox', property: 'include_newline', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
321319 { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
322320];
323321
@@ -1487,7 +1485,6 @@ async function loadPowerUserSettings(settings, data) {
14871485 $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines);
14881486 $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2);
14891487 $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences);
1490- $('#include_newline_checkbox').prop('checked', power_user.include_newline);
14911488 $('#render_formulas').prop('checked', power_user.render_formulas);
14921489 $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming);
14931490 $('#markdown_escape_strings').val(power_user.markdown_escape_strings);
@@ -3069,19 +3066,6 @@ $(document).ready(() => {
30693066 // if trim sentences is unchecked, include newline must be unchecked
30703067 $('#trim_sentences_checkbox').change(function () {
30713068 power_user.trim_sentences = !!$(this).prop('checked');
3072- if (!$(this).prop('checked')) {
3073- $('#include_newline_checkbox').prop('checked', false);
3074- power_user.include_newline = false;
3075- }
3076- saveSettingsDebounced();
3077- });
3078-
3079- $('#include_newline_checkbox').change(function () {
3080- power_user.include_newline = !!$(this).prop('checked');
3081- if ($(this).prop('checked')) {
3082- $('#trim_sentences_checkbox').prop('checked', true);
3083- power_user.trim_sentences = true;
3084- }
30853069 saveSettingsDebounced();
30863070 });
30873071
public/scripts/utils.js+1 -7
@@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) {
607607/**
608608 * Trims a string to the end of a nearest sentence.
609609 * @param {string} input The string to trim.
610- * @param {boolean} include_newline Whether to include a newline character in the trimmed string.
611610 * @returns {string} The trimmed string.
612611 * @example
613612 * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'
614613 */
615614export function trimToEndSentence(input, include_newline = false) {
616615 if (!input) {
617616 return '';
618617 }
@@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) {
633632 }
634633 break;
635634 }
636-
637- if (include_newline && char === '\n') {
638- last = i;
639- break;
640- }
641635 }
642636
643637 if (last === -1) {