I think I have found the right place in the NB source code -
https://github.com/apache/netbeans/blob/7d89336259b840ce53709cbc8240c88e32fd6ea1/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/document/TrailingWhitespaceRemoveProcessor.java#L135-L144
It looks like (as mentioned previously) it deliberately tries to avoid
removing whitespace from the current line.
I suppose this would be annoying if you also had autosave activated
and it suddenly deleted WS from what you were just in the middle of
typing.
Pete

On Fri, 8 Nov 2024 at 16:33, Michael Andrews
<michael.andr...@me.com.invalid> wrote:
>
>
> Probably because the line is a comment.
>
> On Nov 8, 2024, at 6:11 AM, Lakshika Bandara <harshani.bandara2...@gmail.com> 
> wrote:
>
> 
>
> Hi,
>
>
>
> I am currently using NetBeans version 18. I have set the option to remove 
> trailing whitespace from all lines. However, when I save the file, the 
> whitespace before the cursor does not get removed. Is this how the feature is 
> intended to function?
>
>
>
> I have attached images to reproduce this issue.
>
>
>
> Best Regards.
>
> Lakshika.
>
> <test.png>
> <steps.png>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: users-h...@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to