Bug 118648 - Deleting automatically added opening parenthesis doesn't delete closing parenthesis
Summary: Deleting automatically added opening parenthesis doesn't delete closing paren...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Formula-Bar
  Show dependency treegraph
 
Reported: 2018-07-09 19:02 UTC by david.cortes.rivera
Modified: 2023-05-19 18:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david.cortes.rivera 2018-07-09 19:02:14 UTC
When using automatically closed parentheses for formulas in LO Calc, if I'm typing some formula, add the parenthesis (or get it added through the autocomplete), and immediately delete one of them (either the opening or the closing one), the other part of the parentheses is not deleted like it happens it pretty much every single IDE and programming-oriented text editor.

Steps to reproduce:
-Activate autoclose parenthesis and code completion (Tools -> Options -> Basic IDE -> tick "Enable code completion" and "Autoclose parenthesis").
-Start writing some formula in some cell, get it autocompleted.
-From the same pointing position from which it was autocompleted, delete a parenthesis.

Expected behavior:
-The other parenthesis that was added automatically should also be deleted.

Actual behavior:
-The other parenthesis is still there after the triggering parenthesis is already deleted, even when there was nothing written in between these parentheses.

Setup: LO 6.0.5.2 running on Linux (Debian buster/sid).
Comment 1 Buovjaga 2018-07-17 14:16:44 UTC
How can I autocomplete besides hitting Enter?
Comment 2 david.cortes.rivera 2018-07-17 17:54:36 UTC
(In reply to Buovjaga from comment #1)
> How can I autocomplete besides hitting Enter?

No idea, I was autocompleting by hitting enter.
Comment 3 Buovjaga 2018-07-18 07:49:12 UTC
Aha, I was just confused by "From the same pointing position from which it was autocompleted" thinking that I need to remain in edit mode the whole time.

Ok, I confirm and if you say the auto-deleting is standard IDE stuff, I believe you.
Comment 4 QA Administrators 2019-07-19 02:53:46 UTC Comment hidden (obsolete)
Comment 5 david.cortes.rivera 2019-07-19 08:52:18 UTC
Comment that the bot asked for:
Version: 6.2.5.2 (x64)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-GB
Calc: threaded
Comment 6 QA Administrators 2021-07-19 03:26:26 UTC Comment hidden (obsolete)
Comment 7 david.cortes.rivera 2021-07-23 15:08:09 UTC
Still an issue.

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 16; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Debian package version: 1:7.0.4-4
Calc: threaded
Comment 8 Michael Warner 2021-07-23 15:25:31 UTC
I have used a fair number of text editors and IDEs in my time and none of them have done this. When I hit backspace, I expect only the character immediately to the left of the cursor to be deleted, regardless of how it was inserted. 

I guess I could see adding an option for this, but it's an enhancement, not a bug.
Comment 9 Buovjaga 2021-07-23 18:44:25 UTC
Ah, seems I was naive in 2018 to believe this to be standard behaviour. Let's put this on UX team's table.
Comment 10 david.cortes.rivera 2021-07-23 23:09:00 UTC
(In reply to Michael Warner from comment #8)
> I have used a fair number of text editors and IDEs in my time and none of
> them have done this. When I hit backspace, I expect only the character
> immediately to the left of the cursor to be deleted, regardless of how it
> was inserted. 
> 
> I guess I could see adding an option for this, but it's an enhancement, not
> a bug.

A couple counterexamples: sublime text, vscode, dbeaver, rstudio, spyder, jupyter (those are all the editors and IDEs that I use, not sure about others but I assume they'd behave similarly).
Comment 11 Buovjaga 2021-07-24 12:18:02 UTC
(In reply to david.cortes.rivera from comment #0)
> Steps to reproduce:
> -Activate autoclose parenthesis and code completion (Tools -> Options ->
> Basic IDE -> tick "Enable code completion" and "Autoclose parenthesis").
> -Start writing some formula in some cell, get it autocompleted.
> -From the same pointing position from which it was autocompleted, delete a
> parenthesis.

Note: you have to activate experimental features to get into Basic IDE options
Comment 12 Heiko Tietze 2021-08-18 08:47:56 UTC
I tend to agree with Michael (c8), there might be situations where you want to insert a single parenthesis but it's always duplicated and you cannot delete one. In order to revert the double parenthesis I would run Undo - however, we ignore the automatically inserted character. 

My take: improve Undo (different topic) and keep the current solution. Another option sounds like overkill but could solve the issue for everyone.