summaryrefslogtreecommitdiffstats
path: root/runtime/menu.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-28 21:41:49 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-28 21:41:49 +0200
commitb45cd36bd90f71e4a35b1ef1f75a3bedef6d8bac (patch)
treee54b2f8e7601e36624d4677732d642c335eb4d1e /runtime/menu.vim
parent727345ebea07284ada118590d805329e6dbee014 (diff)
patch 8.2.1768: cannot use the help menu from a terminal windowv8.2.1768
Problem: Cannot use the help menu from a terminal window. Solution: Add ":tlnoremenu" commands. (Yee Cheng Chin, closes #7023)
Diffstat (limited to 'runtime/menu.vim')
-rw-r--r--runtime/menu.vim17
1 files changed, 16 insertions, 1 deletions
diff --git a/runtime/menu.vim b/runtime/menu.vim
index 60e956c08b..e17652432d 100644
--- a/runtime/menu.vim
+++ b/runtime/menu.vim
@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Mar 29
+" Last Change: 2020 Sep 28
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user.
@@ -89,6 +89,21 @@ an 9999.75 &Help.-sep2- <Nop>
an 9999.80 &Help.&Version :version<CR>
an 9999.90 &Help.&About :intro<CR>
+if exists(':tlmenu')
+ tlnoremenu 9999.10 &Help.&Overview<Tab><F1> <C-W>:help<CR>
+ tlnoremenu 9999.20 &Help.&User\ Manual <C-W>:help usr_toc<CR>
+ tlnoremenu 9999.30 &Help.&How-To\ Links <C-W>:help how-to<CR>
+ tlnoremenu <silent> 9999.40 &Help.&Find\.\.\. <C-W>:call <SID>Helpfind()<CR>
+ tlnoremenu 9999.45 &Help.-sep1- <Nop>
+ tlnoremenu 9999.50 &Help.&Credits <C-W>:help credits<CR>
+ tlnoremenu 9999.60 &Help.Co&pying <C-W>:help copying<CR>
+ tlnoremenu 9999.70 &Help.&Sponsor/Register <C-W>:help sponsor<CR>
+ tlnoremenu 9999.70 &Help.O&rphans <C-W>:help kcc<CR>
+ tlnoremenu 9999.75 &Help.-sep2- <Nop>
+ tlnoremenu 9999.80 &Help.&Version <C-W>:version<CR>
+ tlnoremenu 9999.90 &Help.&About <C-W>:intro<CR>
+endif
+
fun! s:Helpfind()
if !exists("g:menutrans_help_dialog")
let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_<Del>)\nPrepend ' for an option name (e.g.: 'shiftwidth')"
nt-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *  linux/drivers/spi/spi-test.h
 *
 *  (c) Martin Sperl <kernel@martin.sperl.org>
 *
 *  spi_test definitions
 */

#include <linux/spi/spi.h>

#define SPI_TEST_MAX_TRANSFERS 4
#define SPI_TEST_MAX_SIZE (32 * PAGE_SIZE)
#define SPI_TEST_MAX_ITERATE 32

/* the "dummy" start addresses used in spi_test
 * these addresses get translated at a later stage
 */
#define RX_START	BIT(30)
#define TX_START	BIT(31)
#define RX(off)		((void *)(RX_START + off))
#define TX(off)		((void *)(TX_START + off))

/* some special defines for offsets */
#define SPI_TEST_MAX_SIZE_HALF	BIT(29)

/* detection pattern for unfinished reads...
 * - 0x00 or 0xff could be valid levels for tx_buf = NULL,
 * so we do not use either of them
 */
#define SPI_TEST_PATTERN_UNWRITTEN 0xAA
#define SPI_TEST_PATTERN_DO_NOT_WRITE 0x55
#define SPI_TEST_CHECK_DO_NOT_WRITE 64

