Notepad3
Notepad3 copied to clipboard
To indent a single line is inconvenient
To indent a single line you have to press Home (or by clicking) to get to the beginning of the line and then press Tab. When the line is wrapped you could select the whole line and press Tab, like the case of multi-lines.
Can we use Tab to indent a single line by selecting the line through clicking at the line number? Currently this will replace the line with a tab char. But for multi-lines pressing Tab works as one expects. I don't think this is a good arrangement, for if you want to clear the line you have many ways.
So I suggest we should make indentation more easier for a single line.
- Select the whole line (or part of it, if it is wrapped) by clicking on the line number, then press Tab.
- At any place of the line, use Ctrl+Tab to indent it, and Ctrl+Shift+Tab to unindent it.
Pls see if these ideas make sense.
Can we use Tab to indent a single line by selecting the line through clicking at the line number? Currently this will replace the line with a tab char.
Hello @chuanliwen , I cannot reproduce your Issue. When I select the Line by clicking on the Line number and then press Tab, the Tab is just added at the start of the line and the line is not replaced with a Tab? π€
Hi @hpwamr,
Sorry for the confusion. It seemed to be a little tricky, for I did repeat it several times using a previous version before I posted the previous message.
Now again to confirm the behavior of Tab on several cases:
-
A single line without wrap. -- Click on the line number to select the line, then press Tab, tab is added to the line.
-
A single line with wrap. --Click-drag on the line number area to select the whole line, then press Tab, it behaves as a line without wrap: tab is inserted at the beginning of the line.
--Click on the line number area to select part of it, then press Tab,
-
If the last part is selected, a tab char is inserted at the beginning of the line.
-
Otherwise, the selected part is replaced with a tab char. (This one should be checked to unify the behavior.)
- Selecting one whole line with the mouse, whether the line is wrapped or not, then press Tab, the whole line is replaced with a tab char.
I still hope to get an easy way of indentation for a single line: at any place of the line, use Ctrl+Tab to indent it, and Ctrl+Shift+Tab to unindent it.
Thanks.
Hi @chuanliwen , The Tab operations seem completely normal. A long "wrapped" line always remains a single long line even if the presentation "wrap" displays multiple lines. Selecting a line in a "wrap" multiple lines presentation is equivalent to selecting the same words in a "no wrap" presentation. Also, it is therefore completely normal that this selection of a few words in a "wrap" or "no wrap" line is replaced when you type a space, a tab or write a character.
I think @hpwamr makes the point. Selecting only parts of the line ('subline' in case of wrapped long line) should be replaced by TAB (or spaces, if Insert Tabs as Spaces is chosen) if TAB is pressed.
An indentation should be made (or reverted Shift+TAB) only, if whole Line (or Block) is selected (which includes the line-breaks).
Since NP3 is designed as a Source-Code Editor (where wrapped lines and paragraphs, etc. are far less common) and not as a Text-Processor this behavior should not be changed.
@hpwamr @RaiKoHoff
Selecting a line (no wrap) by clicking on the line number then press Tab, the line is replaced by Tab -- this happens to the last line (without a CR/LF mark).
Shortcuts of Ctrl+Tab and Shift+Ctrl+Tab are not assigned to any special operations, so I think we could use them to quicken the operation of indentation/un-indentation.
this happens to the last line (without a CR/LF mark).
Hello @RaiKoHoff , I confirm the bug (a bit similar to #5051)! π€ π
Shortcuts of Ctrl+Tab and Ctrl+Shift+Tab are not assigned...
About the request to assign Ctrl+Tab and Ctrl+Shift+Tab to "indentation/un-indentation", I think it is not necessary, however I will check the behavior of "VSCode"? π€
About the request to assign
Ctrl+TabandCtrl+Shift+Tabto "indentation/un-indentation"
In MS VSCode these sequences of keys are use in "File management":
Ctrl+Tab Open next
Ctrl+Shift+Tab Open previous
However, in Notepad3 the following sequences of keys already exist:
Shift+Tab Unindent Selected Block.
Ctrl+Tab Insert Tabulator.
Hello @chuanliwen , Thanks for your interest and your contributions to Notepad3. π
Question: I would like to add you in the "Acknowledgments" list of Notepad3. Do you agree? π
Hi @hpwamr,
Question: I would like to add you in the "Acknowledgments" list of Notepad3. Do you agree? π
With pleasure. As a user of years I thank you all the contributors to Notepad3 for all the hard work to enhance the project and the patience to assess users' requirements and suggestions.
BTW, in Notepad3 Ctrl+Tab functions the same as Tab, so the current shortcut is redundant.
Hope PR #5114 fixes behavior of "complete line selected" (excluding line-break).
Ctrl+TAB will not be changed, it is mapped to "forced TAB indentation using Tabs instead of whitespaces".
Hello @chuanliwen ,
Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_6.24.227.1_rc2.paf" or newer, see in issue #1129.
"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.
Also, feel free to test the "BETA/RC Setup", version "Notepad3_6.24.227.1_rc2_Setup" or newer, see the 2nd list in issue #1129.
Comments and suggestions are welcome... π
Hello @RaiKoHoff @hpwamr: Have downloaded and tested the new build.
- Line indentation works perpeactly. I think it's a makeshift to place the option in 'Indentation Guide (color)'. Perhaps later you could add a seperate option to hold it, or you could add a help item to guide users.
- Tab (indentation) for the last line without a CR/LF character: it is solved. For lines with multi-sublines, I check EmEditor and see their treatment is the same. So just leave it as it is. Thank you for your great work.
Not sure if it is because of this topics specific changes or not, but in the latest 227/228 beta releases, now when pressing tab when in column 0 (such as in a new document), NP3 inserts a tab, but also selects it, so if you start typing the tab is removed again, is this a intentional behavior change?
Not sure if it is because of this topics specific changes or not, but in the latest 227/228 beta releases, now when pressing tab when in column 0 (such as in a new document), NP3 inserts a tab, but also selects it, so if you start typing the tab is removed again, is this a intentional behavior change?
@RaiKoHoff @hpwamr Confirmed this new issue. Needs to be dealt with.
Hello @jupester , @chuanliwen ,
Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_6.24.302.1_rc2.paf" or newer, see in issue #1129.
"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.
Also, feel free to test the "BETA/RC Setup", version "Notepad3_6.24.302.1_rc2_Setup" or newer, see the 2nd list in issue #1129.
Comments and suggestions are welcome... π