tab key skip empty row

Post Reply
SamC
Posts: 211
Joined: 12.08.2023 00:49

tab key skip empty row

Post by SamC »

Hello,
When select multi-lines and use tab key,the empty line will be skipped. Is there an option can make tab key works for empty line?
Thanks~
PPL_2024-12-05_09-19-30.gif
Last edited by SamC on 05.12.2024 01:20, edited 1 time in total.
main Alexey
Posts: 2327
Joined: 25.08.2021 18:15

Re: tab key skip empty row

Post by main Alexey »

i don't like that you post pictures with 13 number.
if you do it I wont help you.
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: tab key skip empty row

Post by SamC »

main Alexey wrote: 04.12.2024 16:15 i don't like that you post pictures with 13 number.
if you do it I wont help you.
Very sorry for didn't notice that,pictures has been replaced. Thanks for the reminder.
main Alexey
Posts: 2327
Joined: 25.08.2021 18:15

Re: tab key skip empty row

Post by main Alexey »

sorry for the long delay. I forgot about this topic. now I see that Tab-key on selection makes 'Indent selection' command. and this command skips empty lines in selection. it is like in SublimeText 4. do you suggest to indent also empty lines? it will be bad IMO. why to do this?
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: tab key skip empty row

Post by SamC »

main Alexey wrote: 25.02.2025 19:24 sorry for the long delay. I forgot about this topic. now I see that Tab-key on selection makes 'Indent selection' command. and this command skips empty lines in selection. it is like in SublimeText 4. do you suggest to indent also empty lines? it will be bad IMO. why to do this?
It's mainly due to python indent requirement. When I use cuda to write python code,sometimes want to indent all the rows to make(or delete) a loop or function. Then I need to select some rows and then type tab-key(shift+tab). For the empty rows,I need to make additional tab key,because the empty lines in selection is skiped.
Thanks!
main Alexey
Posts: 2327
Joined: 25.08.2021 18:15

Re: tab key skip empty row

Post by main Alexey »

it is OK if empty lines in selection are skipped, Python don't need indents for empty lines in a block. for that reason, Sublime also don't indent empty lines.
why do you need to indent empty lines?
+
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: tab key skip empty row

Post by SamC »

Sure, in python IDE,the empty lines can be handled properly.
However,sometimes,I use cuda plugin "exterminal " to run python script. This plugin is with a command called run selection,in this case,if the selection is with empty row which is not properly indented,the script will throw error.
Also,I like to used color indent plugin to read code,if the empty row is indent,the file will be more readble.
Thanks!

[item4]
section=commands
caption=ExTerminal\Run selection from editor
method=run_selection
Attachments
PL_2025-03-04_15-05-24.png
main Alexey
Posts: 2327
Joined: 25.08.2021 18:15

Re: tab key skip empty row

Post by main Alexey »

1st, this is too exotic case - using python.exe as shell_windows in ExTerminal.
it is more properly to adapt ExTerminal.
it is possible to filter out empty lines from selection block. in python if 'block' is list of lines, then

block = [s for s in block if s]

will filter out empty lines from 'block'.
can you adapt ExTerminal?

2nd, coloring of indents - it is OK to keep blank lines here too. no coloring of indents => empty line. it is readable ok.
I don't want to add exotic option for this case.
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: tab key skip empty row

Post by SamC »

Good idea,I will try it later.
Thanks!
main Alexey wrote: 04.03.2025 07:45
it is possible to filter out empty lines from selection block. in python if 'block' is list of lines, then

block = [s for s in block if s]

will filter out empty lines from 'block'.
can you adapt ExTerminal?
Post Reply