Skip to content

Commit

Permalink
Merge pull request #494 from rampitec/incsrch
Browse files Browse the repository at this point in the history
Incsrch
  • Loading branch information
elfmz committed Feb 10, 2019
2 parents 8bde931 + a7cea72 commit dc212d0
Show file tree
Hide file tree
Showing 42 changed files with 5,547 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ add_subdirectory (autowrap)
add_subdirectory (drawline)
add_subdirectory (editorcomp)
add_subdirectory (inside)
add_subdirectory (incsrch)

install(PROGRAMS "${INSTALL_DIR}/far2l" DESTINATION "bin" )

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DisableOutput
DWORD
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NoInsidePlugin
DWORD
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sequence
SZ
F11 I Home Down Down Enter\0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DisableOutput
DWORD
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sequence
SZ
F11 I Home Enter\0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DisableOutput
DWORD
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NoInsidePlugin
DWORD
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sequence
SZ
F11 I Home Down Down Down Enter\0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hotkey
SZ
I\0
40 changes: 40 additions & 0 deletions incsrch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

project(incsrch)

set(SOURCES
clip.c
control.c
incsrch.c
locale.c
search.c
util.c
)

add_library (incsrch MODULE ${SOURCES})

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined suppress")
endif()

target_link_libraries(incsrch utils)

target_compile_definitions(incsrch PRIVATE -DWINPORT_DIRECT -DUNICODE -DFAR_DONT_USE_INTERNALS)

target_include_directories(incsrch PRIVATE ../far2l)
target_include_directories(incsrch PRIVATE ../far2l/Include)
target_include_directories(incsrch PRIVATE ../WinPort)
target_include_directories(incsrch PRIVATE .)

set_target_properties(incsrch
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/incsrch/plug"
PREFIX ""
SUFFIX ".far-plug-wide")


add_custom_command(TARGET incsrch POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/ENG/isrceng.lng "${INSTALL_DIR}/Plugins/incsrch/plug"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/UTF8/isrcrus.lng "${INSTALL_DIR}/Plugins/incsrch/plug"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/ENG/incsrche.hlf "${INSTALL_DIR}/Plugins/incsrch/plug"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/UTF8/incsrchr.hlf "${INSTALL_DIR}/Plugins/incsrch/plug"
)
124 changes: 124 additions & 0 deletions incsrch/ENG/incsrche.hlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
.Language=English,English
.PluginContents=Incremental Search

@Contents
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#Contents
This plugin adds the #Incremental Search# capability to the internal FAR editor.

To access this module open plugins menu (F11) from the editor window. Then choose the "Incremental Search" item. See further topics for more detail.

~Plugin menu~@Menu@

~Plugin configuration~@Cfg@

~Interface and Keyboard reference~@Iface@

~Contact information~@Contact@

@Menu
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#Plugin menu#
After choosing the plugin from editor plugins menu You will see the submenu like this:

@-
^
^
^
^
^
^
^
^
^
@+

Now You can select the option. First two will activate the incremental search in the chosen direction respectively. See ~Interface and Keyboard reference~@Iface@ topic for the key bindings of this mode.

Note that activating this menu again You will have the cursor selecting the #last search direction# used.

#Find selected# mode is used to locate the next occurrence of the text selected with a block. Does nothing if there is no block selected. Otherwise starts search as if "Use selected block" and "Auto next selected block" options has been set and terminates plugin after search is completed.

~Configure...~@Cfg@ option will give You the opportunity to setup the plugin. After configuration made You will get back current menu.

~Contents~@Contents@

@Cfg
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#Plugin configuration#
There are two ways to configure plugin: from #Plugins configuration menu# (Main Menu|Options|Plugins Configuration|Incremental Search) or directly from ~Incremental Search plugin menu~@Menu@ from inside editor.

Configuration dialog has following options:

@-
^
^
^
^
^
^
^
^
^
^
^
@+

#Case sensitive# - Search for case sensitive text.
#Restart search beyond EOF# - Plugin will continue to search for the string from the beginning of file if searching forward or from the end of file if searching backward up to the current match if pattern was not found.
#Keep selection# - After search is finished upon plugin completion found text will remain selected.
#Beep on mismatch# - Make a beep if pattern was not found.
#Use selected block# - Initialize search pattern with a block selected, if any. Line containing the selection must be the current line. If block has more than one line only the current one will be used.
#Auto next selected block# - If block contents were used to initialize the pattern, search will be started immediately with this option.
#Backspace unroll# - Restore previous editor position on backspace.

#Ok# button will save the settings to the registry immediately.

~Contents~@Contents@

@Iface
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#Interface and Keyboard reference#
When in incremental search mode the leftmost characters of the top line will display the prompt #^:#. Start typing the search string and it will be displayed after this prompt.

