Page 2 of 2

Re: Find/Replace History Never Clears

Posted: 17.01.2026 09:27
by main Alexey
c- do other editors (VScode, ST4, Kate, etc) save find/replace lists to a separate file?

Re: Find/Replace History Never Clears

Posted: 17.01.2026 23:56
by Random Void User
I already use -s=folder switch on launch. It's not enough. Let me show the current layout:

Code: Select all

$ cd cudatext/settings
$ ls -1 --color=never *hist*
cmd_history.txt
history.json
plugin history.json

$ ls -1 --color=never *sess*
default.cuda-session
default__linux.cuda-session

$ grep --ignore-case --color=never "hist" user.json
  "ui_max_history_edits": 50,
  "ui_max_history_menu": 30,
  "ui_max_history_files": 0,
  "ui_max_history_clipboard": 15,
  "ui_history_disabled": "tchTseblwMmrunSfCFiIU",
Layout lacks consistency. Some history items get a dedicated file (cmd_history.txt, sessions), others merge in history.json, and formats/extensions differ (*.txt vs *.json vs *.cuda-session).

Notice history.json mostly concerns (a) recent files and (b) find/replace. These stanzas I would assign dedicated files.

Make a "history" subfolder in Cud settings folder. Put all history files inside to get something like:

Code: Select all

$ cd ../..
$ ls -1 --color=never cudatext/settings/history/
cudatext/settings/history/commands.json
cudatext/settings/history/dialog_layouts.json
cudatext/settings/history/find_replace_text.json
cudatext/settings/history/miscellany.json
cudatext/settings/history/plugins.json
cudatext/settings/history/recent_files.json
cudatext/settings/history/session.json
...etc.
This layout makes wiping all history simple: delete the "history" subfolder. And "miscellany.json" replaces "history.json" for items not meriting stand-alone files.

This layout can simplify plug-ins. One to manipulate recent files need only change one file, not touching others, or risk corrupting a common one.

Prefs in user.json could relocate the "history" subfolder, or any contained file. I might move "history" to tmpfs. I might move "find_replace_text.json" alone. I might do both! Cud would expand environment vars dynamically. My user.json could say:

Code: Select all

history_folder="${TMP}/cudahist"
history_find_replace_text_file="${MY_SHELL_VAR}/another_name.json"
It moves the "history" subfolder and a specific file. So that file would live outside the "history" subfolder. Cud would create the history_folder if it did not exist, likewise the history_find_replace_text_file file.

That's the idea, thanks!

Re: Find/Replace History Never Clears

Posted: 18.01.2026 08:00
by main Alexey
cmd_history.txt is not by Cud. not mine.
'plugin history.json' is not by Cud. it is saved by plugin(s), AFAIR by Kvichans' plugins, maybe.

make separate subdir? for 3 files:
- history common items
- history recent files
- history find/replace
?
no, too big change. I suggest this: I move find/replace/console/recents to file "history lists.json". no subdirs. I am not sure 'recents' needs separate file, so find/rep/recents will go into single file.