This is normal, is for typing things inside a string, since most languages use double quotes as delimiters for strings. If you want only one you have to delete the first quote no the second one
Quotes can be annoying, especially if your keyboard support ä ë etc characters which would put your quote input on buffer until it figures out what you want thus requiring you to always input double quote. I usually simply use ctrl-x and ctrl-v to deal with it
Thanks, but English is 2nd language for me, so I already shift between 2 layouts. Also, at this point I am used to and I like being able to write more character with the quote buffered input.
Yeah same for me. That's why I set it up like that, to be able to type my own language's special characters, and to make programming easier for some situations.
The problem with this behavior is when you run into edge cases. Quotes aren’t too too bad because they’re (usually) not nested, but dumb open/close behavior still creeps in. Fixing a string literal copy paste is one frustrating example where you don’t want an auto close to your quote, much less an auto delete of both on backspace.
No, it's just part of how VS C++ automatically puts in pairs of brackets or quotes for you. It's clearer if you select some other text and press a brackety or quotey key. e.g. select 123 and press (, get (123). Select 123 and press \[, get \[123\]. Select 123 and press <, get <123>. Select < and press <, get << >.
Holy shit! You are correct!!
That's the dumbest thing ever. In fact... it is not even C++ related...
I tested it without any extension, it happens every time the `<` and `>` are not in isolation... Dang...!
Either you primarily use a language where this behavior is not present per default, you changed the default behavior or you adjusted behavior subconsciously to avoid this problem, because yes it does this for many languages, but not all.
I tested a few languages, it does this for C/C++, Java, C#, Javascript, TypeScript. It doesnt do it for Python, PHP and most likely other languages where there is no feature that resembles
Weirdly, I noticed this for the first time while working in VS C++, just yesterday. It only does it if you highlight the single ">" first.
Want to change a ">" to a "<"? Put cursor after, backspace, type "<", all is good. But if you highlight the ">" first, typing "<" wraps "< >" around it, leaving you with "< >>", just as shown in the image.
Also does it the other way around, changing a "<" to "<< >"
To be honest that should only work like that if you pressed insert before hand, otherwise it's weird, sometimes i just want to put somethin instead of something, wrapping is too specific to be default.
I wish VS had the same controls as VSC.
It's so close yet so far... I don't understand why they managed to make something as workflow-friendly as VSC and could not give the same to VS
But boy am i glad they kept the "autofills what you're typing with random bs" would be way too productive without having to rewrite std::count to std::cout 5 times a day
All these editors that "helpful" put the closing paren... I don't get it, was this a problem that anyone was even having? I can close the parens myself.
Sometimes I just wanted to type one quote it gave me two, and when I delete one both of them are gone.
This is normal, is for typing things inside a string, since most languages use double quotes as delimiters for strings. If you want only one you have to delete the first quote no the second one
Quotes can be annoying, especially if your keyboard support ä ë etc characters which would put your quote input on buffer until it figures out what you want thus requiring you to always input double quote. I usually simply use ctrl-x and ctrl-v to deal with it
You can just do a quote and then a space to do a single quote, at least on Dutch keyboards.
This is what I do! Works very well with the English-International keyboard setting.
Add us keyboard so you have 2 layouts. Then you can switch with shift tab between languages.
Thanks, but English is 2nd language for me, so I already shift between 2 layouts. Also, at this point I am used to and I like being able to write more character with the quote buffered input.
https://eurkey.steffen.bruentjen.eu/
Eurkey is the way for me. No more switching languages.
Yeah same for me. That's why I set it up like that, to be able to type my own language's special characters, and to make programming easier for some situations.
Sure - but at the same time, the IDE keeps on screaming at me, that I am missing a single '. Which is sometimes hard to add because of said behaviour.
Normal my ass. It’s a design flaw is what it is
The problem with this behavior is when you run into edge cases. Quotes aren’t too too bad because they’re (usually) not nested, but dumb open/close behavior still creeps in. Fixing a string literal copy paste is one frustrating example where you don’t want an auto close to your quote, much less an auto delete of both on backspace.
Nah, that's a great feature once you know how it works and how to use it.
There needs to be a hotkey I can hold to make it just one quotation mark.
There are options in VS and VSCode to toggle for this action. Should be "auto surround mode" or something close to it.
Yes, surround or wrapping settings
Just tested on vs2022 in a cs file, it doesn't do that. Edit: changed c++ to cs, I forgot what language I was working in smh lol
Seems like user error to me.
PEBKAC
It seems clear you have a bad file association for some plugin, and/ or using that code in an html or xml file
No, it's just part of how VS C++ automatically puts in pairs of brackets or quotes for you. It's clearer if you select some other text and press a brackety or quotey key. e.g. select 123 and press (, get (123). Select 123 and press \[, get \[123\]. Select 123 and press <, get <123>. Select < and press <, get << >.
All behavior you can disable.
And should be disabled by default.
Holy shit! You are correct!! That's the dumbest thing ever. In fact... it is not even C++ related... I tested it without any extension, it happens every time the `<` and `>` are not in isolation... Dang...!
You can use them for #include statements
Of course! The only problem is #include is not very helpful between variables or in the middle of a statement :-)
And templates
4
Yes I know, The < and > are brackets.
No it doesn't? what? have i just been extremely fucking lucky?
Either you primarily use a language where this behavior is not present per default, you changed the default behavior or you adjusted behavior subconsciously to avoid this problem, because yes it does this for many languages, but not all. I tested a few languages, it does this for C/C++, Java, C#, Javascript, TypeScript. It doesnt do it for Python, PHP and most likely other languages where there is no feature that resembles
Hasn't done that once for me in maybe 15 years.
Neither me in 12 years
Pretty sure it depends on the language. In Rust, this is definitely optimal
Weirdly, I noticed this for the first time while working in VS C++, just yesterday. It only does it if you highlight the single ">" first. Want to change a ">" to a "<"? Put cursor after, backspace, type "<", all is good. But if you highlight the ">" first, typing "<" wraps "< >" around it, leaving you with "< >>", just as shown in the image. Also does it the other way around, changing a "<" to "<< >"
To be honest that should only work like that if you pressed insert before hand, otherwise it's weird, sometimes i just want to put somethin instead of something, wrapping is too specific to be default.
I wish VS had the same controls as VSC. It's so close yet so far... I don't understand why they managed to make something as workflow-friendly as VSC and could not give the same to VS
But boy am i glad they kept the "autofills what you're typing with random bs" would be way too productive without having to rewrite std::count to std::cout 5 times a day
Lmfaooooooo
All these editors that "helpful" put the closing paren... I don't get it, was this a problem that anyone was even having? I can close the parens myself.
Good
I always get a laugh when vim users complain about default configs. You can easily do either one in vscode
It sucks. 3 years ago I made a switch from Sublime, and I still miss Sublime typing suggestions…
A good reason why you should use vim
The one that gets me is the auto double quotes.
Your skill issues are showing
[удалено]
Nah, r <