When found the match will be scrolled to view in editor and selected with a block. Message #[Not found]# will be displayed at the editor's status line otherwise. After succeeded search, which was crossing end or beginning of file, the #[EOF]# or #[BOF]# message will be displayed at status line.

Any character, which is neither a possible pattern symbol nor a plugin's control key, will be bypassed to FAR which will terminate plugin.
@-
^#Key bindings#
@+

#Any printable character# appended to the search pattern
#Backspace# delete last pattern character
#Escape# ends incremental search
#Ctrl-V, Shift-Ins# paste search data from clipboard
#Ctrl-Enter# find next in forward search mode
find previous in backward search mode
#Ctrl-Shift-Enter# find previous in forward search mode
find next in backward search mode
#F1# about window and help
#Alt# clear messages area
#Any control character,# ends incremental search and bypass to FAR
#mouse click#

~Contents~@Contents@

@Contact
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#Contact information#

Stanislav V. Mekhanoshin, St.Petersburg, Russia

#http://rampitec.us.to#

~Contents~@Contents@
24 changes: 24 additions & 0 deletions incsrch/ENG/isrceng.lng
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.Language=English,English

"Incremental Search"

"Ok"
"Cancel"

"Search &Forward"
"Search &Backward"
"Find Selected &Next"
"Find Selected &Previous"
"&Configure..."

"&Case sensitive"
"&Keep selection"
"&Beep on mismatch"
"&Restart search beyond EOF"
"&Use selected block"
"&Auto next selected block"
"Backspace u&nroll"

"[EOF]"
"[BOF]"
"[Not found]"
17 changes: 17 additions & 0 deletions incsrch/ENG/whatsnew.eng
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Версия 2.1
+ far2l (FAR for Linux) support

Version 1.21

% support for key event during macro playback for FAR 1.70.a6.1661 or
higher.

Version 1.2

+ added "Backspace unroll" option to restore previous editor position
on backspace.

Version 1.1

+ added ^V or #Ins to paste search data from clipboard when in search
mode.
125 changes: 125 additions & 0 deletions incsrch/OEM/incsrchr.hlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.Language=Russian,Russian (���᪨�)
.PluginContents=������ ���� � ।����

@Contents
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#����ঠ���
����� ������ �������� ����������� #����ண� ���᪠# (#incremental search#) �� ���஥���� ।���� FAR.

��� ����祭�� ����㯠 � ����� ��ன� ���� �������� (F11) ।����. �롥�� �㭪� "������ ����". ��. ��稥 ⥬� ����� ��� ����祭�� ��⠫���஢����� ���ଠ樨.

~���� �������~@Menu@

~����ன�� �������~@Cfg@

~����䥩� � ���������� �������~@Iface@

~�� ����~@Contact@

@Menu
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#���� �������#
��᫥ ⮣� ��� �� ��ࠫ� ������ �� ���� �������� ।����, ��। ���� ����� ������� ᫥���饣� ����:

@-
^ ��������� ������ ���� �������ͻ
^ � ���� #�#��। �
^ � ���� #�#���� �
^ �������������������������������Ķ
^ � ���� #�#�����饥 �뤥������ �
^ � ���� #�#।��饥 �뤥������ �
^ �������������������������������Ķ
^ � �#�#��ன��... �
^ �������������������������������ͼ
@+

�롥�� ����. ���� ��� ����� ������ ���� � �������� ���ࠢ�����. ��. ⥬� ~"����䥩� � ���������� �������"~@Iface@, ��� ��������� ࠡ�� � ������ ०���.

����� ��������, �� �� ����୮� �室� � ���� ������� ����� �������� �� #��᫥���� ��࠭��� ���ࠢ����� ���᪠#.

#���� �뤥������# �ᯮ������ ��� ���᪠ ᫥���饣� �宦����� ⥪��, �뤥������� ������. �᫨ �뤥����� ���, ��祣� �� �㤥� ᤥ����. � ��⨢��� ��砥 �㤥� �����⢫�� ����, ��� �᫨ �� ��樨 "�ᯮ�짮���� �뤥����� ����" � "��⮯��� ᫥���饣� �����" �뫨 ��࠭� �� ����ன��, � ����뢠�� ������ ��᫥ �����襭�� ���᪠.

�㭪� ���� ~"����ன��..."~@Cfg@ ���� ��� ����������� ����ன�� �������. ��᫥ �����襭�� ���䨣��樨 �� ����� �������� � ������ ����.
����������
~����ঠ���~@Contents@

@Cfg
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#����ன�� �������#
������� ��� ᯮᮡ� ����ன�� �������: �� #���� ����ன�� ��������# (�᭮���� ����|��ࠬ����|��ࠬ���� ���譨� ���㫥�|������ ����), ���� �����।�⢥��� �� ~���� �������~@Menu@, �맢������ � ।����.

������ ����ன��:

