Simon Butler wrote:

hi, when i write this skill (cadence extension language) fragment in emacs i get the following:


procedure( vscCheckpointHier( @key lib cell view message inclibs )
    let(( ddCVs )
vscPrint0(sprintf( nil "Hierarchy for %s,%s,%s ..." lib cell view ))
        when( ddCVs = vscGetHierarchyDDs( ?lib lib ?cell cell ?view view
                                          ?inclibs inclibs )
            vscPrint0(sprintf( nil "  %d cellviews." length(ddCVs) ))
            vscCheckpoint( ddCVs ?message message)
        ); when ddCVs
    ); let
); procedure vscCheckpointHier


Notice all the comments placed on the closing brackets. Is there a way to make vim do this?

TIA


In Vimscript, IIUC what you mean, a comment starts with a double quote. Most statements accept a comment after them; a few don't, because they see the quote as part of their arguments. See ":help :quote".

There is a workaround to add comments even after the commands (such as :map) which don't accept them (see ":help :comment"):

        exe 'map <F9> <C-]>' |" find tag under cursor


So you could do (not sure whether I read emacs syntax correctly, but the following should give you a notion of what is possible):

function vscCheckpointHere(key, lib, cell, view, message, inclibs)
        let ddCVS = vscPrint0(printf("Hierarchy for %s, %s, %s ...",
                \ a:lib, a:cell, a:view))
        if ddCVS == vscGetHierarchyDDs(a:lib, a:cell, a:view, a:inclibs)
                let ddCVS = vscPrint0(printf("  %d cellviews.", length(ddCVS))
                call vsCheckpoint(a:message)
        endif " ddCVS
" endfunction vsCheckpointHere
endfunction

(I'm not sure whether or not a comment is allowed after ":endfunction", see ":help :endfunction")

If your vim code is properly indented, you might also have less need for this kind of comments.



Best regards,
Tony.

Reply via email to