Ben M. wrote: > On Wed, Apr 14, 2010 at 10:09 PM, Pavel Sanda wrote: > > attached is the patch implementing forward search. > > This news is very exciting for me!
i dont plan to backport, but there is hackish version for 1.6 in case you are interested in using it privately :) pavel
Index: src/LyXAction.cpp =================================================================== --- src/LyXAction.cpp (revision 34137) +++ src/LyXAction.cpp (working copy) @@ -265,6 +265,7 @@ * \endvar */ { LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop, Edit }, + { LFUN_FORWARD_SEARCH, "forward-search", ReadOnly, System }, /*! * \var lyx::FuncCode lyx::LFUN_ERT_INSERT * \li Action: Inserts an ERT inset. Index: src/LyXFunc.cpp =================================================================== --- src/LyXFunc.cpp (revision 34137) +++ src/LyXFunc.cpp (working copy) @@ -615,6 +615,7 @@ case LFUN_SERVER_GET_FILENAME: case LFUN_SERVER_NOTIFY: case LFUN_SERVER_GOTO_FILE_ROW: + case LFUN_FORWARD_SEARCH: case LFUN_DIALOG_HIDE: case LFUN_DIALOG_DISCONNECT_INSET: case LFUN_BUFFER_CHILD_OPEN: @@ -1237,6 +1238,16 @@ break; } + case LFUN_FORWARD_SEARCH: { + FileName const path(buffer->temppath()); + string const texname = addName(path.absFilename(), buffer->latexName()); + string const dviname = addName(path.absFilename(), support::changeExtension(buffer->latexName(), "dvi")); + int row = buffer->texrow().getRowFromIdPos(view()->cursor().paragraph().id(), view()->cursor().pos()); + string texrow = convert<string>(row); + string arg = "D . \"xdvi -sourceposition " + texrow + ":" + texname + " " + dviname + "\""; + lyx::dispatch(FuncRequest(LFUN_VC_COMMAND, arg)); + break; + } case LFUN_DIALOG_SHOW_NEW_INSET: { LASSERT(lyx_view_, /**/); Index: src/FuncCode.h =================================================================== --- src/FuncCode.h (revision 34137) +++ src/FuncCode.h (working copy) @@ -95,6 +95,7 @@ LFUN_LINE_END_SELECT, LFUN_WORD_FORWARD_SELECT, LFUN_WORD_BACKWARD_SELECT, + LFUN_FORWARD_SEARCH, // 55 LFUN_WORD_SELECT, LFUN_BUFFER_BEGIN_SELECT, Index: lib/ui/stdcontext.inc =================================================================== --- lib/ui/stdcontext.inc (revision 34137) +++ lib/ui/stdcontext.inc (working copy) @@ -284,6 +284,7 @@ Submenu "Paste Recent|e" "edit_pasterecent" Separator Item "Jump Back to Saved Bookmark|B" "bookmark-goto 0" + Item "Forward search|F" "forward-search" Separator Item "Move Paragraph Up|o" "paragraph-move-up" Item "Move Paragraph Down|v" "paragraph-move-down"