Mac frustrations XAML Editing - must be missing something

I am a long time mac user, but most of my programming using XAML has been with Windows Visual Studio.

On Windows you start typing a tag, e.g. then hit enter and it will insert the AFTER the cursor, so when you hit enter it moves to the next line. That means I'm ready to start typing whatever I want between those tags.

On the Mac it's inserting it but always moves the cursor to AFTER the closing tag, so now I have to cursor back to between them before I hit enter.

I've been through the settings looking for something to fix this several times but can't find it. What am I missing?

Best Answer

Answers

  • DavidPartingtonDavidPartington USMember ✭✭
    edited September 2

    Sorry, the code didn't get embedded.

    So, I'm trying to do something like this:

    <ScrollView>
    </ScrollView>
    

    which is achieved on Windows Visual Studio just by typing <ScrollView> and the closing tag appears with the cursor in between them ready for me to hit enter, which moves the closing tag to the next line.

    <ScrollView>|</ScrollView>   << cursor in the middle on Windows 
    

    On the mac the cursor is at the end (after the closing tag), meaning you have to manually cursor back in order to split them on to different lines.

    <ScrollView></ScrollView>|   << cursor at the end on Mac
    

    This is tedious, especially when typing a lot of XAML and having to do it every time.

    How do I make VS Mac do the same as VS Windows, i.e. leave the cursor between them? Is there some setting I've missed?

    If it can't is there some simple key sequence to get the cursor back there?

  • DavidPartingtonDavidPartington USMember ✭✭

    Seriously, NO ONE knows how to do this?

  • magic67magic67 USMember ✭✭✭

    @DavidPartington
    There are a lot of options for VS Studio for Mac you just have to look under the Preferences menu, which is different to VS for Windows where you would use the Tools > Options menu.

    Try this and see if it helps your issue.
    Go to the Visual Studio menu > Prefernces (or hit Command + comma)
    Scroll down and expand the Text Editor group
    Expand the Behaviour group
    Select XML
    Tick the first option "Automatically Insert Closing Tags"

    Hope this helps

  • DavidPartingtonDavidPartington USMember ✭✭

    That's there already, it's inserting them, but as per my post, the cursor is AFTER then closing tag and not before it, so you have to cursor back and hit enter.

    On Windows the cursor is in between the tags and you can just hit enter. So how do I get the Mac to do that?

  • DavidPartingtonDavidPartington USMember ✭✭

    Thanks - I'm going to try toggling evening on/off/on again to see if it fixes it.

Sign In or Register to comment.