mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 7.4.2010
Problem: There is a :cbottom command but no :lbottom command. Solution: Add :lbottom. (Yegappan Lakshmanan)
This commit is contained in:
@@ -1139,6 +1139,7 @@ tag command action ~
|
|||||||
|:caddfile| :caddf[ile] add error message to current quickfix list
|
|:caddfile| :caddf[ile] add error message to current quickfix list
|
||||||
|:call| :cal[l] call a function
|
|:call| :cal[l] call a function
|
||||||
|:catch| :cat[ch] part of a :try command
|
|:catch| :cat[ch] part of a :try command
|
||||||
|
|:cbottom| :cbo[ttom] scroll to the bottom of the quickfix window
|
||||||
|:cbuffer| :cb[uffer] parse error messages and jump to first error
|
|:cbuffer| :cb[uffer] parse error messages and jump to first error
|
||||||
|:cc| :cc go to specific error
|
|:cc| :cc go to specific error
|
||||||
|:cclose| :ccl[ose] close quickfix window
|
|:cclose| :ccl[ose] close quickfix window
|
||||||
@@ -1299,6 +1300,7 @@ tag command action ~
|
|||||||
|:last| :la[st] go to the last file in the argument list
|
|:last| :la[st] go to the last file in the argument list
|
||||||
|:language| :lan[guage] set the language (locale)
|
|:language| :lan[guage] set the language (locale)
|
||||||
|:later| :lat[er] go to newer change, redo
|
|:later| :lat[er] go to newer change, redo
|
||||||
|
|:lbottom| :lbo[ttom] scroll to the bottom of the location window
|
||||||
|:lbuffer| :lb[uffer] parse locations and jump to first location
|
|:lbuffer| :lb[uffer] parse locations and jump to first location
|
||||||
|:lcd| :lc[d] change directory locally
|
|:lcd| :lc[d] change directory locally
|
||||||
|:lchdir| :lch[dir] change directory locally
|
|:lchdir| :lch[dir] change directory locally
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
*quickfix.txt* For Vim version 7.4. Last change: 2016 Jul 02
|
*quickfix.txt* For Vim version 7.4. Last change: 2016 Jul 07
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -437,12 +437,17 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
|||||||
:lw[indow] [height] Same as ":cwindow", except use the window showing the
|
:lw[indow] [height] Same as ":cwindow", except use the window showing the
|
||||||
location list for the current window.
|
location list for the current window.
|
||||||
|
|
||||||
|
*:cbo* *:cbottom*
|
||||||
:cbo[ttom] Put the cursor in the last line of the quickfix window
|
:cbo[ttom] Put the cursor in the last line of the quickfix window
|
||||||
and scroll to make it visible. This is useful for
|
and scroll to make it visible. This is useful for
|
||||||
when errors are added by an asynchronous callback.
|
when errors are added by an asynchronous callback.
|
||||||
Only call it once in a while if there are many
|
Only call it once in a while if there are many
|
||||||
updates to avoid a lot of redrawing.
|
updates to avoid a lot of redrawing.
|
||||||
|
|
||||||
|
*:lbo* *:lbottom*
|
||||||
|
:lbo[ttom] Same as ":cbottom", except use the window showing the
|
||||||
|
location list for the current window.
|
||||||
|
|
||||||
Normally the quickfix window is at the bottom of the screen. If there are
|
Normally the quickfix window is at the bottom of the screen. If there are
|
||||||
vertical splits, it's at the bottom of the rightmost column of windows. To
|
vertical splits, it's at the bottom of the rightmost column of windows. To
|
||||||
make it always occupy the full width: >
|
make it always occupy the full width: >
|
||||||
|
@@ -724,6 +724,9 @@ EX(CMD_laddfile, "laddfile", ex_cfile,
|
|||||||
EX(CMD_later, "later", ex_later,
|
EX(CMD_later, "later", ex_later,
|
||||||
TRLBAR|EXTRA|NOSPC|CMDWIN,
|
TRLBAR|EXTRA|NOSPC|CMDWIN,
|
||||||
ADDR_LINES),
|
ADDR_LINES),
|
||||||
|
EX(CMD_lbottom, "lbottom", ex_cbottom,
|
||||||
|
TRLBAR,
|
||||||
|
ADDR_LINES),
|
||||||
EX(CMD_lbuffer, "lbuffer", ex_cbuffer,
|
EX(CMD_lbuffer, "lbuffer", ex_cbuffer,
|
||||||
BANG|RANGE|NOTADR|WORD1|TRLBAR,
|
BANG|RANGE|NOTADR|WORD1|TRLBAR,
|
||||||
ADDR_LINES),
|
ADDR_LINES),
|
||||||
|
@@ -2831,13 +2831,25 @@ qf_win_goto(win_T *win, linenr_T lnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* :cbottom command.
|
* :cbottom/:lbottom commands.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ex_cbottom(exarg_T *eap UNUSED)
|
ex_cbottom(exarg_T *eap UNUSED)
|
||||||
{
|
{
|
||||||
win_T *win = qf_find_win(&ql_info);
|
qf_info_T *qi = &ql_info;
|
||||||
|
win_T *win;
|
||||||
|
|
||||||
|
if (eap->cmdidx == CMD_lbottom)
|
||||||
|
{
|
||||||
|
qi = GET_LOC_LIST(curwin);
|
||||||
|
if (qi == NULL)
|
||||||
|
{
|
||||||
|
EMSG(_(e_loclist));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
win = qf_find_win(qi);
|
||||||
if (win != NULL && win->w_cursor.lnum != win->w_buffer->b_ml.ml_line_count)
|
if (win != NULL && win->w_cursor.lnum != win->w_buffer->b_ml.ml_line_count)
|
||||||
qf_win_goto(win, win->w_buffer->b_ml.ml_line_count);
|
qf_win_goto(win, win->w_buffer->b_ml.ml_line_count);
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,7 @@ function! s:setup_commands(cchar)
|
|||||||
command! -nargs=* Xnewer <mods>cnewer <args>
|
command! -nargs=* Xnewer <mods>cnewer <args>
|
||||||
command! -nargs=* Xopen <mods>copen <args>
|
command! -nargs=* Xopen <mods>copen <args>
|
||||||
command! -nargs=* Xwindow <mods>cwindow <args>
|
command! -nargs=* Xwindow <mods>cwindow <args>
|
||||||
|
command! -nargs=* Xbottom <mods>cbottom <args>
|
||||||
command! -nargs=* Xclose <mods>cclose <args>
|
command! -nargs=* Xclose <mods>cclose <args>
|
||||||
command! -nargs=* -bang Xfile <mods>cfile<bang> <args>
|
command! -nargs=* -bang Xfile <mods>cfile<bang> <args>
|
||||||
command! -nargs=* Xgetfile <mods>cgetfile <args>
|
command! -nargs=* Xgetfile <mods>cgetfile <args>
|
||||||
@@ -44,6 +45,7 @@ function! s:setup_commands(cchar)
|
|||||||
command! -nargs=* Xnewer <mods>lnewer <args>
|
command! -nargs=* Xnewer <mods>lnewer <args>
|
||||||
command! -nargs=* Xopen <mods>lopen <args>
|
command! -nargs=* Xopen <mods>lopen <args>
|
||||||
command! -nargs=* Xwindow <mods>lwindow <args>
|
command! -nargs=* Xwindow <mods>lwindow <args>
|
||||||
|
command! -nargs=* Xbottom <mods>lbottom <args>
|
||||||
command! -nargs=* Xclose <mods>lclose <args>
|
command! -nargs=* Xclose <mods>lclose <args>
|
||||||
command! -nargs=* -bang Xfile <mods>lfile<bang> <args>
|
command! -nargs=* -bang Xfile <mods>lfile<bang> <args>
|
||||||
command! -nargs=* Xgetfile <mods>lgetfile <args>
|
command! -nargs=* Xgetfile <mods>lgetfile <args>
|
||||||
@@ -200,6 +202,7 @@ function XwindowTests(cchar)
|
|||||||
Xwindow
|
Xwindow
|
||||||
call assert_true(winnr('$') == 2 && winnr() == 2 &&
|
call assert_true(winnr('$') == 2 && winnr() == 2 &&
|
||||||
\ getline('.') ==# 'Xtestfile1|1 col 3| Line1')
|
\ getline('.') ==# 'Xtestfile1|1 col 3| Line1')
|
||||||
|
redraw!
|
||||||
|
|
||||||
" Close the window
|
" Close the window
|
||||||
Xclose
|
Xclose
|
||||||
@@ -1415,15 +1418,23 @@ echo string(loc_two)
|
|||||||
call delete('Xtwo', 'rf')
|
call delete('Xtwo', 'rf')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
function Test_cbottom()
|
function XbottomTests(cchar)
|
||||||
call setqflist([{'filename': 'foo', 'lnum': 42}])
|
call s:setup_commands(a:cchar)
|
||||||
copen
|
|
||||||
|
call g:Xsetlist([{'filename': 'foo', 'lnum': 42}])
|
||||||
|
Xopen
|
||||||
let wid = win_getid()
|
let wid = win_getid()
|
||||||
call assert_equal(1, line('.'))
|
call assert_equal(1, line('.'))
|
||||||
wincmd w
|
wincmd w
|
||||||
call setqflist([{'filename': 'var', 'lnum': 24}], 'a')
|
call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a')
|
||||||
cbottom
|
Xbottom
|
||||||
call win_gotoid(wid)
|
call win_gotoid(wid)
|
||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
cclose
|
Xclose
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Tests for the :cbottom and :lbottom commands
|
||||||
|
function Test_cbottom()
|
||||||
|
call XbottomTests('c')
|
||||||
|
call XbottomTests('l')
|
||||||
|
endfunction
|
||||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2010,
|
||||||
/**/
|
/**/
|
||||||
2009,
|
2009,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user