Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-wrap/split lines at margin... vs. Align paragraphs #195

Open
dimon40001 opened this issue May 21, 2022 · 8 comments
Open

Re-wrap/split lines at margin... vs. Align paragraphs #195

dimon40001 opened this issue May 21, 2022 · 8 comments

Comments

@dimon40001
Copy link

I would like to have an option to reformat blocks of text keeping the indentation of the first line using the shortcut.

Align paragraphs can not be used, because it takes preconfigure values from the Configure... dialog. And it has to be reconfigured each time for each new indentation.

Re-wrap/split lines at margin... provides the necessary behavior, thought each time it opens the modal dialog asking for the Margin size and the comment sign.

Would it be possible to improve the behavior of Re-wrap/split lines at margin... to not using the modal dialog window?

Currently I refactored the plugin code a bit to add an additional hard-coded value of 120 characters for the right margin.

additional menu item

@Alexey-T
Copy link
Collaborator

120 is arbitrary number. Why not 100, 140?

@Alexey-T
Copy link
Collaborator

I added the patch in my fork https://github.com/Alexey-T/cuda_ext
branch 'patch-2'
Pls check it

@dimon40001
Copy link
Author

120 is arbitrary number. Why not 100, 140?

Correct, 120 is arbitrary and was used just as an illustration. The best option would be to have a configuration dialog and the command to apply with currently configured settings. In a similar way as it works with Paragraphs functionality.

@Alexey-T
Copy link
Collaborator

Alexey-T commented May 22, 2022

separate config dialog for CudaExt? not a good idea. sorry. in my fork I did that command uses Cud's option "margin" which you can set to 120 in "Plugins / OpTions Editor". but plugin limits it by 160.

@dimon40001
Copy link
Author

dimon40001 commented May 22, 2022

branch 'patch-2'
Pls check it

Thank you. Formatting logic works well.
I would suggest to take the "default" value not from the Cuda interface-scope option "margin" but from the Re-wrap/split lines at margin... dialog. So the dialog already exists.
In such way the "previously" used value for right margin will be used as the "default" for Re-wrap/split lines at margin, with defaults

@Alexey-T
Copy link
Collaborator

Alexey-T commented May 22, 2022

that would need to add saving/loading of entered value in that dialog... not sure its ok. why "margin" is bad?

@dimon40001
Copy link
Author

As I understand the margin is displayed also as thin vertical line in the editor.

So if one needs to format several paragraphs with several different margins - he would have to go to the settings dialog each time.

As an alternative this setting could be read from the Paragraph > Align: Configure... dialog. Where 3 options can be configured separately specifically for Paragraph commands:

  • Paragraph right margin (this value can also be used for Re-wrap... with defaults)
  • Indent of first line
  • Indent of other lines

@Alexey-T
Copy link
Collaborator

this setting could be read from the Paragraph > Align: Configure... dialog.

done as suggested!
Updated my fork in 'patch-2' branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants