Menu

#42 Filling empty line by spaces instead of TAB character

Next_Nightly
open
nobody
editor (11)
Undefined
2017-12-15
2014-09-02
ChronicRat
No

Editor settings:
Strip trailing blanks - ON
Use TAB character - ON
TAB indents - ON

When i do several indents and then i save the file, TAB characters stripped as expected. Caret position remains the same. Then i'm start typing and empty space filled by SPACE character instead of TAB.

3 Attachments

Discussion

  • ollydbg

    ollydbg - 2014-09-02

    You mean after typing some chars, the beginning TABs were translated to Spaces?
    I can't reproduce this bug on WinXP with the latest trunk version.

     
  • ChronicRat

    ChronicRat - 2014-09-02

    No, TABS been stripped when the file was saved. But caret hold position at 12, for example, column. Then you start typing - and space (without any symblos) filled by space characters.
    At pics:
    1) empty line containes three tab characters
    2) tab characters are stripped after saving, caret position - 12
    3) start typing from 12 column, free space filled by space characters

     
  • ollydbg

    ollydbg - 2014-09-03

    I understand you steps and reported issue. But what is the expected behavior? You still want the editor automatically add three TABs when you start typing from 12 column?

     
  • ChronicRat

    ChronicRat - 2014-09-03

    Exactly. Size of indent is known, it's set by user in settings. So, we need to insert (column position / size of indent) of tabs and (column position % size of indent) spaces.

     
  • ollydbg

    ollydbg - 2014-09-08

    Hi, ChronicRat, I fully understand your problem and your expect behavior. I'm thinking that if the file is saved(all the tailing spaces/tabs are removed), the caret in column 12 is not correct. As I can see, the caret should move left to the real tailing of the line.

    Any way, I'm not vary familiar with the wxScintilla control or the scintilla control(C::B use wxScintilla as its editor), maybe, you can get some help/direction from scintilla control site (there maillist).

     
  • ChronicRat

    ChronicRat - 2014-09-08

    Ok, thanks.

     
  • Morten MacFly

    Morten MacFly - 2015-02-07
    • Type: --> Undefined
     
  • bluehazzard

    bluehazzard - 2017-12-15

    One future note. If you move the carret with the arrow keys to the first col then you can not move the currsor back, so the white spaces are not here.

    This is still valid in the current trunk (17.xx rc)

     
  • bluehazzard

    bluehazzard - 2017-12-15

    A question:
    Is the intended behaviour to move the caret to the first column, or to fill the space with taps after you continue to write. The first (and i think the right behaviour) should easy be fixed in sdk/editor.cpp:143
    For the second i need to dive deeper into the code...

     
  • Teodor Petrov

    Teodor Petrov - 2017-12-15

    Fill the empty space with tabs. A move to the beginning will be annoying!

     

Log in to post a comment.