When I open one file in two split views in visual studio CODE, I can scroll them separately to a different position. I can edit in one view and see another position in the other view. However, when I hit return to add a new line, the other view suddenly jumps to that position, which is rather annoying.
Not sure, whether this is a bug or a feature. How can it be disabled?
Related
I am working on a bootstrap project, where there are many nested s. Many times I work with several files in a split screen, the problem is that depending on whether I scroll vertically, I have to scroll horizontally to be able to see the code, because it stays too far to the right. Is there a way to do it automatically based on the leftmost line of code.
is there any way to collapse the tree view programatically.
I want to collapse my tree view when a button is clicked
PFA Screenshot.
I want Minimise the Firmware Layout View when 'Locate in Project View' is clicked.
There is a commit with a new command which may help, see 157410 Add Command to Fully Collapse Tree Items and in that commit this command:
list.collapseAllToFocus
[Update: now that I can test this I don't think this new command does what you need - it doesn't get to the top of the view and collapse that. It does collapse any included item and any of its included subItem items (so collapsing recursively - which is new) - but not at the top level, which is what you need.]
Here is an issue on this: API to programatically expand/collapse tree view
You can collapse that view - its contents only - but it appears you can't actually close the view itself - so it is reduced to a single line. Which I think is what you want. To collapse the contents so they are not visible (but still taking up their previous vertical space) read on. If there were a way to focus that view header which I believe it is called, then it would be easy to collapse the entire thing with the list.collapse command.
If you have your extension running, either in the Extension Host for testing or an installed version, look in the Keyboard Shortcuts and type collapse. You will see that vscode automatically creates a command like this:
workbench.actions.treeView.*******.collapseAll with your treeView id where the asterisks are.
So you could call that command the usual way with:
vscode.commands.executeCommand('workbench.actions.treeView.IDHere.collapseAll');
By the way, vscode also creates a
workbench.actions.treeView.someTreeViewIDHere.refresh command for all custom TreeViews.
In Chrome 80 the devtools now seems to auto horizontal scroll, to the right, to the content in tree views, but not back to the left when navigating back to a parent node. This makes the Elements tab very difficult to use with Word Wrap disabled. I mainly use the Elements tab to highlight elements to view the styles or to see the the parent/child relationship of the nodes. Word wrap makes it hard to view the hierarchy, because a node with many attributes will just take up all the horizontal space when it wraps. Now every time I click a child element I have to manually scroll back to the left to see the start of the parent nodes.
I don't know if this would be considered a bug, because I could see scrolling to the content useful in some places, but it has made the Elements tab difficult to use. Does there happen to be a way to toggle this feature to make horizontal scrolling manual only, because if I need to scroll I will just use the scrollbar myself.
Update:
This is fixed on canary now. The commits that broke and fixed it are referenced from the issue I reported here: https://crbug.com/1050868
I have a splitpane created from FXML that consists of Three panes left to right. I want to be able to hide the rightmost pane but I can't find anything to hide it. If I turn of the visibility it hides the pane content. What I want is to temporarily hide it, so the pane is removed visually.
As a temporary workaround I move the divider to 100%, but this leaves the divider visible. Another side-effect is that if I resize the main window the divider doesn't stay at the rightmost position.
Any tips on hiding one pane in splitpane?
Or any tips on the best way to achieve this without splitpane(rightmost pane needs to be resizable when not hidden). General pointers to techniques/containers would be appreciated since I'm new to Java/JavaFX but not to programming :)
Seems I've found it, even thought it's not a plain hide/show deal. My splitpane is named "mainSplitPane", and the one I want to hide/show is the third. Upon initialization of the controller I retrieve the third pane and store it in "componentsPane".
Declared in controllerclass:
Node componentsPane;
Called in initialize method of the controllerclass:
componentsPane=mainSplitPane.getItems().get(2);
Code to hide:
mainSplitPane.getItems().remove(componentsPane);
And code to show:
mainSplitPane.getItems().add(2, componentsPane);
mainSplitPane.setDividerPosition(1, 0.8);
A side effect is that I have to set dividerposition since it's removed.
In IB I have quite a few views that are shown. Many of them are hidden when the app loads, but are shown later when buttons are pressed. This is all fine, but when building this layout in IB it is extremely difficult to layout anything because there are so many overlapping views, some of which are partially transparent (ones that are set to hidden) and other are completely overlapping and covering others. This makes layout very hard.
What is the best method when laying out lots of views like this? Is there another way to break things up? Or better yet, can I hide a a view completely (like in photoshop) so that I can edit the ones underneath, then turn that layer back on?
Another option when trying to select a view that is obscured by another is the shortcut:
'ctrl' + 'shift' and click
It displays a list of all the views under the cursor.
I'm not aware of any way to hide objects in the canvas, but a useful trick for complex layouts is to double-click an item in the document tree to the left - this selects the item and puts focus on the canvas, you can the use the cursor keys to nudge it about.
This doesnt solve the problem of not being able to see things because there are, for example, five or six labels occupying the same space, but if that is the situation it may be a better idea to have a single label and change its contents in code.
I ran into this issue for an app I'm building that has an arial-view image of a park with clickable hotspots. When a hotspot is clicked a popup UIview is displayed with information about that spot in the park. I use the same VC/XIB for three parks. This makes the XIB really busy and hard to work with (i.e the same issue that you have) The detail UIViews make it hard to work with the views underneath. My workaround was to pick each detailed UIView that was hiding the part of the XIB I wanted to work on, and add 1000 to the UIView origin.x in the size inspector. This moved those UIViews enough out of the way for me to do what I needed to with the XIB. Then when I was done, I moved them back by x 1000. (I just needed to move them out horizontally to do what I needed to)
I know its clunky but given that XCode does not have a convenient way to hide portions of an XIB - it was the quickest approach I could think of!
One approach to handling overlapping items in IB is:
Ensure the groups of items that you want to hide are grouped into Views.
Give these Views names: e.g. ViewOptionA, ViewOptionB and ViewOptionC.
Can do this by clicking on name of view in the tree while it is selected and then typing new name.
When you want to hide one of those groups of items:
a) Select the View by either:
i) Clicking on it in the tree at the left or
ii) Ctrl-Shift Clicking in the layout editor and then select the view from the list.
b) In the Attributes Inspector set Alpha to 0.
When you want to unhide one of those groups of items:
As for 2) but set Alpha back to 1
[You do need to remember to unhide all views before you publish!
If you are forgetful like me then perhaps you could subclass UIView and set Alpha to 1. I haven't tried this subclassing idea yet.]