@-
^ ����������������� ������ ���� ����������������ͻ
^ � [ ] #�# ��⮬ ॣ���� �
^ � [ ] �த������ ���� �� #�#��殬 䠩�� �
^ � [ ] ���࠭��� #�#뤥����� �
^ � [ ] #�#�㪮��� ᨣ���, �᫨ ��ப� �� ������� �
^ � [ ] #�#ᯮ�짮���� �뤥����� ���� �
^ � [ ] #�#�⮯��� ᫥���饣� ����� �
^ � [ ] #�#������� �����頥� ������ �
^ ������������������������������������������������Ķ
^ � [ Ok ] [ �⬥���� ] �
^ ������������������������������������������������ͼ
@+

#� ��⮬ ॣ����# - ���� � ��⮬ ॣ���� ᨬ�����.
#�த������ ���� �� ���殬 䠩��# - ������ �த����� ���� �� ��砫� 䠩�� �� ���᪥ ���। ��� �� ���� �� ���᪥ ����� �� ⥪�饩 ��ப�, �᫨ ��ப� �� �㤥� ������� ࠭��.
#���࠭��� �뤥�����# - ��᫥ ����砭�� ���᪠, �� �����⨨ �������, ���筮� �뤥����� ���������� ⥪�� ��⠭����.
#��㪮��� ᨣ���, �᫨ ��ப� �� �������# - �������� ��㪮��� ᨣ���, �᫨ ��ப� �� �������.
#�ᯮ�짮���� �뤥����� ����# - ���樠����஢��� ��ப� ���᪠ ⥪�⮬ �뤥������� �����, �᫨ ���� �뤥�����. ��ப�, ᮤ�ঠ�� �뤥����� ������ ���� ⥪�饩 ��ப��. �᫨ � ����� ����� ����� ��ப�, �㤥� �ᯮ�짮���� �뤥����� � ⥪�饩 ��ப�.
#��⮯��� ᫥���饣� �����# - �᫨ ᮤ�ন��� ����� �뫮 �ᯮ�짮���� ��� ���樠����樨 ��ப� ���᪠, ���� �㤥� ���� ����������, �᫨ ������ ���� ��⠭������.
#�������� �����頥� ������# - �� 㤠����� ᨬ���� ��ப� ���᪠ ����⠭���������� ���� ������ ।����, ����� �뫠 �� ����� �⮣� ᨬ����.

������ #Ok# ��࠭�� ����ன�� � ॥��� ����������.
����������
~����ঠ���~@Contents@

@Iface
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#����䥩� � ���������� �������#
�� �室� � ०�� ���᪠ ����� ���� ���孥� ��ப� �㤥� ᮤ�ঠ�� ���᪠��� #^:#. ��筨� ����� �᪮��� ��ப�, � ��� ����� ��᫥ ������ ���᪠���.

��������� ��ப� �㤥� �������� � ।���� � �뤥���� ������. � ��⨢��� ��砥, � ��ப� ����� ।���� �㤥� �������� ᮮ�饭�� #[�� �������]#. ��᫥ �ᯥ譮�� ���᪠, ���ᥪ��饣� ����� ��� ��砫� 䠩��, � ��ப� ����� ����� ᮮ�饭�� #[EOF]# ��� #[BOF]#.

�� ᨬ���, ����� �� ���� �����⨬� ᨬ����� ��ப� ���᪠ ��� �ࠢ���饩 �����襩 �������, �㤥� ��।�� � FAR, � ࠡ�� ����� ���������.

@-
^#���⢥��⢨� ������#
@+

#�� ����� ᨬ���# ���������� � ��ப� ���᪠
#Backspace# 㤠��� ��᫥���� ᨬ��� ���᪠
#Escape# �����稢��� ����
#Ctrl-V, Shift-Ins# ��⠢��� ��ப� ���᪠ �� ����� ������
#Ctrl-Enter# ���� ᫥���饥 ᮢ������� �� ���᪥ ���।
���� �।��饥 ᮢ������� �� ���᪥ �����
#Ctrl-Shift-Enter# ���� �।��饥 ᮢ������� �� ���᪥ ���।
���� ᫥���饥 ᮢ������� �� ���᪥ �����
#F1# "� �ணࠬ��" � ������
#Alt# ������ ������� ᮮ�饭��
#�� �ࠢ���騩# �����蠥� ���� � ��।����� � FAR
#ᨬ���, ������ ���#
����������
~����ঠ���~@Contents@

@Contact
$^#Incremental Search FAR plugin#
$^#Version 2.1#
$^#Copyright (C) 1999-2019 Stanislav V. Mekhanoshin#
$^#�� ����#

�⠭�᫠� ��堭�設, ��.������, �����

#http://rampitec.us.to#
����������
~����ঠ���~@Contents@
Loading

0 comments on commit dc212d0

Please sign in to comment.