NVDA indentation reporting, can it ignore blank lines?


Samuel Kacer
 

Hello,

as a programmer, I use indentation reporting almost every day. One particular thing that has really been annoying me for years now is is demonstrated in this scenario:

block header
  line 1

  line 2

because of the blank line with indentation reporting is read as:
block header
two space line 1
no indent blank
two space line 2

although the blank line and its lack of indentation  has no semantic meaning and does not change the block structure in any way, NVDA reports the change of indentation anyway, leading to redundant verbosity, making it much harder to focus on what is relevant.

I am not saying that NVDA shouldn't do this. this is definitely relevant information in some contexts, but I would love if there was an additional setting that would make indentation reporting ignore blank lines. so the previous line in the buffer that is compared to the new line to determine whether to announce indentation change would be the last non-blank line visited. so, the above example would read as:

block header
two space line 1
blank
line 2

I was thinking of developing an addon to enable this behaviour when I have a bit more free time, but wanted to check first if this behaviour is possible by any chance without an addon.

Thanks,
Sam


William
 

is this possible by some sort of regex?

Personally I want to keep the original behavior, because when doing text editing, this can prevent leaving some lines with only spaces.

Samuel Kacer 於 21/3/2021 21:01 寫道:

Hello,

as a programmer, I use indentation reporting almost every day. One particular thing that has really been annoying me for years now is is demonstrated in this scenario:

block header
  line 1

  line 2

because of the blank line with indentation reporting is read as:
block header
two space line 1
no indent blank
two space line 2

although the blank line and its lack of indentation  has no semantic meaning and does not change the block structure in any way, NVDA reports the change of indentation anyway, leading to redundant verbosity, making it much harder to focus on what is relevant.

I am not saying that NVDA shouldn't do this. this is definitely relevant information in some contexts, but I would love if there was an additional setting that would make indentation reporting ignore blank lines. so the previous line in the buffer that is compared to the new line to determine whether to announce indentation change would be the last non-blank line visited. so, the above example would read as:

block header
two space line 1
blank
line 2

I was thinking of developing an addon to enable this behaviour when I have a bit more free time, but wanted to check first if this behaviour is possible by any chance without an addon.

Thanks,
Sam


Samuel Kacer
 

That's incorrect. With the proposed setting turned on, lines with spaces would not behave differently. only lines that are completely blank.


On Sun, Mar 21, 2021 at 3:05 PM William <xsuper.sillyx@...> wrote:

is this possible by some sort of regex?

Personally I want to keep the original behavior, because when doing text editing, this can prevent leaving some lines with only spaces.

Samuel Kacer 於 21/3/2021 21:01 寫道:
Hello,

as a programmer, I use indentation reporting almost every day. One particular thing that has really been annoying me for years now is is demonstrated in this scenario:

block header
  line 1

  line 2

because of the blank line with indentation reporting is read as:
block header
two space line 1
no indent blank
two space line 2

although the blank line and its lack of indentation  has no semantic meaning and does not change the block structure in any way, NVDA reports the change of indentation anyway, leading to redundant verbosity, making it much harder to focus on what is relevant.

I am not saying that NVDA shouldn't do this. this is definitely relevant information in some contexts, but I would love if there was an additional setting that would make indentation reporting ignore blank lines. so the previous line in the buffer that is compared to the new line to determine whether to announce indentation change would be the last non-blank line visited. so, the above example would read as:

block header
two space line 1
blank
line 2

I was thinking of developing an addon to enable this behaviour when I have a bit more free time, but wanted to check first if this behaviour is possible by any chance without an addon.

Thanks,
Sam


Samuel Kacer
 

Woops, sorry I misread your reply at first glance. Well, in that case you would not turn on this setting. However, it really shouldn't be a big deal, since editors like VS code auto-delete spaces on blank lines for most languages. In fact, that behavior of VS code is partly the motivating factor for this setting.


On Sun, Mar 21, 2021 at 3:26 PM Samuel Kacer <samuel.kacer@...> wrote:
That's incorrect. With the proposed setting turned on, lines with spaces would not behave differently. only lines that are completely blank.

On Sun, Mar 21, 2021 at 3:05 PM William <xsuper.sillyx@...> wrote:

is this possible by some sort of regex?

Personally I want to keep the original behavior, because when doing text editing, this can prevent leaving some lines with only spaces.

Samuel Kacer 於 21/3/2021 21:01 寫道:
Hello,

as a programmer, I use indentation reporting almost every day. One particular thing that has really been annoying me for years now is is demonstrated in this scenario:

block header
  line 1

  line 2

because of the blank line with indentation reporting is read as:
block header
two space line 1
no indent blank
two space line 2

although the blank line and its lack of indentation  has no semantic meaning and does not change the block structure in any way, NVDA reports the change of indentation anyway, leading to redundant verbosity, making it much harder to focus on what is relevant.

I am not saying that NVDA shouldn't do this. this is definitely relevant information in some contexts, but I would love if there was an additional setting that would make indentation reporting ignore blank lines. so the previous line in the buffer that is compared to the new line to determine whether to announce indentation change would be the last non-blank line visited. so, the above example would read as:

block header
two space line 1
blank
line 2

