I am having a problem with visual studio not displaying line numbers despite having checked "Line numbers" in Tools -> Options. I have included a pic with proof, and all the solutions I have found don't answer this. How can I enable line number, despite already having enabled it?
http://imgur.com/7cmfqcZ
You don't have it enabled for all languages - the square means that it's enabled for some languages, but obviously not the one you care about.
Just click the check box twice - the first will remove it for all languages, the second will select it for all languages.
The blue box in the checkbox for line numbering in the All Languages group means that line numbering is language-dependent.
Either put a tick there (to enable line numbering for all languages), or in the C/C++ - specific line numbering option (to enable line numbering for C/C++).
Related
I am fairly new to Xcode and I am wondering if there is a way to link two separate lines such as if I have a do while loop I can 1. see which line it is associated with 2. see which 'do' line number is associated with which 'while' line number. I know this is a subjective question and maybe not fitting for this kind of platform, however I'm unsure where to ask it. I'd appreciate the help though.
This is built into Xcode. In properties, turn on the "Code folding ribbon" in the "Text Editing" pane:
This lets you see immediately what lines of code are part of a block, or collapse sections so you can focus on the structure. Look at the Editor menu, under "Code Folding" for options and keystrokes.
I hope this is okay to ask on SO, I'm not sure. I apologize if it shouldn't be here.
I reinstalled Visual Studio Professional 2015 yesterday due to a few issues I was having. With the new installation, my line numbers have a very wide section where the mouse reverses direction and select the entire line if clicked. I don't recall this area being so wide on any of my previous installations of VS2015; I know it was there in the first place. Is there a way to disable this?
This is the area where this happens, boxed in green. It's much wider than the line numbers fill (only 147 lines in this file).
There are two "margins" available in Visual Studio 2015: Selection and Indicator available under Tools > Options > Text Editor > General > Display. Turning these off remove some, but not all of the "extra space" and the feature of highlighting an entire line is still there.
If you want to turn them off because the extra space is bothersome, keep in mind you will not be able to see breakpoints unless "highlight current line" is checked.
I've been using vs2013 for quite some time and noticed something that is quite bothering me.
In the Code Editor, lines that contain nothing but symbols (such as '{', '/' '*' etc..) have a different line‑height / font‑size than other lines that also contain letters.
I search through the settings and couldn't find a way to turn this behavior off.
My question is if there's a way to turn this behavior off, and have consistent line heights throughout my entire code.
You probably have Productivity Power Tools installed with Syntactic line compression enabled. You can turn it off in VS Options - Productivity Power Tools - Other Extensions.
For the VS2019 it is quite similar to the provided solutions:
Tools -> Options-> Productiviry Power Tools -> General
Under "Syntatic line compression options"
you uncheck:
"Compress lines that does not have any alphanumeric characters" like {,[ and so on
You also can uncheck
"Compress blank lines" but this will be only for lines without anything in it.
In Eclipse, there are two distinct features: one to format a selection, one to just indent the lines, see e.g. Difference between Ctrl+Shift+F and Ctrl+I in Eclipse. I found the format feature in Visual Studio but how can I actually just indent the lines? Is there some built-in command for that or possibly a 3rd party add-on?
Note: I have asked a couple of friend that use VS daily and they all tried to persuade me that I am looking for the format feature. No I'm not. I tried to live with it for a while and it is just a different feature. I am after the indent/reindent only.
EDIT: I am looking for a clever indent, sometimes called reindent, which is different to just pressing Tab or Shift+Tab (increase/decrease indent level). The indent feature in Eclipse behaves like this:
It places a beginning of current line at the right position, no matter where that line was starting before. So instead of thinking whether you need to increase or descrease the indent level (Tab or Shift+Tab), you just invoke the indent command and it will do the right thing.
Invoking the indent command on an empty line places the caret at the right position for the user to start typing.
It never influences any character beyond the first non-whitespace character.
If you just want to indent some lines, you can
Select them.
Press Tab.
To un-indent them, replace the second step to: Shift+Tab.
You can find more VS shortcuts here.
There are toolbar buttons for this, with wonderfully inconsistent labels (at least in the Visual Studio 2013 I'm using)...
In the "Text Editor" toolbar (in my default setup), I have to buttons whose tooltips are:
"Decrease Line Indent"
"Increase Line Indent"
In the "Customize" dialog, on the "Commands" tab (with "Toolbar" set to "Text Editor") they appear in the list as:
"Line Unindent"
"Line Indent"
And finally, if you press the "Add Command..." button (on the "Customize" dialog) to produce the "Add Command" dialog and select the "Edit" category, you'll see these two entries:
"Outdent"
"Indent"
As far as I can tell, these are all the same two commands, which should do what you want.
They also appear in the Edit -> Advanced menu, at the very bottom.
----- Edit -----
I believe you might be able to turn off all of the "formatting" actions except for indentation, so that when you use the "auto-format" command, only the indentation is "formatted" for you. (Of course this prevents you from ever using the rest of the formatting features without turning them on again, but if you don't use them, this might work!)
Situation
I have a plain text file where indentation is important.
line 1
line 1.1 (indented two spaces)
line 1.2 (indented two spaces)
line 1.2.3 (indented four spaces)
In Visual Studio 2008, when I pressed enter, the next line would also be indented four spaces.
However, in Visual Studio 2010, when I press enter, the next line is indented one tab.
Question
Does anybody know where, in the mountain of preferences under Tools > Options, I can return to the way that Visual Studio 2008 worked?
Under Options > Text Editor > Plain Text > Tabs, I see the following:
If I select "None", then I get no indentation when I move to the next line. If I select "Block", then I get TAB indentation (even though the previous line is spaces).
In Visual Studio 2008, my indentation is set to "Block", and I get spaces.
I have no idea what "Smart" indenting is, or why it is disabled.
"Smart" indenting is essentially asking the language service to do indentation, which covers cases like adding an extra indent level after an { in C# files. Since plain text files don't have a language service, it isn't available here. If it was, the behavior (matching indentation from the line above) would be whatever the language decides to do, though I'm pretty certain it respects the "Insert spaces"/"Keeps tabs" option.
"Block" indenting is asking the editor to take care of it, which it takes to mean "maintain the same indent level as the previous line". It appears that, in VS2008, it copied the indentation from the previous line, whereas VS2010 respects the "Insert spaces"/"Keep tabs" setting.
Can you file a bug on Connect about it? I'm not sure if it was changed on purpose or not, so it will help for this to go to our (the editor team's) triage people to make sure.