T O P I C R E V I E W |
alex.postlethwaite |
Posted - Mar 29 2017 : 09:37:57 AM Hi,
When I use the Ctrl-Shift-V paste method, the indentation of the item being pasted doesn't get set correctly.
Please see the attached gif for an example.
When the paste occurs inside the braces, I would expect it to match the indentation at the caret.
Using the built-in paste (Ctrl-V) the indentation is matched as expected.
Alex
--- VA_X.dll file version 10.9.2212.0 built 2017.03.23 DevEnv.exe version 15.0.26228.10 Professional --- |
9 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Apr 04 2017 : 05:42:17 AM This all makes sense, and I know various of our users are not to keen on the default IDE formatting, so turning off the formatting option is quite reasonable, even if it turns out to be unhelpful here.
Hopefully everything is now working well and smoothly for you. |
alex.postlethwaite |
Posted - Apr 04 2017 : 04:16:12 AM quote: One of those unhelpful edge cases that help to make our life interesting.
Yeah I appreciate what you've described.
After having checked that option you mentioned I'm happy to drop this issue;
I haven't found any case where things are misbehaving at the moment so I'm assuming I turned it off initially as I prefer to turn everything off and add things I like, rather than enable everything then turn off stuff I don't like - if that makes sense.
Alex |
feline |
Posted - Apr 03 2017 : 06:41:02 AM Thank you for the update, and I am glad this has helped in this situation. Outside a couple of specific situations, for example where you have specified formatting via VA Snippets for refactoring commands, we just let the IDE do the formatting. The IDE already has some options for code formatting, and we don't want to duplicate or interfere with these.
You are right, I was so focused on what was happening in the GIF I didn't actually notice the visible white space, my mistake. I agree with you and you are right, the "indent" is something that exists, but unfortunately it only exists as far as the caret is concerned, not as far as the file is concerned, since at this point no tabs have actually been inserted. Since we are working behind the IDE's back, we often have to focus on the actual state of the file, not the file as it might be when you start typing. One of those unhelpful edge cases that help to make our life interesting. |
alex.postlethwaite |
Posted - Apr 03 2017 : 05:37:24 AM quote: Have you tried turning this VA option on?
I have, it appears to fix this case, thanks. I had this disabled since I don't really want any additional formatting to occur, just indentation. If you are delegating to the IDE for this, and it in turn behaves with my other preferences then we can resolve this question.
quote: Since VA has been told not to do any formatting, it is not doing any formatting, and if you turn on visible white space, when adding the curly bracket and then Enter to start the next line, no white space is actually inserted, until text is added.
Visible white space is turned on in my GIF.
It may not be doing any additional formatting, but I'd argue that it's destructive here, in interfering with the virtual indentation that already exists. The editor has contextually given me two tabs after opening the brace, even if they haven't been committed to the stream yet. You can see from the placement of the caret after the paste that it seems like these two uncommitted tabs are still there, otherwise the caret would be neighbouring the ';' after the 10, not hanging off to the right as it appears to be.
Alex |
feline |
Posted - Mar 31 2017 : 4:41:06 PM I have the files, many thanks for these. I am now seeing the same behaviour here, and have tracked it down to the VA option:
VA Options -> Editor -> Format after paste
which is fairly obvious, once I thought to check it.
Have you tried turning this VA option on? Since VA has been told not to do any formatting, it is not doing any formatting, and if you turn on visible white space, when adding the curly bracket and then Enter to start the next line, no white space is actually inserted, until text is added.
The IDE is providing three options here, formatting, indenting, and nothing. VA is only offering on and off, partly because we are trying to avoid getting involved with all of the varied and different formatting rules that people use. Instead we just ask the IDE to format when formatting is turned on. |
alex.postlethwaite |
Posted - Mar 31 2017 : 04:03:16 AM quote: Originally posted by feline
Please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
Done, hth.
Alex |
feline |
Posted - Mar 30 2017 : 3:44:45 PM I am still not able to reproduce this behaviour here. Can you please export your VA and IDE settings and send them to me:
VA Options -> Performance -> Export Settings IDE tools menu -> Import and Export Settings -> Export selected environment settings
I can then import them here and see if I can reproduce the problem.
Please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up. |
alex.postlethwaite |
Posted - Mar 30 2017 : 03:14:37 AM quote: Originally posted by feline
IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> When I paste:
I have this set to Indent, but do not format.
I have Automatic Brace Completion turned off everywhere (VS and VAX).
Alex |
feline |
Posted - Mar 29 2017 : 1:41:36 PM I am seeing a different effect here.
Can you please look in the IDE options dialog, and tell me what you have:
IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> When I paste: Indent and format Indent, but do not format Do nothing
set to. I have tried this after turning off automatically inserting closing brackets, which you must have turned off. |
|
|