I have multiple instances of Scintilla in a winform, in different tabs. Scintilla seems to keep a blinking cursor in only one instance at a time. So when I switch to another tab, I need to click inside the textarea to make it appear (even though the instance is the ActiveControl), and then the current editor becomes the only instance remembering the blinking cursor. If I switch to another tab, the cursor is not there, but then if I switch back to the previous one, it's there. Is there a way to force Schintilla to restore the cursor ?
Related
Alt+Left navigate backs to the last cursor position and if the last cursor position was in a different file then it navigates to that file.
But, I want to navigate to the last cursor position with respect to the currently focused file only. It is really useful when I have 2 split file editors and want to navigate back exclusive to each other.
Is it possible?
I hope you understand the question, let me know if further explanation is required.
Basic Functionality
You can use the cursor undo / cursor redo commands via the command palette.
Undo also comes with a keyboard shortcut by default (Mac: cmd+u, Windows/Linux: ctrl+u), and you can configure a keybinding for redo.
Advanced Functionality
Note, however, that the file's cursor history is only saved while it has focus in an editor group. So if you have split editors, multiple focused files can have their own cursor history saved. And if the same file is opened and focused in two different editor groups, it has two different cursor history states.
But as soon as you focus another file in an editor group, the previously focused file will lose its cursor history (in that editor group).
The VSCode team is currently working on a variety of open issues to improve local history across the board, but I don't believe that saving cursor history for blurred (or closed) files is in the plans yet. If you need that functionality, you may want to create a feature request.
Note, with VSCode 1.40 (Oct. 2019):
The Soft Undo command has been renamed to Cursor Undo
This action is useful, for example when using Ctrl+D to select the next match and going one time too far, as it undoes only the last cursor state change.
Additionally, we now have added Cursor Redo, which redoes the previously undone cursor state change.
When a DataTip is open while debugging in Visual Studio it appears the only way to get to a specific object property is scrolling with the mouse.
This can get very cumbersome as some objects can have hundreds of properties and scrolling to a property near the bottom takes a long time.
Yes, I know I can scroll faster if I hover the mouse over the bottom edge and pin a property once I found it but it can still take a long time to get to the property and pin it.
I've tried various combinations with Ctrl and Alt but what ever key I press the DataTip is promptly closed...
Once the DataTip has focus, you don't have to use the mouse. You can use the PgUp/PgDn (Page Up/Page Down) keys on your keyboard. But you're right: There is not a way to get to the end of the list or to get to items that start with a certain letter. When I need to do that often I take one of two approaches:
If possible, I create a [temporary] variable assignment after the code-line of interest and ensure that the variable gets assigned to the property of interest.
Create a watch variable and interact with that.
Open an Immediate Window and paste a copy of the object-instance name in question. Once in the Immediate Window, IntelliSense is available as soon as you type the "."--you can then type the letter of the property in question and drill-down as needed more quickly.
(Probaby the best tip!)
Open (and keep open for convenience) a Debug | Windows | Autos and/or Debug | Windows | Locals window. Those windows simplify navigating variables near the code break or in the current module--and they even seem to retain their tree-node-expanded state in some cases while debugging. More information is available here: https://msdn.microsoft.com/en-us/library/bhawk8xd.aspx
You could use the oz-code as an extension tool which could help you search the properties or variables easily.
Search in debug mode inside an object
I have a long line that I want to select a section in the middle. In Visual Studio, it would scroll all the way to the end of the line, passing where I want the selection to end, when I move pass the text area and move all the way back when I try to move back a little. Is there a way to slow down the Visual Studio scrolling adjustment?
If you are talking about selecting text using the mouse you can get fine grained control by combining the the mouse and keyboard. This should work in any application that allows text selection, not just Visual Studio.
First click the location where you want to begin selecting text.
Next scroll to the location where you want to end selecting text and hold down Shift on the keyboard while clicking with the mouse. The block of text between the first click and the shift+click will be selected without having to worry about the selection jumping around due to scrolling.
As for actually slowing down the scrolling; I know of no way to do that. Hopefully my tip should give you an alternate way to do what you actually want.
When I do a multiple selection from, say, the find dialog (Alt-Enter), I sometimes find that many of the selected bits are off screen, but I'd like to check the context of all of them before I start doing a multiple edit.
Is there a way to, say, cycle through them in the view (without disrupting the selections)?
Probably the easiest way is to not do a "Find All", but instead highlight (or do a single Find) what you're looking for, then use ⌘D on OS X/CtrlD on Win/Lin to sequentially add the next matches. If you come to a match you don't want to select, just use ⌘K,⌘D (or CtrlK,CtrlD) to skip the current instance and go on to the next one. ⌘U (CtrlU) is "soft undo", it moves back to the previous selection in case you made a mistake.
Alternatively, I use a color scheme with a very bright selection color (it's bright blue surrounded by bright green) so that selected regions are very easy to identify. This way I can just glance at the minimap and see where selections are, and scroll through my file quickly to ensure everything looks good. If you find a selection you don't want, you can deselect it with Alt+middle mouse button on Win/Lin, or by ⌘Shift+click on OS X. You may need to set "drag_text": false in your Preferences for it to work, though (I'm not on my Mac at the moment to test).
I've found a working solution, but it's not ideal and only works if you're ok with losing the selections (eg: with multiple selections, hit Right Arrow - you've still got multiple cursors, but the selections are gone).
It goes like this:
Make sure there is no code folding - it appears to interfere with this sort of manipulation of multiple selections.
Use altEnter in the search dialogue to select all occurrences of your regex.
Scroll through the selections until you find one you don't want (MattDMo's Neon plugin is helpful here).
Use a cursor movement to lose the selections (multiple cursors remain).
Use Alt+Left Click on the undesired cursor.
Repeat 5. as required. Making another (multiple) selection can be helpful here to locate the other cursors (eg: Control/CommandShiftLeft Arrow)
If you remove a cursor by mistake, or need to add one, use Control/Command+Left Click
After interacting with the Project Navigator, or Search Navigator (The "folder" and "magnifying glass" tabs in the vertical pane on the left), is there a way to send keyboard focus to the code window-pane without clicking in the pane? Clicking has the side-effect of de-selecting selected text and moving the cursor position which in some cases is undesirable. The usual tab-stop mechanism doesn't seem to include the code pane in Xcode.
This is most frustrating when clicking project-wide search-results (which opens the file and selects the matching text for you, but doesn't put keyboard focus there) or clicking on files to temporarily look at a different file. In the latter case I may wish to preserve my cursor position and any already selected text in each file.