Coder Social home page Coder Social logo

Comments (4)

magiblot avatar magiblot commented on July 17, 2024

Hi @amay5267!

Although the aabb.cc file was written so that it looks good with indentation 4, it uses tab characters (ASCII 0x09) instead of space characters (ASCII 0x20).

Tab characters do not have a specific width. It depends on the text editor to display them as 2, 4, 8, etc. columns wide. Therefore, either the user has to tell the editor which indentation width should be used for tab characters, or the editor has to inspect the source code in order to guess the indentation it was written with.

Currently, Turbo does not allow you specify a width for tab characters (it's always 8), it does not allow you to indent text with tab characters (the Tab key always inserts spaces, with indentation 4), and it is unable to auto-detect indentation width. Furthermore, when you select text already indented with tab characters (such as in aabb.cc) and press Tab or Shift+Tab (in order to indent or unindent the selection), these tabs are replaced with spaces.

These are the things an ideal text editor would do but Turbo doesn't. Therefore, all problems related to tabs vs. spaces should be gone after implementing these missing features, but I can't promise anything with regards to this.

However, you mention Turbo converting tab characters into spaces when saving. This is not the behaviour I would expect, and it is not the behaviour I see in current master (05e6014). Thus, I ask you:

  • Please make sure you are using current master (05e6014) and not an older version of Turbo.
  • If you still experience the issue you described, please share a screen recording showing it.

Cheers.

from turbo.

amay5267 avatar amay5267 commented on July 17, 2024

Hi @magiblot

OK. If you open my aabb.cc sample you will see tabs represented by Right-Pointing Double Angle Quotation Mark.
Unicode Character “»” (U+00BB).
I think it is kind of annoying. No one needs that. How can I disable seeing this » ?

from turbo.

magiblot avatar magiblot commented on July 17, 2024

Hi @amay5267.

That symbol is there so that you can easily distinguish between spaces and tabs, and there are several other text editors which also have this feature (Kate, Midnight Commander, Tilde...).

I think this is especially relevant in Turbo since it currently doesn't support indenting text with anything other than spaces. Therefore, as I see it, it would be frustrating to mix spaces and tabs and not being able to see where tabs are. That's why this is the default.

But I absolutely agree that this behaviour should be customizable. However, customization is also not yet supported. Therefore, all you can do at the moment is to edit line 41 of source/turbo-core/tscintilla.cc like this:

-        reprs.SetRepresentation("\t", "»        ");
+        reprs.SetRepresentation("\t", "");

from turbo.

amay5267 avatar amay5267 commented on July 17, 2024

Thanks for the hint. Perfect!

from turbo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.