/**
 * struct spi_test - describes a specific (set of) tests to execute
 *
 * @description:      description of the test
 *
 * @msg:              a template @spi_message usedfor the default settings
 * @transfers:        array of @spi_transfers that are part of the
 *                    resulting spi_message.
 * @transfer_count:   number of transfers
 *
 * @run_test:         run a specific spi_test - this allows to override
 *                    the default implementation of @spi_test_run_transfer
 *                    either to add some custom filters for a specific test
 *                    or to effectively run some very custom tests...
 * @execute_msg:      run the spi_message for real - this allows to override
 *                    @spi_test_execute_msg to apply final modifications
 *                    on the spi_message
 * @expected_return:  the expected return code - in some cases we want to
 *                    test also for error conditions
 *
 * @iterate_len:      list of length to iterate on
 * @iterate_tx_align: change the alignment of @spi_transfer.tx_buf
 *                    for all values in the below range if set.
 *                    the ranges are:
 *                    [0 : @spi_master.dma_alignment[ if set
 *                    [0 : iterate_tx_align[ if unset
 * @iterate_rx_align: change the alignment of @spi_transfer.rx_buf
 *                    see @iterate_tx_align for details
 * @iterate_transfer_mask: the bitmask of transfers to which the iterations
 *                         apply - if 0, then it applies to all transfer
 *
 * @fill_option:      define the way how tx_buf is filled
 * @fill_pattern:     fill pattern to apply to the tx_buf
 *                    (used in some of the @fill_options)
 * @elapsed_time:     elapsed time in nanoseconds
 */

struct spi_test {
	char description[64];
	struct spi_message msg;
	struct spi_transfer transfers[SPI_TEST_MAX_TRANSFERS];
	unsigned int transfer_count;
	int (*run_test)(struct spi_device *spi, struct spi_test *test,
			void *tx, void *rx);
	int (*execute_msg)(struct spi_device *spi, struct spi_test *test,
			   void *tx, void *rx);
	int expected_return;
	/* iterate over all values, terminated by a -1 */
	int iterate_len[SPI_TEST_MAX_ITERATE];
	int iterate_tx_align;
	int iterate_rx_align;
	u32 iterate_transfer_mask;
	/* the tx-fill operation */
	u32 fill_option;
#define FILL_MEMSET_8	0	/* just memset with 8 bit */
#define FILL_MEMSET_16	1	/* just memset with 16 bit */
#define FILL_MEMSET_24	2	/* just memset with 24 bit */
#define FILL_MEMSET_32	3	/* just memset with 32 bit */
#define FILL_COUNT_8	4	/* fill with a 8 byte counter */
#define FILL_COUNT_16	5	/* fill with a 16 bit counter */
#define FILL_COUNT_24	6	/* fill with a 24 bit counter */
#define FILL_COUNT_32	7	/* fill with a 32 bit counter */
#define FILL_TRANSFER_BYTE_8  8	/* fill with the transfer byte - 8 bit */
#define FILL_TRANSFER_BYTE_16 9	/* fill with the transfer byte - 16 bit */
#define FILL_TRANSFER_BYTE_24 10 /* fill with the transfer byte - 24 bit */
#define FILL_TRANSFER_BYTE_32 11 /* fill with the transfer byte - 32 bit */
#define FILL_TRANSFER_NUM     16 /* fill with the transfer number */
	u32 fill_pattern;
	unsigned long long elapsed_time;
};

/* default implementation for @spi_test.run_test */
int spi_test_run_test(struct spi_device *spi,
		      const struct spi_test *test,
		      void *tx, void *rx);

/* default implementation for @spi_test.execute_msg */
int spi_test_execute_msg(struct spi_device *spi,
			 struct spi_test *test,
			 void *tx, void *rx);

/* function to execute a set of tests */
int spi_test_run_tests(struct spi_device *spi,
		       struct spi_test *tests);

#define ITERATE_LEN_LIST 0, 1, 2, 3, 7, 11, 16, 31, 32, 64, 97, 128, 251, 256, \
		1021, 1024, 1031, 4093, PAGE_SIZE, 4099, 65536, 65537
/* some of the default @spi_transfer.len to test, terminated by a -1 */
#define ITERATE_LEN ITERATE_LEN_LIST, -1
#define ITERATE_MAX_LEN ITERATE_LEN_LIST, (SPI_TEST_MAX_SIZE - 1), \
		SPI_TEST_MAX_SIZE, -1

/* the default alignment to test */
#define ITERATE_ALIGN sizeof(int)