With feedkeys, the "_c was delayed until the very end of an active
mapping. Now, startinsert is issued immediately and the IMAP_JumpFunc
leaves in insertmode (if there was an empty placeholder).
Up to now, IMAP_JumpFunc has to be called from insert mode. This
rendered the code in this function a little bit complicated. Now, it is
simpler to understand and to modify.
In my opinion, this works now without the decoding. I have tested the
issue with the matching of "\xab" with itself, and it seems to be fine
in recent versions of Vim. (However, I did not find a clue in the change
logs of Vim concerning this issue)
In insert mode, <c-v>O will let you insert ascii keycodes as octal
numbers. Hence, an 'O' must not be preceeded by <c-v>. However, <c-v> is
necessary, if a:char is <c-\>.
Fix#59
commands to do the following:
1. change the EOL style of all vim files to be just LF.
2. changed the mime-type of all files to text/plain
3. removed the executable flag on all files.
This should hopefully make the repo look better on all platforms etc.
:iab zzz whatever
then typing 'z<space>' triggers the abbreviation in the presence of
latex-suite. (Cristian Rigamonti)
Why: The reg-exp used to find out if a iab existed was faulty.
Fix: Fix the regexp to use an exact match of the previous word.
>>> \begin{array}
>>> \end{}
results in
>>> \begin{array}
>>> \end{<++>}
with the cursor at the end (Berta Milan)
Why: When the indentation of a line changes while typing the text returned
by IMAP_PutTextWithMovement, then IMAP_Mark('go') does not go to the
same location as set by IMAP_Mark('set'). This causes the cursor to be
located not before the first placeholder causing the first
placeholder to be "missed".
Fix: Check to see if the indentation of the line remembered by
IMAP_Mark('set') has changed and if so, move a little to the left or
right to adjust for the indentation changing.
Why: With 'ignorecase' set, 'etB' matches 'ETB', therefore, LookupCharacter
assumes that a map exists for 'etB' and tries to find the value of
s:Map_Tex_etB which doesn't exist.
Fix: Force matching case with the \C pattern.
IMAP_Jumpfunc().
Why: s:RemoveLastHistoryItem sets @/ to the last search item in the @/
history, but @/ is not necessarily always the last item in the @/
history.
Fix: Remember @/ in Tex_LastSearchPattern and then restore it.
abbreviations starting with the letter 'a', then typing 'a<space>'
would trigger an expansion.
Cause: The :iab command also echoes for partial completions.
Solution: Check more thoroughly whether a word is an abbreviation LHS or
not.
(Preben Randhol, Sanip P Deshmukh)
Cause: If a mapping ends in a letter (say '\'), then abbreviations are not
triggered by that letter. For example, if we have
imap \ <C-r>='\'<CR>
iab 12 twelve
Then typing 12\ doesn't expand to twelve\.
(Strangely enough "imap \ ?" doesn't have this problem and we get
twelve?. Vim bug?)
This problem is aggravated by the fact that latex-suite "protects"
most letters to avoid expansions such as ``2 -> `\sqrt{}
Solution: After checking for mappings ending in a letter, if that letter is
not in 'iskeyword', then also check whether the previous word has
an abbreviation. Since vim does not have the equivalent of
mapcheck() for abbreviations, this is complicated (maybe even hacky).
:behave mswin
is set, which in turn sets &selection=inclusive. This makes
IMAP_Jumpfunc() skip selecting the last character of
Imap_PlaceHolderEnd. (Sumit Bhardwaj)
Solution: Temporarily set &selection = exclusive in IMAP_Jumpfunc().
- IMAP_Jumpfunc() is now able to handle <+placeholders
withlinebreaks+>
- Bug: If we were selecting in the backward direction, and we want to move
backwards, then 2 <Plug>IMAP_JumpBack's are needed. i.e, if we have
<+1+> <+2+> <+3+>
and we do (with <C-k> mapped to <Plug>IMAP_JumpBack)
<C-j><C-j><C-k>, from before <+1+>, then we remain in <+2+>.
(Bug pointed out by LH)
Cause: In visual mode, <Plug>IMAP_JumpBack deselects the text but remains
at the end of the selection. (this is default vim behavior).
Therefore searching back for the placeholder start character lands
us up in the template.
Solution: In visual mode, make <Plug>IMAP_JumpBack goto `< after
deselecting text. This strategy also leads to considerable
simplification at other places.
to position the cursor instead of adding a marker string and searching for it.
The marker would cause serious trouble if it occurred anywhere in the inserted
text, and minor trouble if it was too long and caused an unwanted line break.
* Fix a bug (mea culpa) in s:LookupCharacter() and IMAP_list(). If there was
a global map for "foo" and a local (filetype) map for "bozo" then these
functions would look at the last character, "o", see that there were local
maps ending in "o", and only look for local maps.