summaryrefslogtreecommitdiffstats
path: root/src/evalwindow.c
AgeCommit message (Collapse)Author
2024-03-12patch 9.1.0171: Small split-move related improvementsv9.1.0171Sean Dewar
Problem: small improvements can be made to split-move related functions. Solution: apply them (Sean Dewar): - Improve some doc comments (frame_flatten should still work for non-current tabpages, despite the topframe check, which looks benign, though I'm unsure if it's still needed; see #2467). - f_win_splitmove should check_split_disallowed on wp, not targetwin, as that's what win_splitmove checks (though it's probably unnecessary to check b_locked_split at all; see #14109, which I hope to get around to finishing at some point). - Make winframe_restore restore window positions for the altframe, which winframe_remove changes. This doesn't affect the prior behaviour, as we called win_comp_pos after, but as win_comp_pos only works for curtab, and winframe_remove supports non-current tabpages, we should undo it. Regardless, this should mean we don't need win_comp_pos anymore; adjust tests to check that window positions remain unchanged. I'm not sure win_comp_pos is needed after last_status anyway if it doesn't steal rows from another frame to make room for a new statusline, which shouldn't be the case after winframe_remove? To be safe, I'll leave it as is. closes: #14185 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12patch 9.1.0169: current window number returned by tabpagewinnr may be outdatedv9.1.0169Sean Dewar
Problem: current window number returned by tabpagewinnr may be outdated when called from win_execute for the original tabpage. Solution: update the original tabpage's tp_curwin in switch_win; use {un}use_tabpage instead. Don't do it in restore_win to ensure tp_curwin of the temporarily visited tabpage is unchanged from switch_win visiting it, as before. (Sean Dewar) Maybe restore_win should only restore tp_curwin if `curtab == switchwin->sw_curtab`, in case the user changed tabpages from within win_execute, but not doing that is consistent with the old behaviour. related: #14186 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22patch 9.1.0128: win_gotoid() may abort even when not switching a windowv9.1.0128Sean Dewar
Problem: win_gotoid() checks for textlock and other things when switching to a window that is already current (after v9.1.0119) Solution: return early with success when attempting to switch to curwin (Sean Dewar) Other potential causes of E565 from win_gotoid after v9.1.0119 should be correct. Plugins can consider using win_execute() instead if they wish to temporarily switch windows during textlock. fixes: #14073 closes: #14074 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20patch 9.1.0119: can move away from cmdwin using win_splitmove()v9.1.0119Sean Dewar
Problem: can switch windows while textlocked via f_win_gotoid and f_win_splitmove (which also allows switching in the cmdwin). Solution: Check text_or_buf_locked in f_win_splitmove() (Sean Dewar) While at it, call text_or_buf_locked() in f_win_gotoid() instead of testing for cmdwin_type() (which text_buf_locked() does and in addition will also verify that the buffer is not locked). closes: #14042 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20patch 9.1.0116: win_split_ins may not check available roomv9.1.0116Sean Dewar
Problem: win_split_ins has no check for E36 when moving an existing window Solution: check for room and fix the issues in f_win_splitmove() (Sean Dewar) win_split_ins has no check for E36 when moving an existing window, allowing for layouts with many overlapping zero-sized windows to be created (which may also cause drawing issues with tablines and such). f_win_splitmove also has some bugs. So check for room and fix the issues in f_win_splitmove. Handle failure in the two relevant win_split_ins callers by restoring the original layout, and factor the common logic into win_splitmove. Don't check for room when opening an autocommand window, as it's a temporary window that's rarely interacted with or drawn anyhow, and is rather important for some autocommands. Issues fixed in f_win_splitmove: - Error if splitting is disallowed. - Fix heap-use-after-frees if autocommands fired from switching to "targetwin" close "wp" or "oldwin". - Fix splitting the wrong window if autocommands fired from switching to "targetwin" switch to a different window. - Ensure -1 is returned for all errors. Also handle allocation failure a bit earlier in make_snapshot (callers, except win_splitmove, don't really care if a snapshot can't be made, so just ignore the return value). Note: Test_smoothscroll_in_zero_width_window failed after these changes with E36, as it was using the previous behaviour to create a zero-width window. I've fixed the test such that it fails with UBSAN as expected when v9.0.1367 is reverted (and simplified it too). related: #14042 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23patch 9.1.0047: issues with temp curwin/buf while cmdwin is openv9.1.0047Sean Dewar
Problem: Things that temporarily change/restore curwin/buf (e.g: win_execute, some autocmds) may break assumptions that curwin/buf is the cmdwin when "cmdwin_type != 0", causing issues. Solution: Expose the cmdwin's real win/buf and check that instead. Also try to ensure these variables are NULL if "cmdwin_type == 0", allowing them to be used directly in most cases without checking cmdwin_type. (Sean Dewar) Alternatively, we could ban win_execute in the cmdwin and audit all places that temporarily change/restore curwin/buf, but I didn't notice any problems arising from allowing this (standard cmdwin restrictions still apply, so things that may actually break the cmdwin are still forbidden). closes: #12819 Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
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)
2023-01-02patch 9.0.1132: code is indented more than neededv9.0.1132Yegappan Lakshmanan
Problem: Code is indented more than needed. Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan, closes #11769)
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-18patch 9.0.0904: various comment and indent flawsv9.0.0904Bram Moolenaar
Problem: Various comment and indent flaws. Solution: Improve comments and indenting.
2022-11-01patch 9.0.0824: crash when using win_move_separator() in other tab pagev9.0.0824zeertzjq
Problem: Crash when using win_move_separator() in other tab page. Solution: Check for valid window in current tab page. (closes #11479, closes #11427)
2022-10-31patch 9.0.0820: memory leak with empty shell commandv9.0.0821Bram Moolenaar
Problem: Memory leak with empty shell command. Solution: Free the empty string.
2022-10-04patch 9.0.0657: too many #ifdefsv9.0.0657Martin Tournoij
Problem: Too many #ifdefs. Solution: Graduate the +cmdwin feature. Now the tiny and small builds are equal, drop the small build. (Martin Tournoij, closes #11268)
2022-08-31patch 9.0.0338: return value of list_append_list() not always checkedv9.0.0338Bram Moolenaar
Problem: Return value of list_append_list() not always checked. Solution: Check return value and handle failure.
2022-08-30patch 9.0.0335: checks for Dictionary argument often give a vague errorv9.0.0335Yegappan Lakshmanan
Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
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-06-16patch 8.2.5107: some callers of rettv_list_alloc() check for not OKv8.2.5107Bram Moolenaar
Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value.
2022-05-09patch 8.2.4928: various white space and cosmetic mistakesv8.2.4928Bram Moolenaar
Problem: Various white space and cosmetic mistakes. Solution: Change spaces to tabs, improve comments.
2022-04-23patch 8.2.4814: possible to leave a popup window with win_gotoid()v8.2.4814LemonBoy
Problem: Possible to leave a popup window with win_gotoid(). Solution: Give an error when trying to leave a popup window with win_gotoid(). (closes #10253)
2022-04-20patch 8.2.4797: getwininfo() may get oudated valuesv8.2.4797LemonBoy
Problem: getwininfo() may get oudated values. Solution: Make sure w_botline is up-to-date. (closes #10226)
2022-04-18patch 8.2.4785: Visual mode not stopped if win_gotoid() goes to other bufferv8.2.4785Bram Moolenaar
Problem: Visual mode not stopped early enough if win_gotoid() goes to another buffer. (Sergey Vlasov) Solution: Stop Visual mode before jumping to another buffer. (closes #10217)
2022-04-04patch 8.2.4683: verbose check with dict_find() to see if a key is presentv8.2.4683Yegappan Lakshmanan
Problem: Verbose check with dict_find() to see if a key is present. Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
2022-01-11patch 8.2.4060: win_execute() slow on systems where getcwd()/chdir() is slowv8.2.4060Bram Moolenaar
Problem: win_execute() is slow on systems where getcwd() or chdir() is slow. (Rick Howe) Solution: Avoid using getcwd() and chdir() if no local directory is used and 'acd' is not set. (closes #9504)
2022-01-10patch 8.2.4052: not easy to resize a window from a pluginv8.2.4052Daniel Steinberg
Problem: Not easy to resize a window from a plugin. Solution: Add win_move_separator() and win_move_statusline() functions. (Daniel Steinberg, closes #9486)
2022-01-08patch 8.2.4043: using int for second argument of ga_init2()v8.2.4043Bram Moolenaar
Problem: Using int for second argument of ga_init2(). Solution: Remove unnessary type cast (int) when using sizeof().
2022-01-07patch 8.2.4026: ml_get error with specific win_execute() commandv8.2.4026Bram Moolenaar
Problem: ml_get error with specific win_execute() command. (Sean Dewar) Solution: Check cursor and Visual area are OK.
2022-01-06patch 8.2.4018: ml_get error when win_execute redraws with Visual selectionv8.2.4018Bram Moolenaar
Problem: ml_get error when win_execute redraws with Visual selection. Solution: Disable Visual area temporarily. (closes #9479)
2022-01-01patch 8.2.3972: error messages are spread outv8.2.3972Bram Moolenaar
Problem: Error messages are spread out. Solution: Move the last errors from globals.h 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-28patch 8.2.3926: build failure without the 'autochdir' optionv8.2.3926Bram Moolenaar
Problem: Build failure without the 'autochdir' option. (John Marriott) Solution: Add #ifdefs.
2021-12-28patch 8.2.3920: restoring directory after using another window is inefficientv8.2.3920Bram Moolenaar
Problem: Restoring directory after using another window is inefficient. Solution: Only restore the directory for win_execute(). Apply 'autochdir' only when needed.
2021-12-20patch 8.2.3862: crash on exit with EXITFREE and using win_execute()v8.2.3862Bram Moolenaar
Problem: Crash on exit with EXITFREE and using win_execute(). Solution: Also save and restore tp_topframe. (issue #9374)
2021-11-20patch 8.2.3627: difficult to know where the text starts in a windowv8.2.3627Bram Moolenaar
Problem: difficult to know where the text starts in a window. (Sergey Vlasov) Solution: Add the "textoff" entry in the result of getwininfo(). (closes #9163)
2021-11-14patch 8.2.3593: directory is wrong after executing "lcd" with win_execute()v8.2.3593Bram Moolenaar
Problem: Directory is wrong after executing "lcd" with win_execute(). Solution: Correct the directory when going back to the original window. (closes #9132)
2021-07-31patch 8.2.3254: win_gettype() does not recognize a quickfix windowv8.2.3254Yegappan Lakshmanan
Problem: win_gettype() does not recognize a quickfix window. Solution: Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes #8676)
2021-07-27patch 8.2.3229: Vim9: runtime and compile time type checks are not the samev8.2.3229Yegappan Lakshmanan
Problem: Vim9: runtime and compile time type checks are not the same. Solution: Add more runtime type checks for builtin functions. (Yegappan Lakshmanan, closes #8646)
2021-07-20patch 8.2.3188: Vim9: argument types are not checked at compile timev8.2.3188Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks, also at runtime. (Yegappan Lakshmanan, closes #8587)
2021-07-15patch 8.2.3162: Vim9: argument types are not checked at compile timev8.2.3162Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes #8560)
2021-06-27patch 8.2.3069: error messages are spread outv8.2.3069Bram Moolenaar
Problem: Error messages are spread out. Solution: Move some error messages to errors.h. Use clearer names.
2021-03-20patch 8.2.2631: commands from winrestcmd() do not always work properlyv8.2.2631Bram Moolenaar
Problem: Commands from winrestcmd() do not always work properly. (Leonid V. Fedorenchik) Solution: Repeat the size commands twice. (closes #7988)
2021-01-12patch 8.2.2340: win_execute() unexpectedly returns number zero when failingv8.2.2340Bram Moolenaar
Problem: win_execute() unexpectedly returns number zero when failing. Solution: Return an empty string. (closes #7665)
2020-12-29patch 8.2.2245: Vim9: return value of winrestcmd() cannot be executedv8.2.2245Bram Moolenaar
Problem: Vim9: return value of winrestcmd() cannot be executed. Solution: Put colons before each range. (closes #7571)
2020-09-22patch 8.2.1727: a popup created with "cursorline" will ignore "firstline"v8.2.1727Bram Moolenaar
Problem: A popup created with "cursorline" will ignore "firstline". Solution: When both "cursorline" and "firstline" are present put the cursor on "firstline". (closes #7000) Add the "winid" argument to getcurpos().
2020-09-05patch 8.2.1617: Vim9: cannot pass "true" to win_splitmove()v8.2.1617Bram Moolenaar
Problem: Vim9: cannot pass "true" to win_splitmove(). Solution: Use dict_get_bool(). (closes #6862) Alphabetize test functions.
2020-09-03patch 8.2.1581: using line() for global popup window doesn't workv8.2.1581Bram Moolenaar
Problem: Using line() for global popup window doesn't work. Solution: Set tabpage to "curtab". (closes #6847)
2020-08-09patch 8.2.1401: cannot jump to the last used tabpagev8.2.1401Bram Moolenaar
Problem: Cannot jump to the last used tabpage. Solution: Add g<Tab> and tabpagnr('#'). (Yegappan Lakshmanan, closes #6661, neovim #11626)
2020-06-17patch 8.2.0996: using "aucmdwin" in win_gettype() is not idealv8.2.0996Bram Moolenaar
Problem: Using "aucmdwin" in win_gettype() is not ideal. Solution: Rename to "autocmd".
2020-06-16patch 8.2.0991: cannot get window type for autocmd and preview windowv8.2.0991Bram Moolenaar
Problem: Cannot get window type for autocmd and preview window. Solution: Add types to win_gettype(). (Yegappan Lakshmanan, closes #6277)
2020-04-06patch 8.2.0523: loops are repeatedv8.2.0523Bram Moolenaar
Problem: Loops are repeated. Solution: Use FOR_ALL_ macros. (Yegappan Lakshmanan, closes #5882)
2020-04-02patch 8.2.0500: using the same loop in many placesv8.2.0500Bram Moolenaar
Problem: Using the same loop in many places. Solution: Define more FOR_ALL macros. (Yegappan Lakshmanan, closes #5339)