Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the "col" value in visual studio text editor

In the bottom of the visual studio text editor it shows "Ln X Col Y". Line seems pretty self-explanatory and works predictably, but I'm a bit baffled about "Col" :-)

If there are Chinese characters in the line, moving the cursor to to the right (i.e. by one character) sometimes seems to advance the "Col" by 1 and sometimes by 2, even thought they are all multi-byte characters. what is it actually counting?

a subsidiary question so this is: Is there a simple way to find out the number of characters on a line?

Thanks In Advance

like image 654
Andy Avatar asked Oct 07 '13 13:10

Andy


People also ask

What is Col in Visual Studio?

In visual studio, you can have ln X Col Y Ch Z. Sometimes you can have both unicode and ascii characters in your text editor and Col is used to find out how much space you need for that line.

How do I get the column number in VS code?

Right-clicking on the status bar gives a list of what's being shown there (excluding default stuff like columns, confusingly), and you can untick things to hide them. Untick enough, and line and column numbers should come back!

Does Visual Studio have a text editor?

Visual Studio (the text editor is known as Visual Studio Code so we'll refer to that from now on) is Microsoft's free text editor that runs on Windows, Linux, and macOS.

Is Visual Studio Code a good text editor?

If you step back and look at the bigger picture, Sublime Text and Visual Studio Code are two of the best multi-language, multi-OS programming editors—Sublime Text for its speed as much as its convenient editing features, and Visual Studio Code for even better features and speed that is almost as good.


2 Answers

The difference between column and character positions is evident for characters such as the tab character that can incorporate more than one column.

Taken from MSDN.

like image 104
Benjamin Avatar answered Sep 24 '22 02:09

Benjamin


In visual studio, you can have ln X Col Y Ch Z. Sometimes you can have both unicode and ascii characters in your text editor and Col is used to find out how much space you need for that line.

like image 44
qxixp Avatar answered Sep 23 '22 02:09

qxixp