Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12204 closed enhancement (fixed)

Allow indenting/tabbing in the plugin/theme editors

Reported by: nacin's profile nacin Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Since the file editors aren't going anywhere, we should encourage those using it to at least write better(-looking) code by allowing them to easily intent said code.

Enter Tabby (http://plugins.jquery.com/project/TextareaTabs), a jQuery plugin that I've been testing locally and seems to work really well.

It allows for Tab and Shift-Tab (outdenting) and multi-line tabbing.

Patch coming.

Attachments (2)

12204.diff (12.6 KB) - added by nacin 15 years ago.
12204-2.patch (987 bytes) - added by azaozz 15 years ago.

Download all attachments as: .zip

Change History (8)

@nacin
15 years ago

#1 @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0

#2 @nacin
15 years ago

(In [13131]) Allow tab intents in plugin/theme editors. Utilizes the Tabby jQuery plugin, see #12204

#3 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#4 @azaozz
15 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Don't think we need yet another external JS file (and the maintenance/support that comes with it) just for typing tabs in textareas. Also this plugin doesn't add support for the tab key, it uses it as a one key shortcut to indent/outdent text blocks which is different from most text editors and unexpected for most users.

Pros:

  • somehow buggy support for tabs in textareas.

Cons:

  • yet another external file to maintain.
  • far too large at 10KB (the needed code is about 700 bytes).
  • buggy in IE6
  • sometimes adds empty lines and/or spaces

Think we will be better off with a small function that "types" tab in the themes and plugins editors textareas.

@azaozz
15 years ago

#5 @nacin
15 years ago

Thanks for the review, I've tested it a bit further and saw the flaws you mentioned. Jumped the gun a bit, my first thought was to assign it to you and I skipped that.

12204-2.patch looks good, tests fine. I'll revert [13131] and check that in tomorrow.

#6 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [13191]) Allow tab to intent in plugin/theme editors. Reverts first pass, [13131]. Props azaozz, fixes #12204

Note: See TracTickets for help on using tickets.