764 Commits

Author SHA1 Message Date
capitaomorte
953ffbf299 * `yas/next-field' needs to be rewritten to account for unnumbered fields 2009-07-12 20:18:40 +00:00
capitaomorte
3dd0ba6106 * Butchered template choosing code
TODO:

* Still some old syntax to take care of (simple ${field} without number)
* Add messages to snippet events, not just errors
* fix many bugs
* make the customization group
* merge from trunk
...
2009-07-12 19:59:32 +00:00
capitaomorte
01c626efbd * started attack on template code as well
* still got indenting to do
2009-07-11 18:09:25 +00:00
capitaomorte
ad570bf9e5 * region now represented as `yas/deleted-text'
* syntax now correctly backward compatible
* more little bugs fixed...
2009-07-11 17:29:46 +00:00
capitaomorte
555897a4ad * corrected another problem when evaling user elisp with errors 2009-07-11 00:59:27 +00:00
capitaomorte
10e8b41f7c * fixed two small bugs introduced earlier, have to retest stacked
expansion once in a while, wish I had unit tests...
2009-07-11 00:31:56 +00:00
capitaomorte
daf3c788a5 * a little cheating sometimes inserts a newline at end of the buffer... 2009-07-10 15:37:21 +00:00
capitaomorte
460bf76bae * Some little bug fixes, regexps could be cleaner, but oh well... 2009-07-09 16:31:07 +00:00
capitaomorte
39aab51b28 * implemented `yas/points-to-markers' and friend, look OK.
* mirrors only update when something actually changes

* cant reproduce strange undo/redo bug that I think I saw

* escapes apparently working OK

* expressions in fields working OK, but now tested extensively

TODO: Implement the per-snippet exit hook just like the "condition"
      Handle indent the best possible way
      Merge changes from trunk
2009-07-09 16:12:48 +00:00
capitaomorte
dec6fcda41 * primary field transformation working more or less, but seem to have
screwed with undo/redo, shouldn't be too hard...
2009-07-08 13:24:40 +00:00
capitaomorte
9e9f5f477c Commenting... 2009-07-07 17:19:56 +00:00
capitaomorte
7ce15312a7 Commenting... 2009-07-07 17:15:32 +00:00
capitaomorte
e0308fa495 * stacked expansion tricky tricky, but is working and undo/redo seems reasonablt OK
* will try to let the modification hooks do the previous-field advancing but I really don't know if its possible
* also remember to fix the "navigate to deleted field on undo" bug
2009-07-07 16:04:03 +00:00
capitaomorte
5f5e23c829 a minor change, having trouble debugging on mac 2009-07-06 21:38:41 +00:00
capitaomorte
6354579eed * stacked edition not quite perfect yet, otherwise everything looking good 2009-07-06 14:53:01 +00:00
capitaomorte
b56563de60 * stacked expansion is tricky, but can be done
* yas/minor-mode should be needed to expand snippets, this means hooks last while snippets last
* will probably *not* fix this bug: ${1:nested{2:thing}} when "thing" is changed "nested"'s end marker doens't move
2009-07-06 10:08:13 +00:00
capitaomorte
354580b8f7 * field protection problem solved, I guess
* on to the transformations, escapes and indent
2009-07-05 22:28:21 +00:00
capitaomorte
f31a071457 * a little bit of trouble with protection after C-d or deletions, but nothing too serious... 2009-07-05 22:17:22 +00:00
capitaomorte
514243f5b9 * Changed the approach yet again, this is it, this should work... 2009-07-05 20:20:59 +00:00
capitaomorte
97608378d3 * got rid of yas/registered-snippets
* undo/redo much smoother
* hooks last while yas/minor-mode is t (this may be changed)
2009-07-04 20:12:49 +00:00
capitaomorte
0932310893 snippet revival working relatively OK, but need to work on undoing an expansion 2009-07-03 15:04:49 +00:00
capitaomorte
3f9b630d95 * Much better way of calculating a fields visible value, but some subtle bugs.
* TODO: exit snippet if the yas/active-field-overlay is exited
* TODO: kill all field text on first keystroke
* TODO: handle border cases with empty/near empty active field overlays
* TODO: handle escapes
* TODO: handle nested snippets
2009-07-02 21:56:23 +00:00
capitaomorte
f790e77e7c rudimentary undo, very buggy, but this is the way to go 2009-07-02 12:51:08 +00:00
capitaomorte
333d48d731 Going OK, next step is to handler the feared undo/redo! 2009-07-02 09:59:12 +00:00
capitaomorte
25c4e884ae * lookin' good, next step: protecting the hidden overlays from modification somehow... 2009-07-01 22:15:00 +00:00
capitaomorte
14735e1ba0 Trashed prior implementation of nested snippets and now going full steam on a much better one (I hope...) 2009-07-01 16:58:39 +00:00
capitaomorte
795c08dddc 2009-01-23 14:38:15 +00:00
capitaomorte
50e7af74fa * Fuckin' more complicated than I thought. Think I'll have to sanitize
the `buffer-undo-list' once in a while
2008-09-19 16:40:50 +00:00
capitaomorte
9fa6f3533e * Getting there, getting there, `yas/push-undo-action-maybe' has to be
modified to adapt to new arg list and use `pushnew'

