Git Product home page Git Product logo

tabsanity-vs's Introduction

TabSanity Visual Studio Extension

This project is no longer actively maintained.

This package causes the Visual Studio text editor to treat tabs-as-spaces as if they were actually tabs. That is, the backspace and delete keys, arrow key navigation will not allow the caret to land within the spaces that form a tab.

Installing

This package works with Visual Studio 2015 and 2017. The easiest way to install the package is with Visual Studio's built-in extension manager. Go to Tools | Extensions and Updates... | Online | Visual Studio Gallery and search for TabSanity. You can also find it on the Visual Studio Marketplace website.

For Visual Studio 2013, please download and install TabSanity.vsix. Thanks @FlipB!

Building

  1. Install the Visual Studio SDK.
  2. Open the solution file TabSanity.sln in Visual Studio 2017.
  3. Look in TabSanity/Bin/(Debug|Release)/TabSanity.vsix and double-click to install.

Dependencies

Though not "technically" required, EditorConfig has been added as a required dependency to this extension. This is to ensure any .editorconfig files are picked up and applied before assuming the document's tab settings. TabSanity, though completely decoupled from EditorConfig, is designed to listen for changes in the text editor options and adjust accordingly, just as EditorConfig does.

Reporting problems

At this time, feel free to contact Jed Mao directly. See humans.txt file for contact information.

tabsanity-vs's People

Contributors

dessix avatar drwestco avatar flipb avatar jedmao avatar jednano avatar joelspadin avatar mikekov avatar pragmatrix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tabsanity-vs's Issues

shift+end and shift+home in multi line editing ub

while multiline select using shift+end if cursor is above start point, or shift+home if cursor below start point, the cursor move base on start point position not the current blinking cursor position

disable the 2 keybindings is the expected behavior.

vscode 1.28.2
tabsanity 0.0.11

Questions about intended behaviors

I've noticed a couple behaviors that don't quite match what would happen if I were using tabs instead of spaces-pretending-to-be-tabs. Are these intended? (Assume the little squares are spaces and tabs are 4 spaces.)

  1. "Tabs" inside of code aren't always treated as such with respect to arrow keys. Adding or removing certain characters, like commas and parenthesis seems to change this behavior per-line. With the CaretIsWithinCodeRange code in ArrowKeyFilter, it looks like you're trying to treat any space with code on either side of it as a space?
static some_struct const my_table_of_stuff[] =
{ +- Definitely a tab. Arrows step through 4 spaces at a time.
  v /*  field_1,    field_2,    field_3 */
▪▪▪▪{   0,          1,          2       },
    {▪▪▪3,      ▪▪▪▪4,          5       }
};    ^          ^
      |          +- Probably a tab.
      +- Maybe a tab?
  1. Groups of spaces smaller than a tab are still treated like tabs:
▪▪▪▪abc /* Arrows step through the "tab" as expected. */
▪▪▪abc  /* Not a full "tab", but arrows still skip through it. The right boundary doesn't
           fall on a tab stop, so you can't make this happen with tabs. */
a▪▪▪bc  /* Should arrows skip through this? This can be done with tabs. */
a▪▪     /* Arrows skip through the two spaces as if it were a tab.
           Neither side of this lands on tab stop, so treating it like a tab feels weird. */ 

To really make groups of spaces act like tabs, it seems to me that the following rules for when a group of spaces should be treated as a tab should work:

  1. A group of spaces is a full tab wide and both ends lands on a tab stop (either end could be checked, since if one lands on a tab stop, the other necessarily will), OR
  2. A group of spaces is smaller than one tab wide, >= 2 spaces wide, and its right end lands on a tab stop.

Release 1.0.2 not woring on VS 2017

Hello.

The latest release (1.0.2) is not working in VS 2017 for me, nothing is reported, it just doesn't do its job anymore. After I cloned repo and opened it I managed to compile it by myself and after installing it from VSIX package manually it works again. But it required a changes to many referenced Microsoft.VisualStudio.* assemblies: I turned off "Specific Version" flag or else it cannot find and build package. So, probably this change is also required to support both VS 2017 and VS 2019 versions (if it's planned), or else on VS 2017 it references more new assemblies and cannot work?

