#151 Backspace and indentation

Next Release
closed
None
5
2016-05-12
2013-05-22
No

If I use "Use spaces instead of tabs" in Preferences > Perl EPIC > Editor, and set "Insert tabs/spaces on indent: 4", then pressing the Tab key inserts 4 spaces but pressing the Backspace key when the cursor sits to the right of 4 spaces does not remove all 4 of them: it removes only one of them. I know this has always been the normal behaviour in Eclipse and that Eclipse users are used to it but this is definitively not the behaviour in text editors that Perl coders are most likely used to (vim, emacs, etc).

So, could we have an option that makes the Backspace key do the reverse of the Tab key the user has expresses his preference for tabs as spaces?

Discussion

  • Jan Ploski

    Jan Ploski - 2013-05-22

    Ticket moved from /p/e-p-i-c/bugs/659/

     
  • Jan Ploski

    Jan Ploski - 2013-05-22

    Implemented in 0.6.50.

    To activate the new behavior, you will have to perform these steps:
    1. Add a key binding from backspace to action "Delete Previous" under Preferences > Keys (by default there is NO binding).
    2. Set Preferences > Perl EPIC > Editor > Insert tabs/spaces on indent to the desired indent size.
    3. Set Preferences > Perl EPIC > Editor > Use spaces instead of tabs

    The full behavior of vim is not emulated because I don't understand nor like it much (sometimes backspace deletes an indent, but sometimes it doesn't, apparently the caret position and text are not the only inputs).

     
  • Jan Ploski

    Jan Ploski - 2013-05-22
    • status: open --> closed
    • assigned_to: Jan Ploski
    • Group: v0.6.x --> Next Release (example)
     
  • Jan Ploski

    Jan Ploski - 2013-05-22

    A few more notes: (1) the backspace binding for "Preferences > Keys" needs When = "In Windows" (2) after installing this binding you need to reopen any Perl editors to make it apply.

     
  • Luc J. Bourhis

    Luc J. Bourhis - 2013-05-24

    Thank you very much for your efforts. Your update is to be in 0.6.50 (the latest), is it? Otherwise it does work: with When="In Windows", the backspace does not work anymore.

     
    • Jan Ploski

      Jan Ploski - 2013-05-24

      Yes, it's in 0.6.50 (you can upgrade to it). I haven't checked what effect adding this key binding might have in earlier versions.

       
  • Luc J. Bourhis

    Luc J. Bourhis - 2013-05-24

    On 24 May 2013, at 12:07, Jan Ploski wrote:

    Yes, it's in 0.6.50 (you can upgrade to it). I haven't checked what effect adding this key binding might have in earlier versions.

    Ok, just upgraded to 0.6.50 but same problem: with When="In Windows", the backspace key does not work anymore. I'm using Eclipse 4.2.2 on MacOS 7.5 if it matters.

    Best wishes,

    Luc

     
    • Luc J. Bourhis

      Luc J. Bourhis - 2013-05-24

      On 24 May 2013, at 12:13, Luc Bourhis wrote:

      On 24 May 2013, at 12:07, Jan Ploski wrote:

      Yes, it's in 0.6.50 (you can upgrade to it). I haven't checked what effect adding this key binding might have in earlier versions.

      Ok, just upgraded to 0.6.50 but same problem: with When="In Windows", the backspace key does not work anymore. I'm using Eclipse 4.2.2 on MacOS 7.5 if it matters.

      Ok, after closing everything, removing the binding and adding it again, it now works. Sorry for the noise and thank you very much again for your fix!!

      Best wishes,

      Luc

       
    • Jan Ploski

      Jan Ploski - 2013-05-24

      I tested it in 3.6.2 / Linux. Maybe it's also worth trying other values of "When"... It's hard to tell which one applies under which circumstances.

      EPIC removes the default function of backspace whenever it detects that "Delete Previous" has any key binding, which is the immediate cause why the key stops working. However, it should be also receiving a separate notification through the key binding system instead, which implements the new functionality, but which is apparently not delievered in your case.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks