summaryrefslogtreecommitdiffstats
path: root/src/autocmd.c
AgeCommit message (Collapse)Author
2023-09-29patch 9.0.1958: cannot complete option valuesv9.0.1958Yee Cheng Chin
Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: #13182 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-24patch 9.0.1934: :bwipe fails after switching window from aucmd_win.v9.0.1934zeertzjq
Problem: :bwipe fails after switching window from aucmd_win. Solution: Decrement b_nwindows after switching back to aucmd_win. closes: #13160 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-25patch 9.0.1665: empty CmdlineEnter autocommand causes errors in Ex modev9.0.1665Christian Brabandt
Problem: Empty CmdlineEnter autocommand causes errors in Ex mode. Solution: Save and restore ex_pressedreturn. (Christian Brabandt, closes # 12581, closes #12578)
2023-05-27patch 9.0.1582: :stopinsert may not work in a popup close handlerv9.0.1582zeertzjq
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson) Solution: Restore stop_insert_mode when appropriate. (closes #12452, closes #12434)
2023-05-20patch 9.0.1571: RedrawingDisabled not used consistentlyv9.0.1571Bram Moolenaar
Problem: RedrawingDisabled not used consistently. Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in win_split_ins(). (closes #11961)
2023-04-15patch 9.0.1454: code indenting is confused by macrosv9.0.1454ichizok
Problem: Code indenting is confused by macros. Solution: Put semicolon after the macros instead of inside. (Ozaki Kiichi, closes #12257)
2023-04-09patch 9.0.1443: ending Insert mode when accessing a hidden prompt bufferv9.0.1443Bram Moolenaar
Problem: Ending Insert mode when accessing a hidden prompt buffer. Solution: Don't stop Insert mode when it was active before. (closes #12237)
2023-04-02patch 9.0.1439: start Insert mode when accessing a hidden prompt bufferv9.0.1439orbital
Problem: Start Insert mode when accessing a hidden prompt buffer. Solution: Call leaving_window() in aucmd_restbuf(). (Thorben Tröbst, closes #12148, closes #12147)
2023-03-12patch 9.0.1403: unused variables and functionsv9.0.1403Dominique Pelle
Problem: Unused variables and functions. Solution: Delete items and adjust #ifdefs. (Dominique Pellé, closes #12145)
2023-02-04patch 9.0.1277: cursor may move with autocmd in Visual modev9.0.1277zeertzjq
Problem: Cursor may move with autocmd in Visual mode. Solution: Restore "VIsual_active" before calling check_cursor(). (closes #11939)
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2022-12-09patch 9.0.1039: using a <Cmd> mapping CmdlineChanged may be triggered twicev9.0.1039Bram Moolenaar
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice. Solution: Count the number of times CmdlineChanged is triggered and avoid doing it twice. (closes #116820
2022-11-28patch 9.0.0967: leaking memory from autocmd windowsv9.0.0967Bram Moolenaar
Problem: Leaking memory from autocmd windows. Solution: Free window when auc_win is not NULL.
2022-11-28patch 9.0.0965: using one window for executing autocommands is insufficientv9.0.0965Bram Moolenaar
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
2022-11-22patch 9.0.0917: the WinScrolled autocommand event is not enoughv9.0.0917Bram Moolenaar
Problem: The WinScrolled autocommand event is not enough. Solution: Add WinResized and provide information about what changed. (closes #11576)
2022-11-20patch 9.0.0915: WinScrolled may trigger immediately when definedv9.0.0915Bram Moolenaar
Problem: WinScrolled may trigger immediately when defined. Solution: Initialize the fields in all windows. (closes #11582)
2022-11-13patch 9.0.0871: using freed memory when clearing augroup at more promptv9.0.0871Bram Moolenaar
Problem: Using freed memory when clearing augroup at more prompt. Solution: Delay clearing augroup until it's safe. (closes #11441)
2022-10-15patch 9.0.0756: no autocmd event for changing text in a terminal windowv9.0.0756Shougo Matsushita
Problem: No autocmd event for changing text in a terminal window. Solution: Add TextChangedT. (Shougo Matsushita, closes #11366)
2022-10-10patch 9.0.0713: <amatch> of MenuPopup event is expanded like a file namev9.0.0713zeertzjq
Problem: <amatch> of MenuPopup event is expanded like a file name. Solution: Do not expand <amatch> for MenuPopup. (closes #11328)
2022-09-24patch 9.0.0568: autocmd code is indented more than neededv9.0.0568Yegappan Lakshmanan
Problem: Autocmd code is indented more than needed. Solution: Break out sooner. (Yegappan Lakshmanan, closes #11208) Also in user function code.
2022-08-28patch 9.0.0304: WinScrolled is not triggered when only skipcol changesv9.0.0304zeertzjq
Problem: WinScrolled is not triggered when only skipcol changes. Solution: Add w_last_skipcol and use it. (closes #10998)
2022-07-23patch 9.0.0063: too many type casts for dict_get functionsv9.0.0063Bram Moolenaar
Problem: Too many type casts for dict_get functions. Solution: Change the key argument from "char_u *" to "char *".
2022-07-23patch 9.0.0061: ml_get error with nested autocommandv9.0.0061Bram Moolenaar
Problem: ml_get error with nested autocommand. Solution: Also check line numbers for a nested autocommand. (closes #10761)
2022-06-14patch 8.2.5089: some functions return a different value on failurev8.2.5089Yegappan Lakshmanan
Problem: Some functions return a different value on failure. Solution: Initialize the return value earlier. (Yegappan Lakshmanan, closes #10568)
2022-06-01patch 8.2.5051: check for autocmd_add() event argument is confusingv8.2.5051Bram Moolenaar
Problem: Check for autocmd_add() event argument is confusing. Solution: Make the code more straightforward.
2022-06-01patch 8.2.5049: insufficient tests for autocommandsv8.2.5049Yegappan Lakshmanan
Problem: Insufficient tests for autocommands. Solution: Add a few more tests. (Yegappan Lakshmanan, closes #10507)
2022-05-27patch 8.2.5033: build error with +eval but without +quickfixv8.2.5033Bram Moolenaar
Problem: Build error with +eval but without +quickfix. Warning for uninitialized variable. Solution: Adjust #ifdefs. (John Marriott)
2022-05-27patch 8.2.5030: autocmd_add() can only handle one event and patternv8.2.5030Yegappan Lakshmanan
Problem: autocmd_add() can only handle one event and pattern. Solution: Support a list of events and patterns. (Yegappan Lakshmanan, closes #10483)
2022-05-24patch 8.2.5011: Replacing an autocommand requires several linesv8.2.5011Yegappan Lakshmanan
Problem: Replacing an autocommand requires several lines. Solution: Add the "replace" flag to autocmd_add(). (Yegappan Lakshmanan, closes #10473)
2022-05-19patch 8.2.4981: it is not possible to manipulate autocommandsv8.2.4981Yegappan Lakshmanan
Problem: It is not possible to manipulate autocommands. Solution: Add functions to add, get and set autocommands. (Yegappan Lakshmanan, closes #10291)
2022-05-07patch 8.2.4911: the mode #defines are not clearly namedv8.2.4911Bram Moolenaar
Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first.
2022-04-14patch 8.2.4749: <script> is not expanded in autocmd contextv8.2.4749LemonBoy
Problem: <script> is not expanded in autocmd context. Solution: Add the context to the pattern struct. (closes #10144) Rename AutoPatCmd to AutoPatCmd_T.
2022-04-09patch 8.2.4723: the ModeChanged autocmd event is inefficientv8.2.4723LemonBoy
Problem: The ModeChanged autocmd event is inefficient. Solution: Avoid allocating memory. (closes #10134) Rename trigger_modechanged() to may_trigger_modechanged().
2022-04-08patch 8.2.4713: plugins cannot track text scrollingv8.2.4713LemonBoy
Problem: Plugins cannot track text scrolling. Solution: Add the WinScrolled event. (closes #10102)
2022-03-04patch 8.2.4505: Vim9: outdated "autocmd nested" still worksv8.2.4505Bram Moolenaar
Problem: Vim9: outdated "autocmd nested" still works. Solution: Do not accept the :autocmd argument "nested" without "++" in Vim9 script.
2022-02-16patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402kylo252
Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes #9788)
2022-02-11patch 8.2.4345: <amatch> is expanded like a file name for DirChangedPrev8.2.4345Bram Moolenaar
Problem: <amatch> is expanded like a file name for DirChangedPre. Solution: Do not expand <amatch>. (closes #9742) Also for the User event.
2022-02-09patch 8.2.4335: no autocommand event triggered before changing directoryv8.2.4335Bram Moolenaar
Problem: No autocommand event triggered before changing directory. (Ronnie Magatti) Solution: Add DirChangedPre. (closes #9721)
2022-01-24patch 8.2.4208: using setbufvar() may change the window titlev8.2.4208Bram Moolenaar
Problem: Using setbufvar() may change the window title. Solution: Do not redraw when creating the autocommand window. (closes #9613)
2022-01-07patch 8.2.4028: ml_get error with :doautoall and Visual areav8.2.4028Bram Moolenaar
Problem: ml_get error with :doautoall and Visual area. (Sean Dewar) Solution: Disable Visual mode while executing autocommands.
2022-01-01patch 8.2.3967: error messages are spread outv8.2.3967Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3961: error messages are spread outv8.2.3961Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3960: error messages are spread outv8.2.3960Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3959: error messages are spread outv8.2.3959Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-24patch 8.2.3886: can define autocmd for every event by using "au!"v8.2.3886Bram Moolenaar
Problem: Can define autocmd for every event by using "au!". Solution: Check if a command is present also for "au!".
2021-12-17patch 8.2.3837: QNX: crash when compiled with GUI but using terminalv8.2.3837Bram Moolenaar
Problem: QNX: crash when compiled with GUI but using terminal. Solution: Check gui.in_use is set. (Hirohito Higashi, closes #9363)
2021-12-17patch 8.2.3833: error from term_start() not caught by try/catchv8.2.3833ichizok
Problem: Error from term_start() not caught by try/catch. Solution: save and restore did_emsg when applying autocommands. (Ozaki Kiichi, closes #9361)
2021-11-29patch 8.2.3699: the +title feature adds a lot of #ifdef but little codev8.2.3699Bram Moolenaar
Problem: The +title feature adds a lot of #ifdef but little code. Solution: Graduate the +title feature.
2021-11-20patch 8.2.3626: "au! event" cannot be followed by another commandv8.2.3626Bram Moolenaar
Problem: "au!" and "au! event" cannot be followed by another command as documented. Solution: When a bar is found set nextcmd.
2021-11-13patch 8.2.3591: no event is triggered when closing a windowv8.2.3591naohiro ono
Problem: No event is triggered when closing a window. Solution: Add the WinClosed event. (Naohiro Ono, closes #9110)