bugGNU Octave - Bugs: bug #41554, GUI Editor could offer auto/smart...

 
 

bug #41554: GUI Editor could offer auto/smart indentation

Submitter:  Felipe G. Nievinski <fgnievinski>
Submitted:  Tue 11 Feb 2014 06:20:56 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 01 Aug 2015 10:49:30 AM UTC, comment #5: 

I have pushed an improved patch with changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/046904b54dc4

Torsten Lilge <ttl>
Group Member
Tue 28 Jul 2015 05:07:43 AM UTC, comment #4: 

I have attached a patch that implements a first version of "smart" indentation (in addition to scintilla's auto indentation) for testing.

(file #34546)

Torsten Lilge <ttl>
Group Member
Fri 24 Jul 2015 06:16:46 AM UTC, comment #3: 

Bug #45534 marked as duplicate of this bug. Original comment from Tim:

In the editor if you type 'for' followed by the enter key, it won't indent the caret one level like you'd expect.

It should ideally indent the caret, and also out-dent when you type a block-finishing keyword like 'end'. That is what the Matlab editor does and it works very well.


Torsten Lilge <ttl>
Group Member
Tue 11 Feb 2014 06:59:18 PM UTC, comment #2: 

setAutoIndent () is already used and there is a user preference in the settings dialog for it. The only effect that this has is that a the following line is indented like the actual line when hitting return. Automatically Indenting lines after an if-statement or in similar case is obviously not supported by the lexer provided by qscintilla.

I have tested with geany (which is also using scintilla) with same results.

Torsten Lilge <ttl>
Group Member
Tue 11 Feb 2014 06:22:25 PM UTC, comment #1: 

looks like it's mostly okay; only a minor tweak is necessary:


if cond1
  if cond2
  endif
  endif


after hitting enter at the end of the second endif, it should be de-indented one level.

Felipe G. Nievinski <fgnievinski>
Tue 11 Feb 2014 06:20:56 PM UTC, original submission:  
Felipe G. Nievinski <fgnievinski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34546:  bug41554_v1.patch added by ttl (3KiB - text/x-diff)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by fgnievinski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-12 mtmiller Open/ClosedOpen Closed
    2015-09-12 mtmiller StatusReady For Test Fixed
    2015-08-01 ttl StatusNone Ready For Test
        Release4.0.0 dev
    2015-07-28 ttl Attached File- Added bug41554_v1.patch, #34546
    2015-07-24 ttl Release3.8.0 4.0.0
    2015-07-24 ttl Dependencies- bugs #45534 is dependent

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code