Author Topic: Del key conflict with TAB indent?  (Read 6511 times)

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Del key conflict with TAB indent?
« on: February 06, 2008, 05:38:30 am »

I have already set use TAB to indent my C code, but if I use DEL key the indent TAB become spaces.

if(p<=0) {
   dd;     <-- press Enter key next line will indent by TAB, it's ok
            <-- press Del key, next line will join up, then save. leading TAB become space! What's wrong?
cc;
}

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Del key conflict with TAB indent?
« Reply #1 on: February 06, 2008, 05:41:11 am »
This seems very simple feature, but really confuse me a couple of days till now. Anyone can teach me? Thanks a lot...

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Del key conflict with TAB indent?
« Reply #2 on: February 06, 2008, 07:19:15 am »
Hi Kenny,

Check your "Expand tabs to spaces" settings in the Load and Save tabs of File Options (Tools > Options > File Options).

There's also an "Indent with tabs" setting in the Indent tab of Extension Options (Tools > Options > File Extension Setup).

Regards

John Hurst
Wellington, New Zealand

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Del key conflict with TAB indent?
« Reply #3 on: February 06, 2008, 08:24:21 am »
Thanks your reply first. I have checked my setting:
"Expand tabs to spaces"  not checked
"Indent with tabs"       checked
So what's the matter?

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Del key conflict with TAB indent?
« Reply #4 on: February 06, 2008, 08:49:46 am »
I just first time trialed SlickEdit. Seems only Del cause this trouble, BTW
Tools > Options > Redefine Common Keys
"Treat leading spaces as tabs"  checked

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Del key conflict with TAB indent?
« Reply #5 on: February 06, 2008, 01:43:14 pm »
I'll have a closer look at the code, but it does look like the line is being padded with spaces instead of tabs there when deleting the line ending and the two lines are joined.  I'll see what I come up with.

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Del key conflict with TAB indent?
« Reply #6 on: February 13, 2008, 06:06:57 am »
So any info? It's the original design?

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Del key conflict with TAB indent?
« Reply #7 on: February 13, 2008, 09:58:11 am »
@Kenny: It's a bug. So there will be probably a hotfix for SE2007 (v12.0.3) and I'm sure it's solved in the next release SE2008 (v13.0.0) which is currently beta. HS2

KG

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Del key conflict with TAB indent?
« Reply #8 on: February 13, 2008, 10:13:19 am »
Thanks HS2.... ;D

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Del key conflict with TAB indent?
« Reply #9 on: February 14, 2008, 01:29:25 am »
@Kenny: This is a possible workaround for this issue:

<SE-install-dir>/macros/stdcmds.e - join_line() [line 3265]: (v12.0.3 r31)
Code: [Select]
      ...
      //current_line= current_line:+strip(line,'L')

      // HS2-ADD: workaround: maybe revert leading SPACEs (padded by _JoinLineToCursor) to TABS
      if ( p_indent_with_tabs && (p_col <= _first_non_blank_col()) ) {
         get_line( auto line );
         replace_line( indent_string(text_col(line,p_col,'I')-1) :+ substr(line,p_col) );
      }

      // strip the leading comment
      // designator
      if (joiningLineComment) {
      ...

In case you want to fix it yourself: Apply the patch and use 'Macro>Load Module: stdcmds.e'
Hint: Leave the 'Files' toolbar open/docked before loading the module.
Otherwise the columns (<filename>|<path>) get shrinked to 0 and the splitter is not longer visible too.
But it's possible to 'find' it and re-adjust the columns... Just another issue probably fixed in the next release ;)

HS2