git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 1/3] vimdiff: new implementation with layout support

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Mar 27, 2022, 16:47 UTC
Message-ID
<00463195-5514-bf2b-e733-24e1e24a70cb@gmail.com>
In-Reply-To
<20220327112307.151044-2-greenfoo@u92.eu>
Hi Fernando,
Le 2022-03-27 à 07:23, Fernando Ramos a écrit :
--8<--
Show 6 quoted lines
> +################################################################################
> +## Internal functions (not meant to be used outside this script)
> +################################################################################
> +
> +debug_print () { 
> +	# Send message to stderr if global variable DEBUG is set to "true"
This should also be GIT_MERGETOOL_VIMDIFF_DEBUG, right?
Show 7 quoted lines
> +
> +	if test -n "$GIT_MERGETOOL_VIMDIFF_DEBUG"
> +	then
> +		>&2 echo "$@"
> +	fi
> +}
> +
--8<--
Show 11 quoted lines
> +gen_cmd () {
> +	# This function returns (in global variable FINAL_CMD) the string that
> +	# you can use when invoking "vim" (as shown next) to obtain a given
> +	# layout:
> +	#
> +	#   $ vim -f $FINAL_CMD "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
> +	#
> +	# It takes one single argument: a string containing the desired layout
> +	# definition.
> +	#
> +	# The syntax of the "layout definitions" is explained in ... (TODO)...
Is this still TODO ?
Show 17 quoted lines
> +	# but you can already intuitively understand how it works by knowing
> +	# that...
> +	#
> +	#   * ";" means "a new vim tab"
> +	#   * "-" means "a new vim horizontal split"
> +	#   * "|" means "a new vim vertical split"
> +	#
> +	# It also returns (in global variable FINAL_TARGET) the name ("LOCAL",
> +	# "BASE", "REMOTE" or "MERGED") of the file that is marked with an "@",
> +	# or "MERGED" if none of them is.
> +	#
> +	# Example:
> +	#
> +	#     gen_cmd "@LOCAL , REMOTE"
> +	#     |
> +	#     `-> FINAL_CMD    == "-c \"echo | vertical split | 1b | wincmd l | 3b | tabdo windo diffthis\" -c \"tabfirst\""
> +	#         FINAL_TARGET == "LOCAL"
Previous: Fernando RamosNext: Fernando Ramos
Message 3 of 16 in “vimdiff: new implementation with layout support”
  1. 0/3 vimdiff: new implementation with layout supportFernando Ramos, Mar 27, 2022
  2. 1/3 vimdiff: new implementation with layout supportFernando Ramos, Mar 27, 2022
  3. Philippe BlainMar 27, 2022
  4. Fernando RamosMar 27, 2022
  5. Junio C HamanoMar 27, 2022
  6. 2/3 vimdiff: integrate layout tests in the unit tests framework ('t' folder)Fernando Ramos, Mar 27, 2022
  7. Junio C HamanoMar 27, 2022
  8. 3/3 vimdiff: add tool documentationFernando Ramos, Mar 27, 2022
  9. Philippe BlainMar 27, 2022
  10. fixup! vimdiff: add tool documentationPhilippe Blain, Mar 27, 2022
  11. Fernando RamosMar 27, 2022
  12. Junio C HamanoMar 27, 2022
  13. Fernando RamosMar 27, 2022
  14. Bagas SanjayaMar 28, 2022
  15. Junio C HamanoMar 28, 2022
  16. Fernando RamosMar 28, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.