vscode: [folding] Don't expand when clicking on space after collapsed line
- VSCode Version: 1.24.1
- OS Version: Windows 7 LTS
Steps to Reproduce:
- Do either one of these steps:
- Copy the following code in a blank document that VS Code supports code folding in.
- Create a JavaScript document, and save it as “foo.js” anywhere.
- Copy the following code in (or create whatever code you can be syntactically correct in, and it has to have at least 5 lines of codes):
function foo() {
var create1 = document.querySelector("div");
var create2 = document.querySelector("div");
var create3 = document.querySelector("div");
var create4 = document.querySelector("div");
var create5 = document.querySelector("div");
var create6 = document.querySelector("div");
var create7 = document.querySelector("div");
var create8 = document.querySelector("div");
var create9 = document.querySelector("div");
var create10 = document.querySelector("div");
var create11 = document.querySelector("div");
var create12 = document.querySelector("div");
var create13 = document.querySelector("div");
var create14 = document.querySelector("div");
var create15 = document.querySelector("div");
var create16 = document.querySelector("div");
var create17 = document.querySelector("div");
var create18 = document.querySelector("div");
//...
}
- Fold the code function,
foo
, so it is folded like so: - Click outside of Visual Studio Code, so Visual Studio Code is inactive (out-of-focus).
- Click on the right side of the left bracket on the line,
foo() {
, in Visual Studio Code. (Basically, clicking on the empty space, so the line indicator is highlighting the beginning of the code-folded line and the text cursor is at the end of the line). - Observe that
foo
gets expanded upon first click, when the correct behavior should be the operating system switching context to Visual Studio Code, and consume the mouse click event without doing anything else.
Here’s a GIF in action:
If we have a list of code-folded functions, and all the user wanted to do was to go back to Visual Studio Code and scroll the document up/down, the user may inadvertently unfold the code, and it would annoy the user to re-fold the code back before continuing to scroll.
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 33
- Comments: 25 (7 by maintainers)
Due to many requests I’ve change the behaviour that clicking in the empty space no longer expands.
Hi, another vote from me. This behavior is extremely frustrating. When you fold any function in MSVS, then everything still feels solid and comfortable. But when you fold anything in VSCode, you immediately start to feel like a EOD unit member, having to be very, VERY careful where you click. It’s never a good thing to introduce any behavior that requires user to feel uneasy and careful.
It’s also a reason for me to not use folding that much because i mostly move my cursor up and down with the keyboard… moving it over a folded region expands that region
An option flag for that would be awesome! Keep up the good work tough 👍
Is there a way to opt out of that change? I find it frustrating having to click such a small target with my mouse. It’s a well explained situation in UX (Fitt’s Law)!
Another vote from me, also the folded region will open if text search found a match inside the folded region.
Actually i found out that, if you use vscode vim, you can use
vim.foldfix
in your settings and set it totrue
and it worked for meAnother vote from me for keeping the block folded when clicking on the empty space in the end of the line and unfold only on explicitly clicking ‘plus’ or ‘…’ icons. When you have something like this and you want to focus the window, big chances that you occasionally expand something folded.
Please change this or give an option to “unfold code on double-click” for example. I cannot say how many times I accidentally unfolded blocks of code by simply clicking on what appeared to be just an empty space in the editor - very annoying.
I will make it configurable: #88522
NOOOOO.
This also frustrates me. I would prefer to explicitly unfold or click the little +/- button. I don’t want it to unfold when I click at the end of a folded line.
+1 Auto expanding drives me nutty.
This also bothers me. I would definitely prefer a toggle to disable this behavior!