Some questions on CudaText

main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

different code? it is here already. Command Palette has 2 commands:
"dialog: find"
"dialog: replace"
When you add toolbar buttons, use these codes
sl23
Posts: 175
Joined: 29.01.2013 10:04

Post by sl23 »

I have done. I mostly use the Replace dialogue, so I changed the toolbar button to use the Replace command. But it keeps reverting to the Find dialogue for some reason.

Every time I click the toolbar button, it only ever opens the Find dialogue and I cannot seem to get it to only open the Replace dialogue. :(

I'll double check later, but I believe the ID code for both the Find and Replace dialogues are the same? Hence my request for them to have different ID codes.
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

No, not the same ids. In the file py/cudatext_cmd.py you see 2 codes:
cmd_DialogFind = 2584
cmd_DialogReplace = 2585
I cannot repeat this issue, ie if I call "dialog: replace" from Cmd Palette I always get Replace dlg. Pls post here your 'settings' folder in zip. I will try to see

PS. or send me 'settings' to support(at)uvviewsoft.com
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

My toolbar with 2 buttons for 'dialog: find' and 'dialog: replace'.
Works OK.
File settings/cuda_config_toolbar.json

Code: Select all

{
  "icon_set": "",
  "sub": [
    {
      "cap": "fnd",
      "hint": "",
      "cmd": "2584",
      "icon": "",
      "lexers": ""
    },
    {
      "cap": "rpl",
      "hint": "",
      "cmd": "2585",
      "icon": "",
      "lexers": ""
    }
  ],
  "dir_icons": "",
  "hide": ""
}
sl23
Posts: 175
Joined: 29.01.2013 10:04

Post by sl23 »

I've just checked and the two ID codes are indeed different:
Find Button ID:
Image 001.png
Replace Button ID:
Image 002.png
But I'm getting odd behaviour. The Replace button seems to work now, strangely, maybe because I added a new button instead of changing the Find one??

The Replace button shows the Replace dialogue, but won't hide it. Whereas the Find hides it and reshows the Replace dialogue instead of the Find dialogue.

I'll email my setup and maybe you can take a look at it. You may want to check out the Toolbar icon issue from long ago.

To recap... I have added several icons to the Toolbar using the Config Toolbar Plugin, but this has affected the Standard buttons icons. Load my setup and you will see that the icns to the right of the Undo/Redo are for "Toggle Minimap" and "Options Editor." But the icons are not changeable and do not match the functions.

I haven't tried the fresh install yet as I've been satisfied with SynWrite until recently due to major errors in the undo system.

How would I reinstate my settings, theme and UI colours into a new installation? I realise the settings could be the issue, but I would still need to know how to reinstate them.
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

You used for the 1st command this code
cmd_ToggleFindDialog = 2538
which is only toggling of dialog! Instead of this code, use command code 'dialog: find'.
cmd_DialogFind = 2584
change it in the button properties.
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

The Replace button shows the Replace dialogue, but won't hide it
Yes, this command only shows the dialog. To hide the dialog, you 'll need 3rd button with the command
'hide dialog: find' or this: 'toggle find/replace dialog' (in Command Palette).
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

How would I reinstate my settings, theme and UI colours into a new installation?
Settings are in folder 'settings'.
Theme + UI colors are in the 'data/themes' folder, if you did saving of custom theme.
See also:
https://wiki.freepascal.org/CudaText#Lo ... .27data.27
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Post by main Alexey »

In the beta, http://uvviewsoft.com/c/
I improved situation with find/repl commands.

* change: renamed command "ui: toggle find dialog" to "dialog: find: toggle dialog", also changed logic of this command a little
+ add: added command "dialog: replace: toggle dialog" (thanks @sl23)

Now we have 5 commands for find/replace
dialog: find: show
dialog: find: hide
dialog: find: toggle
dialog: replace: show
dialog: replace: toggle

Pls change you toolbar according to new cmds.
sl23
Posts: 175
Joined: 29.01.2013 10:04

Post by sl23 »

Thanks Alexey, that works great.
Just a small suggestion, maybe you could add the ability to switch between Find and Replace in the right hand menu button of the Find/Replace dialogue?

Either way, it's a great improvement as is, so thank you.
Live for an ideal and leave no place in the mind for anything else.
Post Reply