Browse Source

Bug fix

For some reason it necessary to have another line between \startuml
and the state.
calle 5 years ago
parent
commit
83423290fb
2 changed files with 3 additions and 1 deletions
  1. 1 0
      examples/CmdKeyMachine/CmdKeyStateMachine.hpp
  2. 2 1
      yasnippet_function.el

+ 1 - 0
examples/CmdKeyMachine/CmdKeyStateMachine.hpp

@@ -18,6 +18,7 @@ using namespace std;
  * \brief declaration of statemachine CmdKeyStateMachine
  *
  * \startuml "CmdKeyStateMachine"
+ * 
  *  state CmdKeyStateMachine: on_entry() \n on_exit()
  *  state CmdKeyStateMachine{
  *  state WaitForInput

+ 2 - 1
yasnippet_function.el

@@ -368,7 +368,7 @@ bool operator()(Event const&, Fsm&, SourceState&, TargetState&) const\n\
       (re-search-forward endReg nil t)
       (forward-line -1)
       (setq endPos (point))
-      (message (format "%s:%d %s:%d" startReg begPos endReg endPos))
+      ;;(message (format "%s:%d %s:%d" startReg begPos endReg endPos))
       (when (and begPos endPos)
 	(setq view (make-ContextView :StartPos begPos
        				     :EndPos endPos
@@ -463,6 +463,7 @@ bool operator()(Event const&, Fsm&, SourceState&, TargetState&) const\n\
   (beginning-of-buffer)
   (let (view compStart compEnd)
     (when (not (re-search-forward (concat "state\s*" machine) nil t))
+      (insert (concat lineStart "\n"))
       (insert (format "%s state %s: on_entry() \\n on_exit()\n" lineStart machine))
       (insert (format "%s state %s{\n\n%s}\n"
 		      lineStart