Suggestion: Add a note to readme.md that this extension is no longer actively maintained

Unless you read any of the issues where you've noted it, there's no indication on the readme page that this extension is no longer actively maintained.

Adding a note to readme.md could achieve two things:

  • developers can now make an informed decision on whether to install the extension
  • you may get someone who puts their hand up to maintain the code

HTH

VS 15 Preview Support

VS 15 will be coming out soon, and it would be nice to have this extension available.

Some operations take 2 undos

As noted in #6

Replacing virtual spaces with real ones causes some backspace operations
to take two undos. This could probably be improved.

Should respect "Virtual spaces" setting

When the "virtual spaces" setting is enabled, TabSanity should not change the caret position when it is already after the last character in the current line. Currently TabSanity and virtual spaces cannot be used at the same time.

VS 2013

Hello, I was very happy to find your extension but so sad when I tried to use it in VS 2013.
I simply can't, because it requires the 2015 version.
I tried to build it from your sources and the 2013 sln file. I even installed the 2013 SDK but I can'tg manage to build it.
Could you please compile a version of the 2013 variation?

Question about usage

I like the idea of this extension, and it seems to work on lines that contain spaces.

If other text precedes spaces, then it has problems - a backspace only goes back a single space.

I am using Visual Studio 2015.

Weird behavior with backspace/delete on new line

When pressing backspace on a new line which Visual Studio has auto-indented, the entire newline is removed and the cursor jumps forward to the beginning of the next line. If you press delete under the same circumstances, the cursor jumps to the start of the line.

For example, given the following Python code and with the cursor located at the | character:

class Foo:
    def __init__(self):
        self.var1 = 1|
        self.var2 = 2

Press Enter once to create a new line:

class Foo:
    def __init__(self):
        self.var1 = 1
        |
        self.var2 = 2

Now press backspace once. Instead of deleting a single tab, you get this:

class Foo:
    def __init__(self):
        self.var1 = 1
|       self.var2 = 2

...instead of this:

class Foo:
    def __init__(self):
        self.var1 = 1
    |
        self.var2 = 2

If you repeat the first two steps but press Delete instead of Backspace, you get this:

class Foo:
    def __init__(self):
        self.var1 = 1
|
        self.var2 = 2

...instead of this:

class Foo:
    def __init__(self):
        self.var1 = 1
        |       self.var2 = 2

This occurs regardless of whether the indentation settings for the current language are set to tabs or spaces, and it happens for other languages such as C as well. If you change anything on the new line before pressing backspace or delete, everything works as expected. When Visual Studio auto-indents a new line, it doesn't seem to actually insert the tabs/spaces to indent the line until you start typing on the line, which is probably messing with your code in some way.

Interferes with key up and key down

In the immediate window and powershell window (I presume others) when I press the up arrow my cursor moves up a line rather than cycle through the previous input. This is very inconvenient.

TabSanity overwrites VS 2017 tab size setting

In Visual Studio 2017 (tested on Professional v15.2 26430.6) TabSanity v1.0.1 overrides the tab size setting as configured in the code editor settings.

Regardless of the original tab size setting, after installing TabSanity, the editor will behave as if tab size was set to 2 spaces. The original setting will, however, still be displayed in Visual Studio's text editor options. It has to be set to some different value in order to be respected again.

For example, my usual setting is a tab size of 4. When tabbing on a new line, the caret jumps to columns 5, 9, 13, and so on. After installing TabSanity and restarting Visual Studio, the caret will jump to columns 3, 5, 7, etc., even if the tab size setting in the options dialogue still shows a 4. If I want to restore the setting, I have to set the value to some different number, confirm the options dialogue, then open it again, set my value of 4, and confirm again.

Support for Visual Studio 2019 (preview?)

Thank you for this wonderful plugin. I have started using Visual Studio 2019 Preview at work (it seems mostly stable), and this is the plugin that I miss the most. It would be great to see this updated to support VS2019 when possible.

Visual Studio 2022

Hi, I am really sad you don't support the project any more, it is one of my favorite extensions and the only reason I can work fine with spaces for indentation (instead of tabs).

In case the extension is still compatible with VS2022, it would be really nice if you publish an update to the marketplace.

Thanks for the awesome work!

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.