Repository: spyder-ide/spyder

Issue:
Code analysis not updated after Backspace
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

## Problem Description



### What steps reproduce the problem?

1. Add blank spaces either by adding a new line with enter or by pressing the space bar
2. Remove these blank spaces by pressing backspace
3. Wait

![warning_and_backspace](https://user-images.githubusercontent.com/10170372/79588151-805eae00-80a1-11ea-8717-4aef88ec2daa.gif)


### What is the expected output? What do you see instead?

The pycodestyle W293 warning should go away automatically, but it doesn't.

I think this is due to the fact that no `document_did_change` is issued when `remove_suffix` is called in the `CodeEditor` when `key == Qt.Key_Backspace` in `keyPressEvent` override. 

See:
https://github.com/spyder-ide/spyder/blob/47a4f4994bcbf9ea0648711f5fa2ddeee039fdf6/spyder/plugins/editor/widgets/codeeditor.py#L3942-L3943

## Versions
* Spyder 5.0.0.dev0 (Commit: 47a4f4994) 
* Python 3.7.3 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Windows 10 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
# Mandatory:
atomicwrites >=1.2.0        :  1.3.0 (OK)
chardet >=2.0.0             :  3.0.4 (OK)
cloudpickle >=0.5.0         :  1.2.2 (OK)
diff_match_patch >=20181111 :  20181111 (OK)
intervaltree                :  None (OK)
IPython >=4.0               :  7.9.0 (OK)
jedi =0.15.2                :  0.15.2 (OK)
nbconvert >=4.0             :  5.6.0 (OK)
numpydoc >=0.6.0            :  0.9.1 (OK)
paramiko >=2.4.0            :  2.6.0 (OK)
parso =0.5.2                :  0.5.2 (OK)
pexpect >=4.4.0             :  4.7.0 (OK)
pickleshare >=0.4           :  0.7.5 (OK)
psutil >=5.3                :  5.6.3 (OK)
pygments >=2.0              :  2.4.2 (OK)
pylint >=0.25               :  2.4.3 (OK)
pyls >=0.31.9;<0.32.0       :  0.31.9 (OK)
qdarkstyle >=2.8            :  2.8 (OK)
qtawesome >=0.5.7           :  0.6.0.dev0 (OK)
qtconsole >=4.6.0           :  4.7.0.dev0 (OK)
qtpy >=1.5.0                :  1.9.0 (OK)
rtree >=0.8.3               :  0.8.3 (OK)
sphinx >=0.6.6              :  2.2.1 (OK)
spyder_kernels >=2.0.0dev0  :  2.0.0.dev0 (OK)
watchdog                    :  None (OK)
zmq >=17                    :  18.1.0 (OK)

# Optional:
cython >=0.21               :  0.29.13 (OK)
matplotlib >=2.0.0          :  3.1.3 (OK)
numpy >=1.7                 :  1.17.2 (OK)
pandas >=0.13.1             :  1.0.3 (OK)
scipy >=0.17.0              :  1.3.1 (OK)
sympy >=0.7.3               :  1.4 (OK)
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -3951,6 +3951,7 @@ def insert_text(event):
                     cursor.removeSelectedText()
                 else:
                     insert_text(event)
+            self.document_did_change()
         elif key == Qt.Key_Home:
             self.stdkey_home(shift, ctrl)
         elif key == Qt.Key_End:


Test patch: