Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.51k stars 173 forks source link

Differ plugin, get out of the difference, back to my files #4469

Closed ags1234 closed 2 years ago

ags1234 commented 2 years ago

After setting two files to compare, and checking out the differences, I want to get out of the difference, back to my files. I notice that Cudatext closed my individual file tabs and opened a new single tab. It is not okay, the right behavior would be to leave user-opened tabs as they are and open another tab for Differ.

Alexey-T commented 2 years ago

if we do like you suggest, user won't be able to edit original file in the diff pair-tab. it is also needed.

Alexey-T commented 2 years ago

After setting two files to compare, and checking out the differences, I want to get out of the difference, back to my files.

then just close the Differ pair-tab, and reopen file(s) via "File / Open recent".

ags1234 commented 2 years ago

Hm... then a better solution could be that when the user closes the tab opened by Differ, the files are reopened in their tabs, as they were before Differ.

Alexey-T commented 2 years ago

the files are reopened in their tabs, as they were before Differ.

hard to track that state - 'files opened before Differ'. because Differ may be called w/o tabs at all and user may choose 2 files in the file-chooser-dialog.

Alexey-T commented 2 years ago

also it is hard because ui-tab may be closed in different ways ('file / close all', X icon click, 'close other tabs', opening session).

ags1234 commented 2 years ago

Then maybe a menu option in Plugins > Differ, called 'Close comparison' could restore user files in their tabs?

Alexey-T commented 2 years ago

this command will be easy to add, ok. but if files were opened in specific 'tab groups' and specific indexes, this command won't know it.

ags1234 commented 2 years ago

Could be the first option in the menu, if the comparison is active, for easy access? Or if not, associate a key combination to it?

Alexey-T commented 2 years ago

why it must be 'first command'? it will be usual command. one of many.

Alexey-T commented 2 years ago

hotkey of course can be assigned, like for all commands.

Alexey-T commented 2 years ago

CudaExt plugin: It has the new command: "Close pair-tab, reopen 2 separate files". I want it in CudaExt , not in the Differ, coz it is useful for other users too.

Install CudaExt from my fork https://github.com/alexey-T/cuda_ext (menu "Plugins / addons manager / install from Git") or wait until it is updated in addons manager.

veksha commented 2 years ago

Could be the first option in the menu, if the comparison is active, for easy access?

@ags1234 meant in right click menu? (of tab?) where these items are already present: "compare with" "compare with tab"

ags1234 commented 2 years ago

@Alexey-T, thank you, I'll check it out.

@veksha could be that, yes.

Probably the most elegant solution would be to integrate the text comparison function in CudaText, in a separate menu with all the necessary options, like in EmEditor. Or it could be implemented very cool, at drag-and-drop, like in PSPad, also built-in.

Cuda wants to be an advanced text editor. File comparison is an advanced function, so it should be part of Cuda and not externalized in plugins.

Alexey-T commented 2 years ago

Probably the most elegant solution would be to integrate the text comparison function

Nope, I dont agree - we have several cool plugins like that, and so we need to integrate them? no. plugins are cool as separate things!

Reason 2. I don't know Differ code. cannot support it good!

ags1234 commented 2 years ago

Reason 2. I don't know Differ code. cannot support it good!

A good argument for implementing file comparison in Cuda. To know what's under the hood and to properly integrate this useful function.

Also as a completely different subject, please know that I also used SynWrite, and for me as a simple user, it was more advanced than Cuda is. And more pleasant to work with. I'm sorry that development stopped.

Alexey-T commented 2 years ago

If you like Synwrite,- suggest something to Cud from Syn. In new issues. Not here. But not the GUI to configure the app

ags1234 commented 2 years ago

But not the GUI to configure the app

Funny, that's exactly what I was going to request. You must have had a lot of requests for this :)

Alexey-T commented 2 years ago

I can add this GUI only via 3rd party plugin (which can do all GUI stuff).

ags1234 commented 2 years ago

Hm... Also with a lexer editor as complete and useful as SynEdit has? :))

Alexey-T commented 2 years ago

Nope, lexer editor is a long future task for me.

Alexey-T commented 2 years ago

Command was just integrated to CudaExt (it is updated in addons).