The Code Editor is a text editor which allows you to edit text, but has features
that make it particularly well suited to editing code and is referred to as
either the Text Editor or the Code Editor, based on its content.
You can open multiple code editors to view or edit the code in projects and
copy and paste among them. The Windows menu contains a list
of all open code editors..
The code editor supports the language of the source file that it is editing,
showing code with syntax highlighting and offering smart indenting.
You can open a code editor in several ways, some of which are:
- By double clicking on a file in the Project Explorer or
by right clicking on a file and selecting Open from the
context menu.
- Using the File menu New or Open
commands.
- Right clicking in a source file and selecting a file from the Open
Include File menu.
Elements of the code editor
The code editor is divided into several elements which are described here.
- Code Pane The area where you edit your code.
You can set options that affect the behavior of text in the code pane as it
relates to indenting, tabbing, dragging and dropping of text, and so forth.
For more information, see General, All Languages, Text Editor, Options Dialog
Box.
- Margin gutter A gray area on the left side of
the code editor where margin indicators such as breakpoints, bookmarks, and
shortcuts are displayed. Clicking this area sets a breakpoint on the corresponding
line of code. You can hide or display the Margin Indicator bar in General,
Tools, Text Editor, Options dialog box.
- Horizontal and vertical scroll bars Allows you
to scroll the code pane horizontally and vertically so that you can view the
code that extends beyond the viewable edges of the code pane. You can hide
or display the horizontal and vertical scroll bars using the General, Tools,
Text Editor, Options dialog box.