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

Auto indent feature add #562

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

AMB2800
Copy link

@AMB2800 AMB2800 commented Mar 9, 2021

Summary of the changes in this pull request

Added feature to enable auto indent in editor.

  • Checkbox added to preferences.
  • when enabled, text will auto indent to match previous line
  • when disabled, new lines will not automatically indent
  • TODO

Pull request checklist

  • I have added an entry in CHANGELOG.md including my name and issue and/or pull request number.
  • If applicable: I have removed the corresponding entry in TODO.md.

Copy link
Owner

@jendrikseipp jendrikseipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think this makes for a nice new feature!

@@ -53,6 +53,7 @@ class Config(dict):
"leftDividerPosition": 260,
"rightDividerPosition": None,
"cloudMaxTags": 1000,
"autoindent": 1,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use "autoIndent" here and auto_indent in the rest of the code, please?

if self.journal.config.read("autoindent") == 1:
self.day_text_field.day_text_view.set_auto_indent(True)
else:
self.day_text_field.day_text_view.set_auto_indent(False)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's shorten this a bit:

def set_auto_indent(self):
    auto_indent = self.journal.config.read("autoindent") == 1
    self.day_text_field.day_text_view.set_auto_indent(auto_indent)

@@ -1,6 +1,7 @@
# Unreleased
* Add a "Give Feedback" button (#551, Rahul Jha).
* Test code on macOS (#552, Rahul Jha).
* added feature to auto-indent text in editor (#561, Allen Benter)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add option to auto-indent text (#561, Allen Benter).

rednotebook/configuration.py Show resolved Hide resolved
@jendrikseipp
Copy link
Owner

This feature has been requested also in issue #561. It would be cool if we could merge this PR. Do you have the time to make the changes I suggested?

@AMB2800
Copy link
Author

AMB2800 commented Jan 9, 2023 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants