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

Indent / Outdent code #40

Closed
mogsdad opened this issue Feb 4, 2016 · 2 comments
Closed

Indent / Outdent code #40

mogsdad opened this issue Feb 4, 2016 · 2 comments

Comments

@mogsdad
Copy link
Contributor

mogsdad commented Feb 4, 2016

Script: Magic™ Editor
Issue type: Enhancement
Link to example post: below

For proper layout in lists, it's necessary to indent code cod by multiples of 4 spaces.

Example post: The original version of this question.


  1. Code Service Provider:

    class EloquentEventServiceProvider extends ServiceProvider
    {
    public function boot()
    {}

    public function register()
    {
        $this->app->bind('app\\Repositories\\EventRepository', 'app\\Repositories\\Eloquent\\EventEloquentRepository');
    }
    

    }


The code here has been indented 4 spaces by use of the "code" button in the default editor, however it needs to be indented 8 characters because it's within a numbered list.

It would be nice if Magic™ Editor let us select the code block and click a button to shift it right 4 more spaces.

(Migrated from old repository #92.)

@mogsdad
Copy link
Contributor Author

mogsdad commented Mar 10, 2016

Excellent Meta post regarding this functionality.

Having read that plus the comments, I think that MagicEditor should catch tab to indent, and shift-tab to outdent. This would be either in addition to or instead of GUI buttons.

Also... balpha published a script that modifies editor handling of tab for this purpose already.

mogsdad added a commit that referenced this issue Mar 16, 2016
mogsdad added a commit that referenced this issue Mar 17, 2016
Fix for 2 bugs. (1) single-line selections were getting deleted when Tab or Shift-Tab hit, and (2) Left-aligned selections expanded to include previous line when Shift-Tab hit.
See https://bitbucket.org/Mogsdad/se-tab-edting/commits/1dbafabedb5703250c75a09cbcaad47a05425ce9
mogsdad added a commit that referenced this issue Mar 17, 2016
Exclude trailing whitespace from selections, to behave like every programmer's editor in the world.

See https://bitbucket.org/Mogsdad/se-tab-edting/commits/f2ceb79ba8c8519f01ed1c0066c30b20193f72f5
mogsdad added a commit that referenced this issue Mar 17, 2016
Maintain mid-line selection when shifting text.

Refer to image illustrating issue: https://imgur.com/CiNsywl
@mogsdad
Copy link
Contributor Author

mogsdad commented Mar 18, 2016

Available in 1.5.2.64

@mogsdad mogsdad closed this as completed Mar 18, 2016
@mogsdad mogsdad assigned mogsdad and unassigned Tiny-Giant Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants