mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-22 10:58:59 +00:00
Add toggle-multi-line action
This commit is contained in:
parent
0167691941
commit
e60a9a628b
@ -59,73 +59,74 @@ func _() {
|
||||
_ = x[actToggleTrackCurrent-48]
|
||||
_ = x[actToggleHeader-49]
|
||||
_ = x[actToggleWrap-50]
|
||||
_ = x[actTrackCurrent-51]
|
||||
_ = x[actUntrackCurrent-52]
|
||||
_ = x[actDown-53]
|
||||
_ = x[actUp-54]
|
||||
_ = x[actPageUp-55]
|
||||
_ = x[actPageDown-56]
|
||||
_ = x[actPosition-57]
|
||||
_ = x[actHalfPageUp-58]
|
||||
_ = x[actHalfPageDown-59]
|
||||
_ = x[actOffsetUp-60]
|
||||
_ = x[actOffsetDown-61]
|
||||
_ = x[actOffsetMiddle-62]
|
||||
_ = x[actJump-63]
|
||||
_ = x[actJumpAccept-64]
|
||||
_ = x[actPrintQuery-65]
|
||||
_ = x[actRefreshPreview-66]
|
||||
_ = x[actReplaceQuery-67]
|
||||
_ = x[actToggleSort-68]
|
||||
_ = x[actShowPreview-69]
|
||||
_ = x[actHidePreview-70]
|
||||
_ = x[actTogglePreview-71]
|
||||
_ = x[actTogglePreviewWrap-72]
|
||||
_ = x[actTransform-73]
|
||||
_ = x[actTransformBorderLabel-74]
|
||||
_ = x[actTransformHeader-75]
|
||||
_ = x[actTransformPreviewLabel-76]
|
||||
_ = x[actTransformPrompt-77]
|
||||
_ = x[actTransformQuery-78]
|
||||
_ = x[actPreview-79]
|
||||
_ = x[actChangePreview-80]
|
||||
_ = x[actChangePreviewWindow-81]
|
||||
_ = x[actPreviewTop-82]
|
||||
_ = x[actPreviewBottom-83]
|
||||
_ = x[actPreviewUp-84]
|
||||
_ = x[actPreviewDown-85]
|
||||
_ = x[actPreviewPageUp-86]
|
||||
_ = x[actPreviewPageDown-87]
|
||||
_ = x[actPreviewHalfPageUp-88]
|
||||
_ = x[actPreviewHalfPageDown-89]
|
||||
_ = x[actPrevHistory-90]
|
||||
_ = x[actPrevSelected-91]
|
||||
_ = x[actPrint-92]
|
||||
_ = x[actPut-93]
|
||||
_ = x[actNextHistory-94]
|
||||
_ = x[actNextSelected-95]
|
||||
_ = x[actExecute-96]
|
||||
_ = x[actExecuteSilent-97]
|
||||
_ = x[actExecuteMulti-98]
|
||||
_ = x[actSigStop-99]
|
||||
_ = x[actFirst-100]
|
||||
_ = x[actLast-101]
|
||||
_ = x[actReload-102]
|
||||
_ = x[actReloadSync-103]
|
||||
_ = x[actDisableSearch-104]
|
||||
_ = x[actEnableSearch-105]
|
||||
_ = x[actSelect-106]
|
||||
_ = x[actDeselect-107]
|
||||
_ = x[actUnbind-108]
|
||||
_ = x[actRebind-109]
|
||||
_ = x[actBecome-110]
|
||||
_ = x[actShowHeader-111]
|
||||
_ = x[actHideHeader-112]
|
||||
_ = x[actToggleMultiLine-51]
|
||||
_ = x[actTrackCurrent-52]
|
||||
_ = x[actUntrackCurrent-53]
|
||||
_ = x[actDown-54]
|
||||
_ = x[actUp-55]
|
||||
_ = x[actPageUp-56]
|
||||
_ = x[actPageDown-57]
|
||||
_ = x[actPosition-58]
|
||||
_ = x[actHalfPageUp-59]
|
||||
_ = x[actHalfPageDown-60]
|
||||
_ = x[actOffsetUp-61]
|
||||
_ = x[actOffsetDown-62]
|
||||
_ = x[actOffsetMiddle-63]
|
||||
_ = x[actJump-64]
|
||||
_ = x[actJumpAccept-65]
|
||||
_ = x[actPrintQuery-66]
|
||||
_ = x[actRefreshPreview-67]
|
||||
_ = x[actReplaceQuery-68]
|
||||
_ = x[actToggleSort-69]
|
||||
_ = x[actShowPreview-70]
|
||||
_ = x[actHidePreview-71]
|
||||
_ = x[actTogglePreview-72]
|
||||
_ = x[actTogglePreviewWrap-73]
|
||||
_ = x[actTransform-74]
|
||||
_ = x[actTransformBorderLabel-75]
|
||||
_ = x[actTransformHeader-76]
|
||||
_ = x[actTransformPreviewLabel-77]
|
||||
_ = x[actTransformPrompt-78]
|
||||
_ = x[actTransformQuery-79]
|
||||
_ = x[actPreview-80]
|
||||
_ = x[actChangePreview-81]
|
||||
_ = x[actChangePreviewWindow-82]
|
||||
_ = x[actPreviewTop-83]
|
||||
_ = x[actPreviewBottom-84]
|
||||
_ = x[actPreviewUp-85]
|
||||
_ = x[actPreviewDown-86]
|
||||
_ = x[actPreviewPageUp-87]
|
||||
_ = x[actPreviewPageDown-88]
|
||||
_ = x[actPreviewHalfPageUp-89]
|
||||
_ = x[actPreviewHalfPageDown-90]
|
||||
_ = x[actPrevHistory-91]
|
||||
_ = x[actPrevSelected-92]
|
||||
_ = x[actPrint-93]
|
||||
_ = x[actPut-94]
|
||||
_ = x[actNextHistory-95]
|
||||
_ = x[actNextSelected-96]
|
||||
_ = x[actExecute-97]
|
||||
_ = x[actExecuteSilent-98]
|
||||
_ = x[actExecuteMulti-99]
|
||||
_ = x[actSigStop-100]
|
||||
_ = x[actFirst-101]
|
||||
_ = x[actLast-102]
|
||||
_ = x[actReload-103]
|
||||
_ = x[actReloadSync-104]
|
||||
_ = x[actDisableSearch-105]
|
||||
_ = x[actEnableSearch-106]
|
||||
_ = x[actSelect-107]
|
||||
_ = x[actDeselect-108]
|
||||
_ = x[actUnbind-109]
|
||||
_ = x[actRebind-110]
|
||||
_ = x[actBecome-111]
|
||||
_ = x[actShowHeader-112]
|
||||
_ = x[actHideHeader-113]
|
||||
}
|
||||
|
||||
const _actionType_name = "actIgnoreactStartactClickactInvalidactCharactMouseactBeginningOfLineactAbortactAcceptactAcceptNonEmptyactAcceptOrPrintQueryactBackwardCharactBackwardDeleteCharactBackwardDeleteCharEofactBackwardWordactCancelactChangeBorderLabelactChangeHeaderactChangeMultiactChangePreviewLabelactChangePromptactChangeQueryactClearScreenactClearQueryactClearSelectionactCloseactDeleteCharactDeleteCharEofactEndOfLineactFatalactForwardCharactForwardWordactKillLineactKillWordactUnixLineDiscardactUnixWordRuboutactYankactBackwardKillWordactSelectAllactDeselectAllactToggleactToggleSearchactToggleAllactToggleDownactToggleUpactToggleInactToggleOutactToggleTrackactToggleTrackCurrentactToggleHeaderactToggleWrapactTrackCurrentactUntrackCurrentactDownactUpactPageUpactPageDownactPositionactHalfPageUpactHalfPageDownactOffsetUpactOffsetDownactOffsetMiddleactJumpactJumpAcceptactPrintQueryactRefreshPreviewactReplaceQueryactToggleSortactShowPreviewactHidePreviewactTogglePreviewactTogglePreviewWrapactTransformactTransformBorderLabelactTransformHeaderactTransformPreviewLabelactTransformPromptactTransformQueryactPreviewactChangePreviewactChangePreviewWindowactPreviewTopactPreviewBottomactPreviewUpactPreviewDownactPreviewPageUpactPreviewPageDownactPreviewHalfPageUpactPreviewHalfPageDownactPrevHistoryactPrevSelectedactPrintactPutactNextHistoryactNextSelectedactExecuteactExecuteSilentactExecuteMultiactSigStopactFirstactLastactReloadactReloadSyncactDisableSearchactEnableSearchactSelectactDeselectactUnbindactRebindactBecomeactShowHeaderactHideHeader"
|
||||
const _actionType_name = "actIgnoreactStartactClickactInvalidactCharactMouseactBeginningOfLineactAbortactAcceptactAcceptNonEmptyactAcceptOrPrintQueryactBackwardCharactBackwardDeleteCharactBackwardDeleteCharEofactBackwardWordactCancelactChangeBorderLabelactChangeHeaderactChangeMultiactChangePreviewLabelactChangePromptactChangeQueryactClearScreenactClearQueryactClearSelectionactCloseactDeleteCharactDeleteCharEofactEndOfLineactFatalactForwardCharactForwardWordactKillLineactKillWordactUnixLineDiscardactUnixWordRuboutactYankactBackwardKillWordactSelectAllactDeselectAllactToggleactToggleSearchactToggleAllactToggleDownactToggleUpactToggleInactToggleOutactToggleTrackactToggleTrackCurrentactToggleHeaderactToggleWrapactToggleMultiLineactTrackCurrentactUntrackCurrentactDownactUpactPageUpactPageDownactPositionactHalfPageUpactHalfPageDownactOffsetUpactOffsetDownactOffsetMiddleactJumpactJumpAcceptactPrintQueryactRefreshPreviewactReplaceQueryactToggleSortactShowPreviewactHidePreviewactTogglePreviewactTogglePreviewWrapactTransformactTransformBorderLabelactTransformHeaderactTransformPreviewLabelactTransformPromptactTransformQueryactPreviewactChangePreviewactChangePreviewWindowactPreviewTopactPreviewBottomactPreviewUpactPreviewDownactPreviewPageUpactPreviewPageDownactPreviewHalfPageUpactPreviewHalfPageDownactPrevHistoryactPrevSelectedactPrintactPutactNextHistoryactNextSelectedactExecuteactExecuteSilentactExecuteMultiactSigStopactFirstactLastactReloadactReloadSyncactDisableSearchactEnableSearchactSelectactDeselectactUnbindactRebindactBecomeactShowHeaderactHideHeader"
|
||||
|
||||
var _actionType_index = [...]uint16{0, 9, 17, 25, 35, 42, 50, 68, 76, 85, 102, 123, 138, 159, 183, 198, 207, 227, 242, 256, 277, 292, 306, 320, 333, 350, 358, 371, 387, 399, 407, 421, 435, 446, 457, 475, 492, 499, 518, 530, 544, 553, 568, 580, 593, 604, 615, 627, 641, 662, 677, 690, 705, 722, 729, 734, 743, 754, 765, 778, 793, 804, 817, 832, 839, 852, 865, 882, 897, 910, 924, 938, 954, 974, 986, 1009, 1027, 1051, 1069, 1086, 1096, 1112, 1134, 1147, 1163, 1175, 1189, 1205, 1223, 1243, 1265, 1279, 1294, 1302, 1308, 1322, 1337, 1347, 1363, 1378, 1388, 1396, 1403, 1412, 1425, 1441, 1456, 1465, 1476, 1485, 1494, 1503, 1516, 1529}
|
||||
var _actionType_index = [...]uint16{0, 9, 17, 25, 35, 42, 50, 68, 76, 85, 102, 123, 138, 159, 183, 198, 207, 227, 242, 256, 277, 292, 306, 320, 333, 350, 358, 371, 387, 399, 407, 421, 435, 446, 457, 475, 492, 499, 518, 530, 544, 553, 568, 580, 593, 604, 615, 627, 641, 662, 677, 690, 708, 723, 740, 747, 752, 761, 772, 783, 796, 811, 822, 835, 850, 857, 870, 883, 900, 915, 928, 942, 956, 972, 992, 1004, 1027, 1045, 1069, 1087, 1104, 1114, 1130, 1152, 1165, 1181, 1193, 1207, 1223, 1241, 1261, 1283, 1297, 1312, 1320, 1326, 1340, 1355, 1365, 1381, 1396, 1406, 1414, 1421, 1430, 1443, 1459, 1474, 1483, 1494, 1503, 1512, 1521, 1534, 1547}
|
||||
|
||||
func (i actionType) String() string {
|
||||
if i < 0 || i >= actionType(len(_actionType_index)-1) {
|
||||
|
@ -1431,6 +1431,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA
|
||||
appendAction(actToggleHeader)
|
||||
case "toggle-wrap":
|
||||
appendAction(actToggleWrap)
|
||||
case "toggle-multi-line":
|
||||
appendAction(actToggleMultiLine)
|
||||
case "show-header":
|
||||
appendAction(actShowHeader)
|
||||
case "hide-header":
|
||||
|
@ -463,6 +463,7 @@ const (
|
||||
actToggleTrackCurrent
|
||||
actToggleHeader
|
||||
actToggleWrap
|
||||
actToggleMultiLine
|
||||
actTrackCurrent
|
||||
actUntrackCurrent
|
||||
actDown
|
||||
@ -4639,6 +4640,9 @@ func (t *Terminal) Loop() error {
|
||||
case actToggleWrap:
|
||||
t.wrap = !t.wrap
|
||||
req(reqList, reqHeader)
|
||||
case actToggleMultiLine:
|
||||
t.multiLine = !t.multiLine
|
||||
req(reqList)
|
||||
case actTrackCurrent:
|
||||
if t.track == trackDisabled {
|
||||
t.track = trackCurrent
|
||||
|
@ -2133,7 +2133,11 @@ class TestGoFZF < TestBase
|
||||
end
|
||||
|
||||
def test_keep_right
|
||||
tmux.send_keys "seq 10000 | #{FZF} --read0 --keep-right --no-multi-line", :Enter
|
||||
tmux.send_keys "seq 10000 | #{FZF} --read0 --keep-right --no-multi-line --bind space:toggle-multi-line", :Enter
|
||||
tmux.until { |lines| assert lines.any_include?('9999␊10000') }
|
||||
tmux.send_keys :Space
|
||||
tmux.until { |lines| assert lines.any_include?('> 1') }
|
||||
tmux.send_keys :Space
|
||||
tmux.until { |lines| assert lines.any_include?('9999␊10000') }
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user