Skip to content

Commit

Permalink
"main selection" and clarify notes
Browse files Browse the repository at this point in the history
Add a paragraph in **Selection modes & Column Editor** introductory section which describes the "main selection" and how that interfaces with the various Global Styles for selection.
  • Loading branch information
pryrt committed Oct 22, 2024
1 parent b686c11 commit dc91ae9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions content/docs/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Normally when you select text by <kbd>LeftClick+Drag</kbd> with the mouse, or <k

Most users are accustomed to stream selection mode, because it behaves similarly to other applications. But to clarify _exiting_ stream selection: If you have a stream selection, and click in the text (whether inside or outside the current selection) without using the <kbd>Ctrl</kbd> or <kbd>Shift</kbd> modifiers, then you will no longer have a stream selection, and your typing [caret](#caret-and-cursor "typing/insertion cursor") will move to wherever in the text that you clicked; similarly, using the keyboard to arrow or <kbd>PageUp</kbd>/<kbd>PageDown</kbd> away from the text, you will no longer have a stream selection, and your typing [caret](#caret-and-cursor "typing/insertion cursor") will move as appropriate for the movement key you used. Either way, if you made your selection from left-to-right, then the typing [caret](#caret-and-cursor "typing/insertion cursor") will end up on the right side of the old selection when you exit selection mode; similarly, if you made your selection from right-to-left, the typing [caret](#caret-and-cursor "typing/insertion cursor") will end up on the left side of the old selection when you exit selection mode.

Whether you are in Column-Mode selection, or have a multiple-stream selection using Multi-Edit, the row or sub-selection that was added to the selection most-recently will be considered the "main selection"; certain actions (like the [**Edit > Blank Operations > Trim ...**](#edit) actions, below) will only work on the "main selection" instead of the whole selection; as of v8.6, **[Global Styles](/preferences/#global-styles) > Multi-selected text colour** and **Multi-edit carets colour** were added, so the earlier portions of the selection will use those colors, whereas the "main selection" will use the original **Selected text colour** and **Caret colour** -- so setting those text colours to different colours will help you quickly tell whether the selection is the "main selection" or one of the other portions of the multi-select or column selection.

The next sub-sections will provide more detail for the Column Mode selection, as that is the mode that needs more clarification for users unaccustomed to rectangular selection.

### Entering Column Mode
Expand Down Expand Up @@ -301,17 +303,18 @@ Below the **Begin/End Select** entries, there are a number of sub-menus to the *
* **Auto-Completion >** ⇒ submenu with actions that manually trigger [auto-completion](../auto-completion/) of function name, word, function parameter, and pathname. While the automatic completion is affected by [**Preferences > Auto-Completion** settings](../preferences/#auto-completion) for setting minimum number of characters, and enabling which of the completions happen automatically, when you manually trigger one of the auto-completion actions through this menu or keyboard shortcut equivalents, completion will happen regardless of those settings (so you can manually trigger when there's fewer characters than the auto-trigger threshold, or you can manually trigger function completion when only word completion is active).
* **EOL Conversion >** ⇒ submenu with actions that convert line endings between Windows (`CR LF`), Unix (`LF`), and old Macintosh (`CR`) values; these operations affect all of the lines of the current file
* If your file has mixed line endings (some `CR LF` and some `LF`, for example), you can use this menu to fix it: if the desired line-ending is not greyed out, you can just select it, and any mixed line-endings will be converted to the chosen line ending; if the desired line-ending is greyed out, select one of the other line-endings, then switch back to the desired line-ending selection, and any mixed line-endings will be converted to the final line-ending choice.
* **Blank Operations >** ⇒ submenu with actions that trim or convert spaces and tab characters on ALL lines of the current file.
* **Blank Operations >** ⇒ submenu with actions that trim or convert spaces and tab characters.
* _NOTE: All the **Blank Operations** commands will default to doing a global change through the whole document. Starting in Notepad++ v8.4.9, if there is a single active stream selection, the **Blank Operation** change will only apply to the selected text; if there is a multi-stream selection, then only the last selection added to the multi-stream (the "main selection") will be affected; if there is a column-mode selection, no trimming or tab-conversion will occur._
* **Trim Trailing Space**: removes any space or tab characters occurring at the end of a line, after any non-whitespace characters
* **Trim Leading Space**: removes any space or tab characters occurring at the beginning of a line, before any non-whitespace characters
* **Trim Leading and Trailing Spaces**: combines the functionalities of **Trim Trailing Space** and **Trim Leading Space** into one command
* **EOL to Space**: replaces line-ending characters with a single space character (similar to **Join Lines** functionality, but acts upon the entire file rather than the active selection); note: "EOL" means "End Of Line" -- in other words, line-ending characters
* **Trim Both and EOL to Space**: performs a combined **Trim Leading and Trailing Spaces** and **EOL to Space** operation (known as **Remove Unnecessary Blank and EOL** before v8.4.9)
- NOTE about Trim-related commands: the trim occurs for the line of the selection, even if the selection doesn't include those leading and/or trailing spaces. _Example_: if the line is some spaces, the text `words here`, and some more spaces, then even if the selection is just `words`, the trims will happen on the leading and/or trailing spaces, based on which menu command was chosen.
* **Trim Both and EOL to Space**: performs a combined **Trim Leading and Trailing Spaces** and **EOL to Space** operation (known as **Remove Unnecessary Blank and EOL** before v8.4.9; the newer phrase **Trim Both** is shorthand for **Trim Both Leading and Trailing Spaces**)
- Note about Trim-related commands: the trim occurs for the line of the selection, even if the selection doesn't include those leading and/or trailing spaces. _Example:_ if the line is some spaces, the text `words here`, and some more spaces, then even if the selection is just `words`, the trims will happen on the leading and/or trailing spaces, based on which menu command was chosen.
* **TAB to Space**: replaces any tab characters with their equivalent number of spaces
* **Space to TAB (All)**: consolidates space characters into an equivalent number of tab characters, wherever the spaces occur
* **Space to TAB (Leading)**: consolidates space characters into an equivalent number of tab characters, but only where they occur before the first non-whitespace character on a line
- NOTE about TAB-related commands: the "equivalent number" of spaces (or tab characters) is based on the [**Settings > Preferences > Language > Tab Settings > Tab Size**](../preferences/#language) for the active language of the current file, and will be enough spaces to take you to the next "tab stop".
- Note about TAB-related commands: the "equivalent number" of spaces (or tab characters) is based on the [**Settings > Preferences > Language > Tab Settings > Tab Size**](../preferences/#language) for the active language of the current file, and will be enough spaces to take you to the next "tab stop".

If the current language has a tab setting of 4 spaces per tab, then the tab stops are at 1, 5, 9, 13, and so on.

Expand All @@ -324,7 +327,6 @@ Below the **Begin/End Select** entries, there are a number of sub-menus to the *
![](../images/edit-tab-stops.png)

If you want a specific number of space characters to replace each tab character, instead of the above-described fill-to-tabstop behavior, you should use a replacement operation in Extended or Regular Expression search mode to replace `\t` with the number of space characters you desire.
* NOTE: All the **Blank Operations** commands will default to doing a global change through the whole document. Starting in Notepad++ v8.4.9, if there is a single active stream selection, the **Blank Operation** change will only apply to the selected text; if there is a multi-stream selection, then only the last selection added to the multi-stream will be affected; if there is a column-mode selection, _no_ trimming or tab-conversion will occur.

* **Paste Special >** ⇒ submenu with actions that pastes HTML or RTF, and special versions of copy/cut/paste which handle NULL and other binary characters
* Note: The HTML and RTF actions paste the HTML and RTF source code from the HTML or RTF entries in the Windows Clipboard; it does _not_ apply HTML or RTF formatting to what appears to be plain text in the Notepad++ editor window.
Expand Down

0 comments on commit dc91ae9

Please sign in to comment.