I was thinking of developing an addon to enable this behaviour when I have a bit more free time, but wanted to check first if this behaviour is possible by any chance without an addon.

Thanks,
Sam


 

I can understand why you want this.  Even if I were editing pure text, I know I'd prefer not to hear "no indent" if there is actually no indent.  Reading the line, as is, should imply no indent.  But I can also understand wanting that to be a toggle, there are times where hearing "no indent" can be useful as well.
--

Brian - Windows 10 Pro, 64-Bit, Version 20H2, Build 19042  

Any idiot can face a crisis. It's the day-to-day living that wears you out.

      ~ Anton Chekhov

 


Tony Malykh
 

I would love to have this feature too. I checked NVDA sources a while ago, and I didn't see this feature implemented. I might implement this as a hack in one of my add-ons some day.

On 3/21/2021 7:29 AM, Samuel Kacer wrote:
Woops, sorry I misread your reply at first glance. Well, in that case you would not turn on this setting. However, it really shouldn't be a big deal, since editors like VS code auto-delete spaces on blank lines for most languages. In fact, that behavior of VS code is partly the motivating factor for this setting.

On Sun, Mar 21, 2021 at 3:26 PM Samuel Kacer <samuel.kacer@...> wrote:
That's incorrect. With the proposed setting turned on, lines with spaces would not behave differently. only lines that are completely blank.

On Sun, Mar 21, 2021 at 3:05 PM William <xsuper.sillyx@...> wrote:

is this possible by some sort of regex?

Personally I want to keep the original behavior, because when doing text editing, this can prevent leaving some lines with only spaces.

Samuel Kacer 於 21/3/2021 21:01 寫道:
Hello,

as a programmer, I use indentation reporting almost every day. One particular thing that has really been annoying me for years now is is demonstrated in this scenario:

block header
  line 1

  line 2

because of the blank line with indentation reporting is read as:
block header
two space line 1
no indent blank
two space line 2

although the blank line and its lack of indentation  has no semantic meaning and does not change the block structure in any way, NVDA reports the change of indentation anyway, leading to redundant verbosity, making it much harder to focus on what is relevant.

I am not saying that NVDA shouldn't do this. this is definitely relevant information in some contexts, but I would love if there was an additional setting that would make indentation reporting ignore blank lines. so the previous line in the buffer that is compared to the new line to determine whether to announce indentation change would be the last non-blank line visited. so, the above example would read as:

block header
two space line 1
blank
line 2

I was thinking of developing an addon to enable this behaviour when I have a bit more free time, but wanted to check first if this behaviour is possible by any chance without an addon.

Thanks,
Sam


Samuel Kacer
 

@Tony
thought this would be the sort of feature you'd be interested in :)

I have no time to develop anything until mid-may after my final exams for my masters. If you develop it by then then that saves me work :) but otherwise I will have a crack at it


Luke Davis
 

I am also interested in this, because I've been finding this behavior annoying lately.

I don't have time to work on it right now either, but I would imagine you probably need to monkeypatch something in speech/__init__.py. It needs to keep track of the previous non-zero indentation, and for each indentation that matches it, but was separated from it by a zero indentation, suppress indentation announcement and beeps. Possibly something in getIndentationSpeech(), although hopefully not in getTextInfoSpeech().

Luke


 

Hi,
I advise waiting until 2021.2 cycle to do this, as speech facility has just
received a major overhaul that affected speech synthesizer and related
add-ons.
Cheers,
Joseph

-----Original Message-----
From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Luke Davis
Sent: Monday, March 22, 2021 1:01 AM
To: nvda@nvda.groups.io
Subject: Re: [nvda] NVDA indentation reporting, can it ignore blank lines?

I am also interested in this, because I've been finding this behavior
annoying lately.

I don't have time to work on it right now either, but I would imagine you
probably need to monkeypatch something in speech/__init__.py. It needs to
keep track of the previous non-zero indentation, and for each indentation
that matches it, but was separated from it by a zero indentation, suppress
indentation announcement and beeps. Possibly something in
getIndentationSpeech(), although hopefully not in getTextInfoSpeech().

Luke


Bruno Aníbal Prieto González
 

As several have already mentioned, it also happens to me and I find it
quite annoying, it would be an interesting feature.

2021-03-22 5:03 GMT-03:00, Joseph Lee <joseph.lee22590@gmail.com>:

Hi,
I advise waiting until 2021.2 cycle to do this, as speech facility has just
received a major overhaul that affected speech synthesizer and related
add-ons.
Cheers,
Joseph

-----Original Message-----
From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Luke Davis
Sent: Monday, March 22, 2021 1:01 AM
To: nvda@nvda.groups.io
Subject: Re: [nvda] NVDA indentation reporting, can it ignore blank lines?

I am also interested in this, because I've been finding this behavior
annoying lately.

I don't have time to work on it right now either, but I would imagine you
probably need to monkeypatch something in speech/__init__.py. It needs to
keep track of the previous non-zero indentation, and for each indentation
that matches it, but was separated from it by a zero indentation, suppress
indentation announcement and beeps. Possibly something in
getIndentationSpeech(), although hopefully not in getTextInfoSpeech().

Luke