* A `yas/cleanup-snippet' action has to be pushed on `yas/expand' 

* expanding a new snippet with a snippet already active must render
  the previous one disabled. This shouldn't be a field, it should be
  found out on the fly. disabled means its big overlay is coloured
  some other color.

* transformations have to be accounted for

* code has to be cleaned up and thoroughly commented.
2008-09-18 21:43:28 +00:00
capitaomorte
d117ee3857 * Nice try reviving snippets. 2008-09-18 15:08:20 +00:00
capitaomorte
94e6ee5503 * Simplified passing of info between pre and post-command-hook 2008-09-18 08:25:34 +00:00
capitaomorte
9aa2cc6486 * Cleaning up some code and preparing for complete snippet undo/redo,
with nested snippets
2008-09-17 16:36:30 +00:00
capitaomorte
aa75b00b55 * Only the full snippet undo/redo missing. Fields are quite OK, I think.
* Also the mirror and primary transforms would be nice.
2008-09-15 08:58:48 +00:00
capitaomorte
5a3b161219 * Much closer to getting this all working, undo, redo and nested
stuff. Works most of the time but:

  1. Consider getting rid of the `deleted' state of a group and using
  some other criteria to discover if user can move to a
  group. `deleted' is only for subgroups anyway, i think.

  2. Consider adding information about restoring boundaries in the
  yas/group itself. This way,

  a) upon `yas/snippet-cleanup', start and end marker could simply be
     set to nil and deleted.

  b) `yas/undo-restore-active-group' could recurse down subgroups
     restoring them as well. (maybe without specifically moving to
     them, but OK.

  3. Don't forget to correct `yas/update-mirrors' to correctly use the
     transformations in the mirror fields.
2008-09-12 18:34:52 +00:00
capitaomorte
d9cb83dc93 * I like. Very nice. New undo scheme is powerful for completely
emulating Textmate behaviour I think.
2008-09-12 13:35:57 +00:00
capitaomorte
38ce2aac82 * Nice! Getting there with this scheme, undo and everything! 2008-09-12 13:19:34 +00:00
capitaomorte
d5695a34cb * Almost removed the field-overlay stuff, preparing for using simple
markers.
2008-09-10 17:00:23 +00:00
capitaomorte
05dc1f1474 * About to simplify this considerably. Deleted previous section on
field-level undo, only a stub for better times to come!
2008-09-09 17:25:03 +00:00
capitaomorte
058b7333af * Many bugs, gotta look for them later, now have to make my cv... 2008-09-09 14:07:54 +00:00
capitaomorte
e899cb4f83 Big bugs but it's around! Field level undo obviously needs a massive
change....
2008-09-08 17:06:16 +00:00
capitaomorte
4a2db923bb Nested placeholders, more or less working, but had to get rid of the
other workaround (which was a bit ugly anyway). Problem is that I have
to find another workaround.
2008-09-08 15:29:20 +00:00
capitaomorte
cc0211316e Checking in still largely failing attempt on nested placeholders,,, 2008-09-08 08:42:14 +00:00
Zhang Chiyuan
535a1ef314 Added $> support, fixed issue 16 2008-09-02 13:06:51 +00:00
capitaomorte
cca2df173d * Added a new section "Field-level undo functionality" to correct
issue 33.

* Added functions `yas/field-undo-before-hook',
  `yas/field-undo-after-hook', `yas/field-undo-group-text-change' and
  variables `yas/field-undo-history',
  `yas/field-undo-forbidden-commands' to implement field-level undo.

* Modified `yas/cleanup-snippet' to record the actual snippet end
  in the snippet before cleaning up the main overlay.

* New hooks `yas/field-undo-before-hook' and
  `yas/field-undo-after-hook' added to `pre-command-hook' and
  `post-command-hook', respectively.

* Slightly changed the commentary of the "Snippet register and
  unregister routines section"

* Modified step 12 to call `yas/undo-expand-snippet' without the
  `(point-min)' argument, which led to incorrect undo behaviour.

* Added a new step in `yas/expand-snippet' describing the local
  restore and save of undo infomation in a new slot of the
  `yas/snippet' structure. This is step 14, previous 14 was moved to 15.

* Modified `yas/undo-expand-snippet' to kill text up to the the
  correct snippet end, which was not being calculated correctly. It is
  now a slot of the snippet itself and no longer a parameter.

* Added functions `yas/current-field-text',
  `yas/replace-fields-with-value',
  `yas/remove-recent-undo-from-history' to refactor some code used
  twice or more.

* Modified `yas/check-cleanup-snippet' to detect trigger cleanup
  if point exits any primary snippet field, of any
  group. Previously cleanup would only be triggered on exiting
  all groups. This is a follow-up to issue 28.

* Added two slot to the `yas/snippet' structure to allow for
  field-level undo and correct small bug in the previous fix of issue
  28.

* Modified `yas/cleanup-snippet' to call
  `yas/after-exit-snippet-hook' as a follow-up to feedback on
  issue 28.

* (Accidentaly :) changed (but corrected!) indentation of most
  existing functions. This was done by a buffer global indent-region.

* (Accidentaly :) ran `checkdoc' but then gave up, it's
  uncessary. Didn't change much stuff though.
2008-08-30 19:33:16 +00:00
capitaomorte
b8e187b5b6 * Fixed issue 28,
http://code.google.com/p/yasnippet/issues/detail?id=28

* Added snippet registration routines `yas/register-snippet',
  `yas/unregister-snippet', `yas/cleanup-snippet',
  `yas/exterminate-snippets' and `yas/check-cleanup-snippet'

* Adjusted existing code to call these routines.

* Added some commentary to explain functionality.
2008-08-22 17:09:16 +00:00
Zhang Chiyuan
e6276da02a Raise an error when yas/load-directory get a parameter that is not a directory. 2008-08-20 15:32:02 +00:00
Zhang Chiyuan
36184e0bc7 forget to commit for 0.5.6? 2008-08-08 05:04:42 +00:00
Zhang Chiyuan
de67b5802f Make the environment of elisp evaluation more friendly to (current-column) 2008-08-06 08:52:36 +00:00
Zhang Chiyuan
b3aa297b95 use full key extension as "name" when no "name" property defined. 2008-08-01 05:04:47 +00:00
Zhang Chiyuan
e9cd192bda Use filename for snippet name if no "name" property is defined. 2008-07-31 07:05:53 +00:00