mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Compare commits
200 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cc617ec77 | |||
| 7f04847c21 | |||
| 8600ace876 | |||
| 254e00d714 | |||
| 0ba75a9714 | |||
| 1f6ef66254 | |||
| 1d6fbe6540 | |||
| 132006c3d0 | |||
| 40ea1da14b | |||
| ed5a78e11c | |||
| 223b723be0 | |||
| b6ff854d92 | |||
| 922d25f99c | |||
| 93bf558cae | |||
| 81661fb868 | |||
| ec70bdd68a | |||
| 74a97b1ea0 | |||
| 7f0608fb52 | |||
| 8b778d5599 | |||
| a1e24b9bc9 | |||
| a87e2c277e | |||
| b14fbbdd95 | |||
| 203219048f | |||
| cd39bbcd1d | |||
| 7451a718a5 | |||
| e74e8e7d75 | |||
| 910b8aac5d | |||
| 7d63f62460 | |||
| 418f81b5fa | |||
| 0c2c96e47c | |||
| ba093bc000 | |||
| 9a6e33a19b | |||
| 5d54a04598 | |||
| 6aa2cd4be2 | |||
| f8df7addc5 | |||
| acd58ef676 | |||
| d46ae142aa | |||
| 0943a09db8 | |||
| 5cefd40982 | |||
| e2fba9a94a | |||
| 12dcf024e9 | |||
| b6a7737938 | |||
| 97eba78f69 | |||
| 2368917d8f | |||
| 38a55639d6 | |||
| d807036d10 | |||
| a971df849f | |||
| 3bece9fee9 | |||
| 71b0f7b5c0 | |||
| 27f20f6d9f | |||
| f3f4ec59c6 | |||
| 44d571868f | |||
| 16eb4f8800 | |||
| 7b3ca76a45 | |||
| a3be996751 | |||
| 0727d362b4 | |||
| fa4bce7dd2 | |||
| 7707344dde | |||
| 5202a07b33 | |||
| bd7d4b4288 | |||
| e516c39ee9 | |||
| bfa1ffca8b | |||
| f8b7d890f1 | |||
| d090d7bab5 | |||
| 6463ca229c | |||
| 00af60bbb6 | |||
| 9d68c827c3 | |||
| 45c7f05473 | |||
| f02c5cffd8 | |||
| 76467dfcaf | |||
| 7c29f38781 | |||
| 8d6721a6ca | |||
| 7823a3bd2e | |||
| b6a4fee37e | |||
| 6119e6156e | |||
| 0d23826c84 | |||
| 1f56bfdee4 | |||
| 9b472f4242 | |||
| 39b21272d5 | |||
| 2ab375e54e | |||
| f6157284de | |||
| d6a8d48587 | |||
| 1227fce354 | |||
| a483326e3b | |||
| f068dcafcf | |||
| 4d8747cdfc | |||
| 7280140c08 | |||
| 374f09f533 | |||
| e56bf15c16 | |||
| 2fc83fcd1d | |||
| b92abad0c5 | |||
| b5e634ea67 | |||
| cbebd4879c | |||
| ee5aeae22b | |||
| 0fa98e7b85 | |||
| ae8eb3ca92 | |||
| 74f5e65bcc | |||
| 7a84dbe6be | |||
| cb00f03933 | |||
| 79c2c881bb | |||
| dc94a26a64 | |||
| 942d6b2268 | |||
| 768ce2435a | |||
| ea8c219ca8 | |||
| eba6d8c66c | |||
| 595e64e259 | |||
| 5b41cd52dd | |||
| 55fab439a6 | |||
| a6f72ba7c6 | |||
| fbc4b4db3a | |||
| cb4b01230b | |||
| 835dc636a5 | |||
| 7cd3390065 | |||
| c5f98ee987 | |||
| 1701481c53 | |||
| 3712792637 | |||
| 81e7a9c3fb | |||
| 4f8b8faec3 | |||
| 26dfc41335 | |||
| a03f233515 | |||
| ab9fc7e0cf | |||
| 7a04d45bec | |||
| c0e65e6559 | |||
| f416086f26 | |||
| 6076fe1986 | |||
| 4d919d748e | |||
| a07fec9c85 | |||
| 36739b0d22 | |||
| 4b6a6dcbe7 | |||
| a8343c1808 | |||
| 3fc3e14282 | |||
| a02b321686 | |||
| 681baaf4a4 | |||
| e24692573a | |||
| 9fab7f8d8d | |||
| b3e2f00f39 | |||
| 66624ff0d9 | |||
| 3b05b135e3 | |||
| 608a8919ca | |||
| e7bed627c8 | |||
| bf087cead9 | |||
| 2212c4154c | |||
| fcb1e3d168 | |||
| f92591f7f9 | |||
| a0f9cd148e | |||
| 4f63131e19 | |||
| d01ff94e51 | |||
| 7c764f7bbf | |||
| d7ece1008e | |||
| 839232428f | |||
| f1a6b1f403 | |||
| d087566a41 | |||
| f57969a20a | |||
| fbf9c6b6c3 | |||
| 8d8c509ac8 | |||
| 04b08c3de6 | |||
| bc07309225 | |||
| df5b27b20e | |||
| 56ead341a7 | |||
| d9ea9069f5 | |||
| 3d372e3739 | |||
| 885f24fbca | |||
| 11e0afa00a | |||
| 5e9b2fa9bb | |||
| 488a130ea2 | |||
| 14ad611ca4 | |||
| 1357caf31f | |||
| 19d2f15898 | |||
| ca568aeec6 | |||
| f6c0c77fad | |||
| b27e281b92 | |||
| fb1f62691e | |||
| 155500077c | |||
| 448a22549b | |||
| 3803bad99d | |||
| d14e00ea67 | |||
| bbb3339dbf | |||
| a542c680a8 | |||
| e2c3810c2a | |||
| 3c124e3ac8 | |||
| fa399af7ec | |||
| af902a03cf | |||
| 937204a917 | |||
| 779a7759ad | |||
| 20fb9f3464 | |||
| ba4ef2757c | |||
| b638a7be95 | |||
| 764b23c8fd | |||
| 055409764c | |||
| c1ab67674a | |||
| 9b57814db1 | |||
| 52ea13da0f | |||
| 02fdaeaa69 | |||
| 68c2f638e6 | |||
| 66f948e928 | |||
| 78c0b7d43e | |||
| 7454a06e26 | |||
| 305598b712 | |||
| 4349c57543 | |||
| 23c23c2956 |
@@ -41,6 +41,7 @@ SRC_ALL = \
|
||||
src/hardcopy.c \
|
||||
src/hashtab.c \
|
||||
src/json.c \
|
||||
src/json_test.c \
|
||||
src/keymap.h \
|
||||
src/macros.h \
|
||||
src/main.c \
|
||||
@@ -90,6 +91,7 @@ SRC_ALL = \
|
||||
src/testdir/README.txt \
|
||||
src/testdir/Make_all.mak \
|
||||
src/testdir/*.in \
|
||||
src/testdir/*.py \
|
||||
src/testdir/sautest/autoload/*.vim \
|
||||
src/testdir/runtest.vim \
|
||||
src/testdir/test[0-9]*.ok \
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim OMNI completion script for SQL
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 15.0
|
||||
" Last Change: 2013 May 13
|
||||
" Version: 16.0
|
||||
" Last Change: 2015 Dec 29
|
||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
|
||||
" Usage: For detailed help
|
||||
" ":help sql.txt"
|
||||
@@ -16,6 +16,12 @@
|
||||
" look backwards to a FROM clause and find the first table
|
||||
" and complete it.
|
||||
"
|
||||
" Version 16.0 (Dec 2015)
|
||||
" - NF: If reseting the cache and table, procedure or view completion
|
||||
" had been used via dbext, have dbext delete or recreate the
|
||||
" dictionary so that new objects are picked up for the
|
||||
" next completion.
|
||||
"
|
||||
" Version 15.0 (May 2013)
|
||||
" - NF: Changed the SQL precached syntax items, omni_sql_precache_syntax_groups,
|
||||
" to use regular expressions to pick up extended syntax group names.
|
||||
@@ -103,7 +109,7 @@ endif
|
||||
if exists('g:loaded_sql_completion')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_sql_completion = 150
|
||||
let g:loaded_sql_completion = 160
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
@@ -459,6 +465,29 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
let s:tbl_cols = []
|
||||
let s:syn_list = []
|
||||
let s:syn_value = []
|
||||
|
||||
if s:sql_file_table != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("table")
|
||||
else
|
||||
DBCompleteTables!
|
||||
endif
|
||||
endif
|
||||
if s:sql_file_procedure != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("procedure")
|
||||
else
|
||||
DBCompleteProcedures!
|
||||
endif
|
||||
endif
|
||||
if s:sql_file_view != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("view")
|
||||
else
|
||||
DBCompleteViews!
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:sql_file_table = ""
|
||||
let s:sql_file_procedure = ""
|
||||
let s:sql_file_view = ""
|
||||
|
||||
+5
-13
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.4. Last change: 2016 Jan 19
|
||||
*change.txt* For Vim version 7.4. Last change: 2016 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -98,10 +98,10 @@ These commands delete text. You can repeat them with the `.` command
|
||||
|
||||
An exception for the d{motion} command: If the motion is not linewise, the
|
||||
start and end of the motion are not in the same line, and there are only
|
||||
blanks before the start and after the end of the motion, the delete becomes
|
||||
linewise. This means that the delete also removes the line of blanks that you
|
||||
might expect to remain. Use the |o_v| operator to force the motion to be
|
||||
characterwise.
|
||||
blanks before the start and there are no non-blanks after the end of the
|
||||
motion, the delete becomes linewise. This means that the delete also removes
|
||||
the line of blanks that you might expect to remain. Use the |o_v| operator to
|
||||
force the motion to be characterwise.
|
||||
|
||||
Trying to delete an empty region of text (e.g., "d0" in the first column)
|
||||
is an error when 'cpoptions' includes the 'E' flag.
|
||||
@@ -977,8 +977,6 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
|
||||
`:retab!` may also change a sequence of spaces by
|
||||
<Tab> characters, which can mess up a printf().
|
||||
{not in Vi}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
*retab-example*
|
||||
Example for using autocommands and ":retab" to edit a file which is stored
|
||||
@@ -1354,22 +1352,16 @@ The next three commands always work on whole lines.
|
||||
Center lines in [range] between [width] columns
|
||||
(default 'textwidth' or 80 when 'textwidth' is 0).
|
||||
{not in Vi}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
:[range]ri[ght] [width] *:ri* *:right*
|
||||
Right-align lines in [range] at [width] columns
|
||||
(default 'textwidth' or 80 when 'textwidth' is 0).
|
||||
{not in Vi}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
*:le* *:left*
|
||||
:[range]le[ft] [indent]
|
||||
Left-align lines in [range]. Sets the indent in the
|
||||
lines to [indent] (default 0). {not in Vi}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
*gq*
|
||||
gq{motion} Format the lines that {motion} moves over.
|
||||
|
||||
+379
-80
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Jan 28
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -9,36 +9,72 @@
|
||||
DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
|
||||
|
||||
Vim uses channels to communicate with other processes.
|
||||
A channel uses a socket. *socket-interface*
|
||||
A channel uses a socket or pipes *socket-interface*
|
||||
Jobs can be used to start processes and communicate with them.
|
||||
|
||||
Vim current supports up to 10 simultanious channels.
|
||||
Vim current supports up to 10 simultaneous channels.
|
||||
The Netbeans interface also uses a channel. |netbeans|
|
||||
|
||||
1. Demo |channel-demo|
|
||||
2. Opening a channel |channel-open|
|
||||
3. Using a JSON channel |channel-use|
|
||||
4. Vim commands |channel-commands|
|
||||
5. Using a raw channel |channel-use|
|
||||
6. Job control |job-control|
|
||||
1. Overview |job-channel-overview|
|
||||
2. Channel demo |channel-demo|
|
||||
3. Opening a channel |channel-open|
|
||||
4. Using a JSON or JS channel |channel-use|
|
||||
5. Channel commands |channel-commands|
|
||||
6. Using a RAW or NL channel |channel-raw|
|
||||
7. More channel functions |channel-more|
|
||||
8. Starting a job with a channel |job-start|
|
||||
9. Starting a job without a channel |job-start-nochannel|
|
||||
10. Job options |job-options|
|
||||
11. Controlling a job |job-control|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
{only available when compiled with the |+channel| feature}
|
||||
{only when compiled with the |+channel| feature for channel stuff}
|
||||
{only when compiled with the |+job| feature for job stuff}
|
||||
|
||||
==============================================================================
|
||||
1. Demo *channel-demo*
|
||||
1. Overview *job-channel-overview*
|
||||
|
||||
There are four main types of jobs:
|
||||
1. A deamon, serving several Vim instances.
|
||||
Vim connects to it with a socket.
|
||||
2. One job working with one Vim instance, asynchronously.
|
||||
Uses a socket or pipes.
|
||||
3. A job performing some work for a short time, asynchronously.
|
||||
Uses a socket or pipes.
|
||||
4. Running a filter, synchronously.
|
||||
Uses pipes.
|
||||
|
||||
For when using sockets See |job-start|, |job-may-start| and |channel-open|.
|
||||
For 2 and 3, one or more jobs using pipes, see |job-start|.
|
||||
For 4 use the ":{range}!cmd" command, see |filter|.
|
||||
|
||||
Over the socket and pipes these protocols are available:
|
||||
RAW nothing known, Vim cannot tell where a message ends
|
||||
NL every message ends in a NL (newline) character
|
||||
JSON JSON encoding |json_encode()|
|
||||
JS JavaScript style JSON-like encoding |js_encode()|
|
||||
|
||||
Common combination are:
|
||||
- Using a job connected through pipes in NL mode. E.g., to run a style
|
||||
checker and receive errors and warnings.
|
||||
- Using a deamon, connecting over a socket in JSON mode. E.g. to lookup
|
||||
crosss-refrences in a database.
|
||||
|
||||
==============================================================================
|
||||
2. Channel demo *channel-demo*
|
||||
|
||||
This requires Python. The demo program can be found in
|
||||
$VIMRUNTIME/tools/demoserver.py
|
||||
Run it in one terminal. We will call this T1.
|
||||
|
||||
Run Vim in another terminal. Connect to the demo server with: >
|
||||
let handle = connect('localhost:8765', 'json')
|
||||
let channel = ch_open('localhost:8765')
|
||||
|
||||
In T1 you should see:
|
||||
=== socket opened === ~
|
||||
|
||||
You can now send a message to the server: >
|
||||
echo sendexpr(handle, 'hello!')
|
||||
echo ch_sendexpr(channel, 'hello!')
|
||||
|
||||
The message is received in T1 and a response is sent back to Vim.
|
||||
You can see the raw messages in T1. What Vim sends is:
|
||||
@@ -48,71 +84,128 @@ And the response is:
|
||||
The number will increase every time you send a message.
|
||||
|
||||
The server can send a command to Vim. Type this on T1 (literally, including
|
||||
the quotes): >
|
||||
NOT IMPLEMENTED YET
|
||||
["ex","echo 'hi there'"]
|
||||
And you should see the message in Vim.
|
||||
the quotes):
|
||||
["ex","echo 'hi there'"] ~
|
||||
And you should see the message in Vim. You can move the cursor a word forward:
|
||||
["normal","w"] ~
|
||||
|
||||
To handle asynchronous communication a callback needs to be used: >
|
||||
func MyHandler(handle, msg)
|
||||
func MyHandler(channel, msg)
|
||||
echo "from the handler: " . a:msg
|
||||
endfunc
|
||||
call sendexpr(handle, 'hello!', "MyHandler")
|
||||
call ch_sendexpr(channel, 'hello!', "MyHandler")
|
||||
Vim will not wait for a response. Now the server can send the response later
|
||||
and MyHandler will be invoked.
|
||||
|
||||
Instead of giving a callback with every send call, it can also be specified
|
||||
when opening the channel: >
|
||||
call disconnect(handle)
|
||||
let handle = connect('localhost:8765', 'json', "MyHandler")
|
||||
call sendexpr(handle, 'hello!', 0)
|
||||
call ch_close(channel)
|
||||
let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
|
||||
call ch_sendexpr(channel, 'hello!', 0)
|
||||
|
||||
==============================================================================
|
||||
2. Opening a channel *channel-open*
|
||||
3. Opening a channel *channel-open*
|
||||
|
||||
To open a channel:
|
||||
let handle = connect({address}, {mode}, {callback})
|
||||
To open a channel: >
|
||||
let channel = ch_open({address} [, {options}])
|
||||
|
||||
Use |ch_status()| to see if the channel could be opened.
|
||||
|
||||
{address} has the form "hostname:port". E.g., "localhost:8765".
|
||||
|
||||
{mode} can be: *channel-mode*
|
||||
"json" - Use JSON, see below; most convenient way
|
||||
{options} is a dictionary with optional entries:
|
||||
|
||||
"mode" can be: *channel-mode*
|
||||
"json" - Use JSON, see below; most convenient way. Default.
|
||||
"js" - Use JS (JavaScript) encoding, more efficient than JSON.
|
||||
"nl" - Use messages that end in a NL character
|
||||
"raw" - Use raw messages
|
||||
|
||||
*channel-callback*
|
||||
{callback} is a function that is called when a message is received that is not
|
||||
handled otherwise. It gets two arguments: the channel handle and the received
|
||||
message. Example: >
|
||||
func Handle(handle, msg)
|
||||
"callback" A function that is called when a message is received that is
|
||||
not handled otherwise. It gets two arguments: the channel
|
||||
handle and the received message. Example: >
|
||||
func Handle(channel, msg)
|
||||
echo 'Received: ' . a:msg
|
||||
endfunc
|
||||
let handle = connect("localhost:8765", 'json', "Handle")
|
||||
let channel = ch_open("localhost:8765", {"callback": "Handle"})
|
||||
<
|
||||
TODO:
|
||||
"err-cb" A function like "callback" but used for stderr. Only for when
|
||||
the channel uses pipes.
|
||||
|
||||
When {mode} is "json" the "msg" argument is the body of the received message,
|
||||
converted to Vim types.
|
||||
When {mode} is "raw" the "msg" argument is the whole message as a string.
|
||||
TODO:
|
||||
"close-cb" A function that is called when the channel gets closed, other
|
||||
than by calling ch_close(). It should be defined like this: >
|
||||
func MyCloseHandler(channel)
|
||||
|
||||
When {mode} is "json" the {callback} is optional. When omitted it is only
|
||||
possible to receive a message after sending one.
|
||||
"waittime" The time to wait for the connection to be made in
|
||||
milliseconds. The default is zero, don't wait, which is
|
||||
useful if the server is supposed to be running already. A
|
||||
negative number waits forever.
|
||||
|
||||
The handler can be added or changed later: >
|
||||
call sethandler(handle, {callback})
|
||||
When {callback} is empty (zero or an empty string) the handler is removed.
|
||||
"timeout" The time to wait for a request when blocking, using
|
||||
ch_sendexpr(). Again in milliseconds. The default is 2000 (2
|
||||
seconds).
|
||||
|
||||
When "mode" is "json" or "js" the "msg" argument is the body of the received
|
||||
message, converted to Vim types.
|
||||
When "mode" is "raw" the "msg" argument is the whole message as a string.
|
||||
|
||||
When "mode" is "json" or "js" the "callback" is optional. When omitted it is
|
||||
only possible to receive a message after sending one.
|
||||
|
||||
TODO:
|
||||
To change the channel options after opening it use ch_setoptions(). The
|
||||
arguments are similar to what is passed to ch_open(), but "waittime" cannot be
|
||||
given, since that only applies to opening the channel.
|
||||
|
||||
The handler can be added or changed: >
|
||||
call ch_setoptions(channel, {'callback': callback})
|
||||
When "callback" is empty (zero or an empty string) the handler is removed.
|
||||
|
||||
The timeout can be changed: >
|
||||
call ch_setoptions(channel, {'timeout': msec})
|
||||
<
|
||||
*E906*
|
||||
Once done with the channel, disconnect it like this: >
|
||||
call disconnect(handle)
|
||||
call ch_close(channel)
|
||||
When a socket is used this will close the socket for both directions. When
|
||||
pipes are used (stdin/stdout/stderr) they are all closed. This might not be
|
||||
what you want! Stopping the job with job_stop() might be better.
|
||||
|
||||
TODO:
|
||||
Currently up to 10 channels can be in use at the same time. *E897*
|
||||
|
||||
When the channel can't be opened you will get an error message. There is a
|
||||
difference between MS-Windows and Unix: On Unix when the port doesn't exist
|
||||
ch_open() fails quickly. On MS-Windows "waittime" applies.
|
||||
*E898* *E899* *E900* *E901* *E902*
|
||||
|
||||
If there is an error reading or writing a channel it will be closed.
|
||||
*E896* *E630* *E631*
|
||||
|
||||
==============================================================================
|
||||
3. Using a JSON channel *channel-use*
|
||||
4. Using a JSON or JS channel *channel-use*
|
||||
|
||||
If {mode} is "json" then a message can be sent synchronously like this: >
|
||||
let response = sendexpr(handle, {expr})
|
||||
If mode is JSON then a message can be sent synchronously like this: >
|
||||
let response = ch_sendexpr(channel, {expr})
|
||||
This awaits a response from the other side.
|
||||
|
||||
When mode is JS this works the same, except that the messages use
|
||||
JavaScript encoding. See |js_encode()| for the difference.
|
||||
|
||||
To send a message, without handling a response: >
|
||||
call sendexpr(handle, {expr}, 0)
|
||||
call ch_sendexpr(channel, {expr}, 0)
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call sendexpr(handle, {expr}, {callback})
|
||||
call ch_sendexpr(channel, {expr}, {callback})
|
||||
|
||||
Vim will match the response with the request using the message ID. Once the
|
||||
response is received the callback will be invoked. Further responses with the
|
||||
same ID will be ignored. If your server sends back multiple responses you
|
||||
need to send them with ID zero, they will be passed to the channel callback.
|
||||
|
||||
The {expr} is converted to JSON and wrapped in an array. An example of the
|
||||
message that the receiver will get when {expr} is the string "hello":
|
||||
@@ -140,79 +233,285 @@ message, it must use the number zero:
|
||||
Then channel handler will then get {response} converted to Vim types. If the
|
||||
channel does not have a handler the message is dropped.
|
||||
|
||||
On read error or disconnect() the string "DETACH" is sent, if still possible.
|
||||
On read error or ch_close() the string "DETACH" is sent, if still possible.
|
||||
The channel will then be inactive.
|
||||
|
||||
It is also possible to use ch_sendraw() on a JSON or JS channel. The caller
|
||||
is then completely responsible for correct encoding and decoding.
|
||||
|
||||
==============================================================================
|
||||
4. Vim commands *channel-commands*
|
||||
5. Channel commands *channel-commands*
|
||||
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
With a "json" channel the process can send commands to Vim that will be
|
||||
With a JSON channel the process can send commands to Vim that will be
|
||||
handled by Vim internally, it does not require a handler for the channel.
|
||||
|
||||
Possible commands are:
|
||||
Possible commands are: *E903* *E904* *E905*
|
||||
["redraw" {forced}]
|
||||
["ex", {Ex command}]
|
||||
["normal", {Normal mode command}]
|
||||
["eval", {number}, {expression}]
|
||||
["eval", {expression}, {number}]
|
||||
["expr", {expression}]
|
||||
|
||||
With all of these: Be careful what these commands do! You can easily
|
||||
interfere with what the user is doing. To avoid trouble use |mode()| to check
|
||||
that the editor is in the expected state. E.g., to send keys that must be
|
||||
inserted as text, not executed as a command: >
|
||||
["ex","if mode() == 'i' | call feedkeys('ClassName') | endif"]
|
||||
inserted as text, not executed as a command:
|
||||
["ex","if mode() == 'i' | call feedkeys('ClassName') | endif"] ~
|
||||
|
||||
Errors in these commands are normally not reported to avoid them messing up
|
||||
the display. If you do want to see them, set the 'verbose' option to 3 or
|
||||
higher.
|
||||
|
||||
|
||||
Command "redraw" ~
|
||||
|
||||
The other commands do not update the screen, so that you can send a sequence
|
||||
of commands without the cursor moving around. You must end with the "redraw"
|
||||
command to show any changed text and show the cursor where it belongs.
|
||||
|
||||
The argument is normally an empty string:
|
||||
["redraw", ""] ~
|
||||
To first clear the screen pass "force":
|
||||
["redraw", "force"] ~
|
||||
|
||||
|
||||
Command "ex" ~
|
||||
|
||||
The "ex" command is executed as any Ex command. There is no response for
|
||||
completion or error. You could use functions in an |autoload| script.
|
||||
You can also invoke |feedkeys()| to insert anything.
|
||||
completion or error. You could use functions in an |autoload| script:
|
||||
["ex","call myscript#MyFunc(arg)"]
|
||||
|
||||
The "normal" command is executed like with |:normal|.
|
||||
You can also use "call |feedkeys()|" to insert any key sequence.
|
||||
|
||||
The "eval" command will result in sending back the result of the expression:
|
||||
|
||||
Command "normal" ~
|
||||
|
||||
The "normal" command is executed like with ":normal!", commands are not
|
||||
mapped. Example to open the folds under the cursor:
|
||||
["normal" "zO"]
|
||||
|
||||
|
||||
Command "eval" ~
|
||||
|
||||
The "eval" command an be used to get the result of an expression. For
|
||||
example, to get the number of lines in the current buffer:
|
||||
["eval","line('$')"] ~
|
||||
|
||||
it will send back the result of the expression:
|
||||
[{number}, {result}]
|
||||
Here {number} is the same as what was in the request.
|
||||
Here {number} is the same as what was in the request. Use a negative number
|
||||
to avoid confusion with message that Vim sends.
|
||||
|
||||
The "expr" command is similar, but does not send back any response.
|
||||
{result} is the result of the evaluation and is JSON encoded. If the
|
||||
evaluation fails or the result can't be encoded in JSON it is the string
|
||||
"ERROR".
|
||||
|
||||
|
||||
Command "expr" ~
|
||||
|
||||
The "expr" command is similar to "eval", but does not send back any response.
|
||||
Example:
|
||||
["expr","setline('$', ['one', 'two', 'three'])"]
|
||||
["expr","setline('$', ['one', 'two', 'three'])"] ~
|
||||
|
||||
==============================================================================
|
||||
5. Using a raw channel *channel-raw*
|
||||
6. Using a RAW or NL channel *channel-raw*
|
||||
|
||||
If mode is RAW or NL then a message can be send like this: >
|
||||
let response = ch_sendraw(channel, {string})
|
||||
|
||||
If {mode} is "raw" then a message can be send like this: >
|
||||
let response = sendraw(handle, {string})
|
||||
The {string} is sent as-is. The response will be what can be read from the
|
||||
channel right away. Since Vim doesn't know how to recognize the end of the
|
||||
message you need to take care of it yourself.
|
||||
message you need to take care of it yourself. The timeout applies for reading
|
||||
the first byte, after that it will not wait for anything more.
|
||||
|
||||
If mode is "nl" you can send a message in a similar way. You are expected
|
||||
to put in the NL after each message. Thus you can also send several messages
|
||||
ending in a NL at once. The response will be the text up to and including the
|
||||
first NL. This can also be just the NL for an empty response.
|
||||
If no NL was read before the channel timeout an empty string is returned.
|
||||
|
||||
To send a message, without expecting a response: >
|
||||
call sendraw(handle, {string}, 0)
|
||||
call ch_sendraw(channel, {string}, 0)
|
||||
The process can send back a response, the channel handler will be called with
|
||||
it.
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call sendraw(handle, {string}, {callback})
|
||||
call ch_sendraw(channel, {string}, {callback})
|
||||
|
||||
This {string} can also be JSON, use |jsonencode()| to create it and
|
||||
|jsondecode()| to handle a received JSON message.
|
||||
This {string} can also be JSON, use |json_encode()| to create it and
|
||||
|json_decode()| to handle a received JSON message.
|
||||
|
||||
It is not possible to use |ch_sendexpr()| on a raw channel.
|
||||
|
||||
==============================================================================
|
||||
6. Job control *job-control*
|
||||
7. More channel functions *channel-more*
|
||||
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
To start another process: >
|
||||
call startjob({command})
|
||||
|
||||
This does not wait for {command} to exit.
|
||||
To obtain the status of a channel: ch_status(channel). The possible results
|
||||
are:
|
||||
"fail" Failed to open the channel.
|
||||
"open" The channel can be used.
|
||||
"closed" The channel was closed.
|
||||
|
||||
TODO:
|
||||
To objain the job associated with a channel: ch_getjob(channel)
|
||||
|
||||
let handle = startjob({command}, 's') # uses stdin/stdout
|
||||
let handle = startjob({command}, '', {address}) # uses socket
|
||||
let handle = startjob({command}, 'd', {address}) # start if connect fails
|
||||
TODO:
|
||||
To read one message from a channel: >
|
||||
let output = ch_read(channel)
|
||||
This uses the channel timeout. To read without a timeout, just get any
|
||||
message that is available: >
|
||||
let output = ch_read(channel, 0)
|
||||
When no message was available then the result is v:none for a JSON or JS mode
|
||||
channels, an empty string for a RAW or NL channel.
|
||||
|
||||
To read all output from a RAW or NL channel that is available: >
|
||||
let output = ch_readall(channel)
|
||||
To read the error output: >
|
||||
let output = ch_readall(channel, "err")
|
||||
TODO: use channel timeout, no timeout or specify timeout?
|
||||
|
||||
==============================================================================
|
||||
8. Starting a job with a channel *job-start* *job*
|
||||
|
||||
To start a job and open a channel for stdin/stdout/stderr: >
|
||||
let job = job_start(command, {options})
|
||||
|
||||
You can get the channel with: >
|
||||
let channel = job_getchannel(job)
|
||||
|
||||
The channel will use NL mode. If you want another mode it's best to specify
|
||||
this in {options}. When changing the mode later some text may have already
|
||||
been received and not parsed correctly.
|
||||
|
||||
If the command produces a line of output that you want to deal with, specify
|
||||
a handler for stdout: >
|
||||
let job = job_start(command, {"out-cb": "MyHandler"})
|
||||
The function will be called with the channel and a message. You would define
|
||||
it like this: >
|
||||
func MyHandler(channel, msg)
|
||||
|
||||
Without the handler you need to read the output with ch_read().
|
||||
|
||||
The handler defined for "out-cb" will also receive stderr. If you want to
|
||||
handle that separately, add an "err-cb" handler: >
|
||||
let job = job_start(command, {"out-cb": "MyHandler",
|
||||
\ "err-cb": "ErrHandler"})
|
||||
|
||||
You can send a message to the command with ch_sendraw(). If the channel is in
|
||||
JSON or JS mode you can use ch_sendexpr().
|
||||
|
||||
There are several options you can use, see |job-options|.
|
||||
|
||||
TODO:
|
||||
To run a job and read its output once it is done: >
|
||||
|
||||
let job = job_start({command}, {'exit-cb': 'MyHandler'})
|
||||
func MyHandler(job, status)
|
||||
let channel = job_getchannel()
|
||||
let output = ch_readall(channel)
|
||||
" parse output
|
||||
endfunc
|
||||
|
||||
==============================================================================
|
||||
9. Starting a job without a channel *job-start-nochannel*
|
||||
|
||||
To start another process without creating a channel: >
|
||||
let job = job_start(command, {"in-io": "null", "out-io": "null"})
|
||||
|
||||
This starts {command} in the background, Vim does not wait for it to finish.
|
||||
|
||||
TODO:
|
||||
When Vim sees that neither stdin, stdout or stderr are connected, no channel
|
||||
will be created. Often you will want to include redirection in the command to
|
||||
avoid it getting stuck.
|
||||
|
||||
There are several options you can use, see |job-options|.
|
||||
|
||||
TODO: *job-may-start*
|
||||
To start a job only when connecting to an address does not work use
|
||||
job_maystart('command', {address}, {options}), For Example: >
|
||||
let job = job_maystart(command, address, {"waittime": 1000})
|
||||
let channel = job_gethandle(job)
|
||||
|
||||
This comes down to: >
|
||||
let channel = ch_open(address, {"waittime": 0})
|
||||
if ch_status(channel) == "fail"
|
||||
let job = job_start(command)
|
||||
let channel = ch_open(address, {"waittime": 1000})
|
||||
call job_sethandle(channel)
|
||||
endif
|
||||
Note that the specified waittime applies to when the job has been started.
|
||||
This gives the job some time to make the port available.
|
||||
|
||||
==============================================================================
|
||||
10. Job options *job-options*
|
||||
|
||||
The {options} argument in job_start() is a dictionary. All entries are
|
||||
optional. The same options can be used with job_setoptions(job, {options}).
|
||||
|
||||
TODO: *job-out-cb*
|
||||
"callback": handler
|
||||
"out-cb": handler Callback for when there is something to read on
|
||||
stdout.
|
||||
TODO: *job-err-cb*
|
||||
"err-cb": handler Callback for when there is something to read on
|
||||
stderr. Defaults to the same callback as "out-cb".
|
||||
TODO: *job-close-cb*
|
||||
"close-cb": handler Callback for when the channel is closed. Same as
|
||||
"close-cb" on ch_open().
|
||||
TODO: *job-exit-cb*
|
||||
"exit-cb": handler Callback for when the job ends. The arguments are the
|
||||
job and the exit status.
|
||||
TODO: *job-killonexit*
|
||||
"killonexit": 1 Stop the job when Vim exits.
|
||||
"killonexit": 0 Do not stop the job when Vim exits.
|
||||
The default is 1.
|
||||
TODO: *job-term*
|
||||
"term": "open" Start a terminal and connect the job
|
||||
stdin/stdout/stderr to it.
|
||||
|
||||
TODO: *job-in-io*
|
||||
"in-io": "null" disconnect stdin
|
||||
"in-io": "pipe" stdin is connected to the channel (default)
|
||||
"in-io": "file" stdin reads from a file
|
||||
"in-file": "/path/file" the file to read from
|
||||
|
||||
TODO: *job-out-io*
|
||||
"out-io": "null" disconnect stdout
|
||||
"out-io": "pipe" stdout is connected to the channel (default)
|
||||
"out-io": "file" stdout writes to a file
|
||||
"out-file": "/path/file" the file to write to
|
||||
"out-io": "buffer" stdout appends to a buffer
|
||||
"out-buffer": "name" buffer to append to
|
||||
|
||||
TODO: *job-err-io*
|
||||
"err-io": "out" same type as stdout (default)
|
||||
"err-io": "null" disconnect stderr
|
||||
"err-io": "pipe" stderr is connected to the channel
|
||||
"err-io": "file" stderr writes to a file
|
||||
"err-file": "/path/file" the file to write to
|
||||
"err-io": "buffer" stderr appends to a buffer
|
||||
"err-buffer": "name" buffer to append to
|
||||
|
||||
TODO: more options
|
||||
|
||||
|
||||
==============================================================================
|
||||
11. Controlling a job *job-control*
|
||||
|
||||
To get the status of a job: >
|
||||
echo job_status(job)
|
||||
|
||||
To make a job stop running: >
|
||||
job_stop(job)
|
||||
|
||||
This is the normal way to end a job. On Unix it sends a SIGTERM to the job.
|
||||
It is possible to use other ways to stop the job, or even send arbitrary
|
||||
signals. E.g. to force a job to stop, "kill it": >
|
||||
job_stop(job, "kill")
|
||||
|
||||
For more options see |job_stop()|.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 7.4. Last change: 2016 Jan 19
|
||||
*develop.txt* For Vim version 7.4. Last change: 2016 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -322,7 +322,8 @@ OK: if (cond)
|
||||
cmd;
|
||||
}
|
||||
|
||||
Functions start with:
|
||||
Use ANSI (new style) function declarations with the return type on a separate
|
||||
indented line.
|
||||
|
||||
Wrong: int function_name(int arg1, int arg2)
|
||||
|
||||
@@ -340,8 +341,6 @@ OK: /*
|
||||
|
||||
local = arg1 * arg2;
|
||||
|
||||
NOTE: Don't use ANSI style function declarations. A few people still have to
|
||||
use a compiler that doesn't support it.
|
||||
|
||||
|
||||
SPACES AND PUNCTUATION *style-spaces*
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#define LINELEN 200
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char line[LINELEN];
|
||||
char *p1, *p2;
|
||||
|
||||
+17
-10
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.4. Last change: 2016 Jan 17
|
||||
*editing.txt* For Vim version 7.4. Last change: 2016 Feb 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -403,16 +403,21 @@ Note there are some commands where this works slightly differently, see
|
||||
Example: >
|
||||
:n **/*.txt
|
||||
Finds files:
|
||||
ttt.txt
|
||||
subdir/ttt.txt
|
||||
a/b/c/d/ttt.txt
|
||||
When non-wildcard characters are used these are only matched in the first
|
||||
directory. Example: >
|
||||
:n /usr/inc**/*.h
|
||||
aaa.txt ~
|
||||
subdir/bbb.txt ~
|
||||
a/b/c/d/ccc.txt ~
|
||||
When non-wildcard characters are used right before or after "**" these are
|
||||
only matched in the top directory. They are not used for directories further
|
||||
down in the tree. For example: >
|
||||
:n /usr/inc**/types.h
|
||||
Finds files:
|
||||
/usr/include/types.h
|
||||
/usr/include/sys/types.h
|
||||
/usr/inc_old/types.h
|
||||
/usr/include/types.h ~
|
||||
/usr/include/sys/types.h ~
|
||||
/usr/inc/old/types.h ~
|
||||
Note that the path with "/sys" is included because it does not need to match
|
||||
"/inc". Thus it's like matching "/usr/inc*/*/*...", not
|
||||
"/usr/inc*/inc*/inc*".
|
||||
|
||||
*backtick-expansion* *`-expansion*
|
||||
On Unix and a few other systems you can also use backticks for the file name
|
||||
argument, for example: >
|
||||
@@ -1468,6 +1473,8 @@ test for blowfish with: >
|
||||
v:version >= 703
|
||||
And for blowfish2 with: >
|
||||
v:version > 704 || (v:version == 704 && has('patch401'))
|
||||
If you are sure Vim includes patch 7.4.237 a simpler check is: >
|
||||
has('patch-7.4.401')
|
||||
<
|
||||
*E817* *E818* *E819* *E820*
|
||||
When encryption does not work properly, you would be able to write your text
|
||||
|
||||
+256
-72
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Jan 28
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -37,7 +37,7 @@ done, the features in this document are not available. See |+eval| and
|
||||
|
||||
1.1 Variable types ~
|
||||
*E712*
|
||||
There are six types of variables:
|
||||
There are nine types of variables:
|
||||
|
||||
Number A 32 or 64 bit signed number. |expr-number| *Number*
|
||||
Examples: -123 0x10 0177
|
||||
@@ -49,9 +49,6 @@ Float A floating point number. |floating-point-format| *Float*
|
||||
String A NUL terminated string of 8-bit unsigned characters (bytes).
|
||||
|expr-string| Examples: "ab\txx\"--" 'x-z''a,c'
|
||||
|
||||
Funcref A reference to a function |Funcref|.
|
||||
Example: function("strlen")
|
||||
|
||||
List An ordered sequence of items |List|.
|
||||
Example: [1, 2, ['a', 'b']]
|
||||
|
||||
@@ -59,6 +56,15 @@ Dictionary An associative, unordered array: Each entry has a key and a
|
||||
value. |Dictionary|
|
||||
Example: {'blue': "#0000ff", 'red': "#ff0000"}
|
||||
|
||||
Funcref A reference to a function |Funcref|.
|
||||
Example: function("strlen")
|
||||
|
||||
Special v:false, v:true, v:none and v:null
|
||||
|
||||
Job Used for a job, see |job_start()|.
|
||||
|
||||
Channel Used for a channel, see |ch_open()|.
|
||||
|
||||
The Number and String types are converted automatically, depending on how they
|
||||
are used.
|
||||
|
||||
@@ -95,15 +101,16 @@ Note that in the command >
|
||||
"foo" is converted to 0, which means FALSE. To test for a non-empty string,
|
||||
use empty(): >
|
||||
:if !empty("foo")
|
||||
< *E745* *E728* *E703* *E729* *E730* *E731*
|
||||
List, Dictionary and Funcref types are not automatically converted.
|
||||
<
|
||||
*E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910* *E913*
|
||||
List, Dictionary, Funcref and Job types are not automatically converted.
|
||||
|
||||
*E805* *E806* *E808*
|
||||
When mixing Number and Float the Number is converted to Float. Otherwise
|
||||
there is no automatic conversion of Float. You can use str2float() for String
|
||||
to Float, printf() for Float to String and float2nr() for Float to Number.
|
||||
|
||||
*E891* *E892* *E893* *E894*
|
||||
*E891* *E892* *E893* *E894* *E907* *E911* *E914*
|
||||
When expecting a Float a Number can also be used, but nothing else.
|
||||
|
||||
*E706* *sticky-type-checking*
|
||||
@@ -864,7 +871,7 @@ These three can be repeated and mixed. Examples:
|
||||
expr8 *expr8*
|
||||
-----
|
||||
expr8[expr1] item of String or |List| *expr-[]* *E111*
|
||||
|
||||
*E909*
|
||||
If expr8 is a Number or String this results in a String that contains the
|
||||
expr1'th single byte from expr8. expr8 is used as a String, expr1 as a
|
||||
Number. This doesn't recognize multi-byte encodings, see |byteidx()| for
|
||||
@@ -1411,7 +1418,7 @@ v:exception The value of the exception most recently caught and not
|
||||
|
||||
*v:false* *false-variable*
|
||||
v:false A Number with value zero. Used to put "false" in JSON. See
|
||||
|jsonencode()|.
|
||||
|json_encode()|.
|
||||
When used as a string this evaluates to "false". >
|
||||
echo v:false
|
||||
< false ~
|
||||
@@ -1551,7 +1558,7 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
|
||||
|
||||
*v:none* *none-variable*
|
||||
v:none An empty String. Used to put an empty item in JSON. See
|
||||
|jsonencode()|.
|
||||
|json_encode()|.
|
||||
When used as a number this evaluates to zero.
|
||||
When used as a string this evaluates to "none". >
|
||||
echo v:none
|
||||
@@ -1559,7 +1566,7 @@ v:none An empty String. Used to put an empty item in JSON. See
|
||||
|
||||
*v:null* *null-variable*
|
||||
v:null An empty String. Used to put "null" in JSON. See
|
||||
|jsonencode()|.
|
||||
|json_encode()|.
|
||||
When used as a number this evaluates to zero.
|
||||
When used as a string this evaluates to "null". >
|
||||
echo v:null
|
||||
@@ -1732,7 +1739,7 @@ v:throwpoint The point where the exception most recently caught and not
|
||||
|
||||
*v:true* *true-variable*
|
||||
v:true A Number with value one. Used to put "true" in JSON. See
|
||||
|jsonencode()|.
|
||||
|json_encode()|.
|
||||
When used as a string this evaluates to "true". >
|
||||
echo v:true
|
||||
< true ~
|
||||
@@ -1810,6 +1817,15 @@ byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
|
||||
call( {func}, {arglist} [, {dict}])
|
||||
any call {func} with arguments {arglist}
|
||||
ceil( {expr}) Float round {expr} up
|
||||
ch_close( {handle}) none close a channel
|
||||
ch_logfile( {fname} [, {mode}]) none start logging channel activity
|
||||
ch_open( {address} [, {argdict})] Number open a channel to {address}
|
||||
ch_readraw( {handle}) String read from channel {handle}
|
||||
ch_sendexpr( {handle}, {expr} [, {options}])
|
||||
any send {expr} over JSON channel {handle}
|
||||
ch_sendraw( {handle}, {string} [, {options}])
|
||||
any send {string} over raw channel {handle}
|
||||
ch_status( {handle}) String status of channel {handle}
|
||||
changenr() Number current change number
|
||||
char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
|
||||
cindent( {lnum}) Number C indent for line {lnum}
|
||||
@@ -1820,8 +1836,6 @@ complete_add( {expr}) Number add completion match
|
||||
complete_check() Number check for key typed during completion
|
||||
confirm( {msg} [, {choices} [, {default} [, {type}]]])
|
||||
Number number of choice picked by user
|
||||
connect( {address}, {mode} [, {callback}])
|
||||
Number open a channel
|
||||
copy( {expr}) any make a shallow copy of {expr}
|
||||
cos( {expr}) Float cosine of {expr}
|
||||
cosh( {expr}) Float hyperbolic cosine of {expr}
|
||||
@@ -1837,6 +1851,7 @@ delete( {fname} [, {flags}]) Number delete the file or directory {fname}
|
||||
did_filetype() Number TRUE if FileType autocommand event used
|
||||
diff_filler( {lnum}) Number diff filler lines about {lnum}
|
||||
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||
disable_char_avail_for_testing({expr}) none test without typeahead
|
||||
empty( {expr}) Number TRUE if {expr} is empty
|
||||
escape( {string}, {chars}) String escape {chars} in {string} with '\'
|
||||
eval( {string}) any evaluate {string} into its value
|
||||
@@ -1943,9 +1958,15 @@ invert( {expr}) Number bitwise invert
|
||||
isdirectory( {directory}) Number TRUE if {directory} is a directory
|
||||
islocked( {expr}) Number TRUE if {expr} is locked
|
||||
items( {dict}) List key-value pairs in {dict}
|
||||
job_getchannel( {job}) Number get the channel handle for {job}
|
||||
job_start( {command} [, {options}]) Job start a job
|
||||
job_status( {job}) String get the status of a job
|
||||
job_stop( {job} [, {how}]) Number stop a job
|
||||
join( {list} [, {sep}]) String join {list} items into one String
|
||||
jsondecode( {string}) any decode JSON
|
||||
jsonencode( {expr}) String encode JSON
|
||||
js_decode( {string}) any decode JS style JSON
|
||||
js_encode( {expr}) String encode JS style JSON
|
||||
json_decode( {string}) any decode JSON
|
||||
json_encode( {expr}) String encode JSON
|
||||
keys( {dict}) List keys in {dict}
|
||||
len( {expr}) Number the length of {expr}
|
||||
libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
|
||||
@@ -1965,9 +1986,9 @@ mapcheck( {name}[, {mode} [, {abbr}]])
|
||||
String check for mappings matching {name}
|
||||
match( {expr}, {pat}[, {start}[, {count}]])
|
||||
Number position where {pat} matches in {expr}
|
||||
matchadd( {group}, {pattern}[, {priority}[, {id}]])
|
||||
matchadd( {group}, {pattern}[, {priority}[, {id} [, {dict}]]])
|
||||
Number highlight {pattern} with {group}
|
||||
matchaddpos( {group}, {list}[, {priority}[, {id}]])
|
||||
matchaddpos( {group}, {pos}[, {priority}[, {id}[, {dict}]]])
|
||||
Number highlight positions with {group}
|
||||
matcharg( {nr}) List arguments of |:match|
|
||||
matchdelete( {id}) Number delete match identified by {id}
|
||||
@@ -2029,10 +2050,6 @@ searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
|
||||
List search for other end of start/end pair
|
||||
searchpos( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
|
||||
List search for {pattern}
|
||||
sendexpr( {handle}, {expr} [, {callback}])
|
||||
any send {expr} over JSON channel {handle}
|
||||
sendraw( {handle}, {string} [, {callback}])
|
||||
any send {string} over raw channel {handle}
|
||||
server2client( {clientid}, {string})
|
||||
Number send reply string
|
||||
serverlist() String get a list of available servers
|
||||
@@ -2263,7 +2280,7 @@ assert_fails({cmd} [, {error}]) *assert_fails()*
|
||||
assert_false({actual} [, {msg}]) *assert_false()*
|
||||
When {actual} is not false an error message is added to
|
||||
|v:errors|, like with |assert_equal()|.
|
||||
A value is false when it is zero. When "{actual}" is not a
|
||||
A value is false when it is zero. When {actual} is not a
|
||||
number the assert fails.
|
||||
When {msg} is omitted an error in the form "Expected False but
|
||||
got {actual}" is produced.
|
||||
@@ -2431,7 +2448,6 @@ bufwinnr({expr}) *bufwinnr()*
|
||||
|:wincmd|.
|
||||
Only deals with the current tab page.
|
||||
|
||||
|
||||
byte2line({byte}) *byte2line()*
|
||||
Return the line number that contains the character at byte
|
||||
count {byte} in the current buffer. This includes the
|
||||
@@ -2666,17 +2682,83 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
don't fit, a vertical layout is used anyway. For some systems
|
||||
the horizontal layout is always used.
|
||||
|
||||
connect({address}, {mode} [, {callback}]) *connect()*
|
||||
ch_close({handle}) *ch_close()*
|
||||
Close channel {handle}. See |channel|.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_logfile( {fname} [, {mode}]) *ch_logfile()*
|
||||
Start logging channel activity to {fname}.
|
||||
When {fname} is an empty string: stop logging.
|
||||
|
||||
When {mode} is omitted or "a" append to the file.
|
||||
When {mode} is "w" start with an empty file.
|
||||
|
||||
The file is flushed after every message, on Unix you can use
|
||||
"tail -f" to see what is going on in real time.
|
||||
|
||||
ch_open({address} [, {argdict}]) *ch_open()*
|
||||
Open a channel to {address}. See |channel|.
|
||||
Returns the channel handle on success. Returns a negative
|
||||
number for failure.
|
||||
|
||||
{address} has the form "hostname:port", e.g.,
|
||||
"localhost:8765".
|
||||
|
||||
{mode} is either "json" or "raw". See |channel-mode| for the
|
||||
meaning.
|
||||
If {argdict} is given it must be a |Dictionary|. The optional
|
||||
items are:
|
||||
mode "raw", "js" or "json".
|
||||
Default "json".
|
||||
callback function to call for requests with a zero
|
||||
sequence number. See |channel-callback|.
|
||||
Default: none.
|
||||
waittime Specify connect timeout as milliseconds.
|
||||
Negative means forever.
|
||||
Default: 0 (don't wait)
|
||||
timeout Specify response read timeout value as
|
||||
milliseconds.
|
||||
Default: 2000.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
{callback} is a function that handles received messages on the
|
||||
channel. See |channel-callback|.
|
||||
ch_readraw({handle}) *ch_readraw()*
|
||||
Read from channel {handle} and return the received message.
|
||||
This uses the channel timeout. When there is nothing to read
|
||||
within that time an empty string is returned.
|
||||
TODO: depends on channel mode.
|
||||
|
||||
ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
|
||||
Send {expr} over channel {handle}. The {expr} is encoded
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel. See |channel-use|. *E912*
|
||||
|
||||
{options} must be a Dictionary.
|
||||
When "callback" is a Funcref or the name of a function,
|
||||
ch_sendexpr() returns immediately. The callback is invoked
|
||||
when the response is received. See |channel-callback|.
|
||||
|
||||
Without "callback" ch_sendexpr() waits for a response and
|
||||
returns the decoded expression. When there is an error or
|
||||
timeout it returns an empty string.
|
||||
|
||||
When "callback" is zero no response is expected.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_sendraw({handle}, {string} [, {options}]) *ch_sendraw()*
|
||||
Send {string} over channel {handle}.
|
||||
Works like |ch_sendexpr()|, but does not encode the request or
|
||||
decode the response. The caller is responsible for the
|
||||
correct contents. Also does not add a newline for a channel
|
||||
in NL mode, the caller must do that. The NL in the response
|
||||
is removed.
|
||||
See |channel-use|.
|
||||
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_status({handle}) *ch_status()*
|
||||
Return the status of channel {handle}:
|
||||
"fail" failed to open the channel
|
||||
"open" channel can be used
|
||||
"closed" channel can not be used
|
||||
|
||||
*copy()*
|
||||
copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
|
||||
@@ -2684,8 +2766,9 @@ copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
|
||||
When {expr} is a |List| a shallow copy is created. This means
|
||||
that the original |List| can be changed without changing the
|
||||
copy, and vice versa. But the items are identical, thus
|
||||
changing an item changes the contents of both |Lists|. Also
|
||||
see |deepcopy()|.
|
||||
changing an item changes the contents of both |Lists|.
|
||||
A |Dictionary| is copied in a similar way as a |List|.
|
||||
Also see |deepcopy()|.
|
||||
|
||||
cos({expr}) *cos()*
|
||||
Return the cosine of {expr}, measured in radians, as a |Float|.
|
||||
@@ -2793,9 +2876,11 @@ deepcopy({expr}[, {noref}]) *deepcopy()* *E698*
|
||||
different from using {expr} directly.
|
||||
When {expr} is a |List| a full copy is created. This means
|
||||
that the original |List| can be changed without changing the
|
||||
copy, and vice versa. When an item is a |List|, a copy for it
|
||||
is made, recursively. Thus changing an item in the copy does
|
||||
not change the contents of the original |List|.
|
||||
copy, and vice versa. When an item is a |List| or
|
||||
|Dictionary|, a copy for it is made, recursively. Thus
|
||||
changing an item in the copy does not change the contents of
|
||||
the original |List|.
|
||||
A |Dictionary| is copied in a similar way as a |List|.
|
||||
When {noref} is omitted or zero a contained |List| or
|
||||
|Dictionary| is only copied once. All references point to
|
||||
this single copy. With {noref} set to 1 every occurrence of a
|
||||
@@ -2856,11 +2941,23 @@ diff_hlID({lnum}, {col}) *diff_hlID()*
|
||||
The highlight ID can be used with |synIDattr()| to obtain
|
||||
syntax information about the highlighting.
|
||||
|
||||
*disable_char_avail_for_testing()*
|
||||
disable_char_avail_for_testing({expr})
|
||||
When {expr} is 1 the internal char_avail() function will
|
||||
return FALSE. When {expr} is 0 the char_avail() function will
|
||||
function normally.
|
||||
Only use this for a test where typeahead causes the test not
|
||||
to work. E.g., to trigger the CursorMovedI autocommand event.
|
||||
|
||||
empty({expr}) *empty()*
|
||||
Return the Number 1 if {expr} is empty, zero otherwise.
|
||||
A |List| or |Dictionary| is empty when it does not have any
|
||||
items. A Number is empty when its value is zero.
|
||||
|v:false|, |v:none| and |v:null| are empty, |v:true| is not.
|
||||
- A |List| or |Dictionary| is empty when it does not have any
|
||||
items.
|
||||
- A Number and Float is empty when its value is zero.
|
||||
- |v:false|, |v:none| and |v:null| are empty, |v:true| is not.
|
||||
- A Job is empty when it failed to start.
|
||||
- A Channel is empty when it is closed.
|
||||
|
||||
For a long |List| this is much faster than comparing the
|
||||
length with zero.
|
||||
|
||||
@@ -3883,7 +3980,7 @@ glob2regpat({expr}) *glob2regpat()*
|
||||
empty string.
|
||||
|
||||
*globpath()*
|
||||
globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
|
||||
globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
|
||||
Perform glob() on all directories in {path} and concatenate
|
||||
the results. Example: >
|
||||
:echo globpath(&rtp, "syntax/c.vim")
|
||||
@@ -3909,7 +4006,7 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
|
||||
they are separated by <NL> characters. Example: >
|
||||
:echo globpath(&rtp, "syntax/c.vim", 0, 1)
|
||||
<
|
||||
{allinks} is used as with |glob()|.
|
||||
{alllinks} is used as with |glob()|.
|
||||
|
||||
The "**" item can be used to search in a directory tree.
|
||||
For example, to find all "README.txt" files in the directories
|
||||
@@ -4256,6 +4353,91 @@ items({dict}) *items()*
|
||||
order.
|
||||
|
||||
|
||||
job_getchannel({job}) *job_getchannel()*
|
||||
Get the channel handle that {job} is using.
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
job_start({command} [, {options}]) *job_start()*
|
||||
Start a job and return a Job object. Unlike |system()| and
|
||||
|:!cmd| this does not wait for the job to finish.
|
||||
|
||||
{command} can be a String. This works best on MS-Windows. On
|
||||
Unix it is split up in white-separated parts to be passed to
|
||||
execvp(). Arguments in double quotes can contain white space.
|
||||
|
||||
{command} can be a List, where the first item is the executable
|
||||
and further items are the arguments. All items are converted
|
||||
to String. This works best on Unix.
|
||||
|
||||
On MS-Windows, job_start() makes a GUI application hidden. If
|
||||
want to show it, Use |:!start| instead.
|
||||
|
||||
The command is executed directly, not through a shell, the
|
||||
'shell' option is not used. To use the shell: >
|
||||
let job = job_start(["/bin/sh", "-c", "echo hello"])
|
||||
< Or: >
|
||||
let job = job_start('/bin/sh -c "echo hello"')
|
||||
< Note that this will start two processes, the shell and the
|
||||
command it executes. If you don't want this use the "exec"
|
||||
shell command.
|
||||
|
||||
On Unix $PATH is used to search for the executable only when
|
||||
the command does not contain a slash.
|
||||
|
||||
The job will use the same terminal as Vim. If it reads from
|
||||
stdin the job and Vim will be fighting over input, that
|
||||
doesn't work. Redirect stdin and stdout to avoid problems: >
|
||||
let job = job_start(['sh', '-c', "myserver </dev/null >/dev/null"])
|
||||
<
|
||||
The returned Job object can be used to get the status with
|
||||
|job_status()| and stop the job with |job_stop()|.
|
||||
|
||||
{options} must be a Dictionary. It can contain many optional
|
||||
items, see |job-options|.
|
||||
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
job_status({job}) *job_status()*
|
||||
Returns a String with the status of {job}:
|
||||
"run" job is running
|
||||
"fail" job failed to start
|
||||
"dead" job died or was stopped after running
|
||||
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
job_stop({job} [, {how}]) *job_stop()*
|
||||
Stop the {job}. This can also be used to signal the job.
|
||||
|
||||
When {how} is omitted or is "term" the job will be terminated
|
||||
normally. For Unix SIGTERM is sent. For MS-Windows
|
||||
CTRL_BREAK will be sent. This goes to the process group, thus
|
||||
children may also be affected.
|
||||
|
||||
Other values for Unix:
|
||||
"hup" Unix: SIGHUP
|
||||
"quit" Unix: SIGQUIT
|
||||
"kill" Unix: SIGKILL (strongest way to stop)
|
||||
number Unix: signal with that number
|
||||
|
||||
Other values for MS-Windows:
|
||||
"int" Windows: CTRL_C
|
||||
"kill" Windows: terminate process forcedly
|
||||
Others Windows: CTRL_BREAK
|
||||
|
||||
On Unix the signal is sent to the process group. This means
|
||||
that when the job is "sh -c command" it affects both the shell
|
||||
and the command.
|
||||
|
||||
The result is a Number: 1 if the operation could be executed,
|
||||
0 if "how" is not supported on the system.
|
||||
Note that even when the operation was executed, whether the
|
||||
job was actually stopped needs to be checked with
|
||||
job_status().
|
||||
The status of the job isn't checked, the operation will even
|
||||
be done when Vim thinks the job isn't running.
|
||||
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
join({list} [, {sep}]) *join()*
|
||||
Join the items in {list} together into one String.
|
||||
When {sep} is specified it is put in between the items. If
|
||||
@@ -4267,24 +4449,40 @@ join({list} [, {sep}]) *join()*
|
||||
converted into a string like with |string()|.
|
||||
The opposite function is |split()|.
|
||||
|
||||
jsondecode({string}) *jsondecode()*
|
||||
js_decode({string}) *js_decode()*
|
||||
This is similar to |json_decode()| with these differences:
|
||||
- Object key names do not have to be in quotes.
|
||||
- Empty items in an array (between two commas) are allowed and
|
||||
result in v:none items.
|
||||
|
||||
js_encode({expr}) *js_encode()*
|
||||
This is similar to |json_encode()| with these differences:
|
||||
- Object key names are not in quotes.
|
||||
- v:none items in an array result in an empty item between
|
||||
commas.
|
||||
For example, the Vim object:
|
||||
[1,v:none,{"one":1},v:none] ~
|
||||
Will be encoded as:
|
||||
[1,,{one:1},,] ~
|
||||
While json_encode() would produce:
|
||||
[1,null,{"one":1},null] ~
|
||||
This encoding is valid for JavaScript. It is more efficient
|
||||
than JSON, especially when using an array with optional items.
|
||||
|
||||
|
||||
json_decode({string}) *json_decode()*
|
||||
This parses a JSON formatted string and returns the equivalent
|
||||
in Vim values. See |jsonencode()| for the relation between
|
||||
in Vim values. See |json_encode()| for the relation between
|
||||
JSON and Vim values.
|
||||
The decoding is permissive:
|
||||
- A trailing comma in an array and object is ignored.
|
||||
- An empty item in an array, two commas with nothing or white
|
||||
space in between, results in v:none.
|
||||
- When an object member name is not a string it is converted
|
||||
to a string. E.g. the number 123 is used as the string
|
||||
"123".
|
||||
- More floating point numbers are recognized, e.g. "1." for
|
||||
"1.0".
|
||||
The result must be a valid Vim type:
|
||||
- An empty object member name is not allowed.
|
||||
- Duplicate object member names are not allowed.
|
||||
|
||||
jsonencode({expr}) *jsonencode()*
|
||||
json_encode({expr}) *json_encode()*
|
||||
Encode {expr} as JSON and return this as a string.
|
||||
The encoding is specified in:
|
||||
https://tools.ietf.org/html/rfc7159.html
|
||||
@@ -4299,7 +4497,7 @@ jsonencode({expr}) *jsonencode()*
|
||||
used recursively: {}
|
||||
v:false "false"
|
||||
v:true "true"
|
||||
v:none nothing
|
||||
v:none "null"
|
||||
v:null "null"
|
||||
Note that using v:none is permitted, although the JSON
|
||||
standard does not allow empty items. This can be useful for
|
||||
@@ -4636,7 +4834,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
|
||||
done like 'magic' is set and 'cpoptions' is empty.
|
||||
|
||||
*matchadd()* *E798* *E799* *E801*
|
||||
matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]])
|
||||
matchadd({group}, {pattern}[, {priority}[, {id}[, {dict}]]])
|
||||
Defines a pattern to be highlighted in the current window (a
|
||||
"match"). It will be highlighted with {group}. Returns an
|
||||
identification number (ID), which can be used to delete the
|
||||
@@ -4672,7 +4870,7 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]])
|
||||
highlighted matches. The dict can have the following members:
|
||||
|
||||
conceal Special character to show instead of the
|
||||
match (only for |hl-Conceal| highlighed
|
||||
match (only for |hl-Conceal| highlighted
|
||||
matches, see |:syn-cchar|)
|
||||
|
||||
The number of matches is not limited, as it is the case with
|
||||
@@ -5613,23 +5811,6 @@ searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *searchpos()*
|
||||
< In this example "submatch" is 2 when a lowercase letter is
|
||||
found |/\l|, 3 when an uppercase letter is found |/\u|.
|
||||
|
||||
sendexpr({handle}, {expr} [, {callback}]) *sendexpr()*
|
||||
Send {expr} over JSON channel {handle}. See |channel-use|.
|
||||
|
||||
When {callback} is given returns immediately. Without
|
||||
{callback} waits for a JSON response and returns the decoded
|
||||
expression. When there is an error or timeout returns an
|
||||
empty string.
|
||||
|
||||
When {callback} is zero no response is expected.
|
||||
Otherwise {callback} must be a Funcref or the name of a
|
||||
function. It is called when the response is received. See
|
||||
|channel-callback|.
|
||||
|
||||
sendraw({handle}, {string} [, {callback}]) *sendraw()*
|
||||
Send {string} over raw channel {handle}. See |channel-raw|.
|
||||
Works like |sendexpr()|, but does not decode the response.
|
||||
|
||||
server2client( {clientid}, {string}) *server2client()*
|
||||
Send a reply string to {clientid}. The most recent {clientid}
|
||||
that sent a string can be retrieved with expand("<client>").
|
||||
@@ -6679,6 +6860,8 @@ type({expr}) The result is a Number, depending on the type of {expr}:
|
||||
Float: 5
|
||||
Boolean: 6 (v:false and v:true)
|
||||
None 7 (v:null and v:none)
|
||||
Job 8
|
||||
Channel 9
|
||||
To avoid the magic numbers it should be used this way: >
|
||||
:if type(myvar) == type(0)
|
||||
:if type(myvar) == type("")
|
||||
@@ -6687,7 +6870,7 @@ type({expr}) The result is a Number, depending on the type of {expr}:
|
||||
:if type(myvar) == type({})
|
||||
:if type(myvar) == type(0.0)
|
||||
:if type(myvar) == type(v:false)
|
||||
:if type(myvar) == type(v:none
|
||||
:if type(myvar) == type(v:none)
|
||||
|
||||
undofile({name}) *undofile()*
|
||||
Return the name of the undo file that would be used for a file
|
||||
@@ -7053,7 +7236,7 @@ ebcdic Compiled on a machine with ebcdic character set.
|
||||
emacs_tags Compiled with support for Emacs tags.
|
||||
eval Compiled with expression evaluation support. Always
|
||||
true, of course!
|
||||
ex_extra Compiled with extra Ex commands |+ex_extra|.
|
||||
ex_extra |+ex_extra|, always true now
|
||||
extra_search Compiled with support for |'incsearch'| and
|
||||
|'hlsearch'|
|
||||
farsi Compiled with Farsi support |farsi|.
|
||||
@@ -7097,8 +7280,9 @@ listcmds Compiled with commands for the buffer list |:files|
|
||||
and the argument list |arglist|.
|
||||
localmap Compiled with local mappings and abbr. |:map-local|
|
||||
lua Compiled with Lua interface |Lua|.
|
||||
mac Macintosh version of Vim.
|
||||
macunix Macintosh version of Vim, using Unix files (OS-X).
|
||||
mac Any Macintosh version of Vim.
|
||||
macunix Compiled for OS X, with darwin
|
||||
osx Compiled for OS X, with or without darwin
|
||||
menu Compiled with support for |:menu|.
|
||||
mksession Compiled with support for |:mksession|.
|
||||
modify_fname Compiled with file name modifiers. |filename-modifiers|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 Sep 15
|
||||
*insert.txt* For Vim version 7.4. Last change: 2016 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1872,8 +1872,6 @@ NOTE: These commands cannot be used with |:global| or |:vglobal|.
|
||||
or script is finished.
|
||||
This command does not work from |:normal|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+ex_extra|
|
||||
feature}
|
||||
|
||||
*:stopi* *:stopinsert*
|
||||
:stopi[nsert] Stop Insert mode as soon as possible. Works like
|
||||
@@ -1891,15 +1889,11 @@ NOTE: These commands cannot be used with |:global| or |:vglobal|.
|
||||
script that the replacement will only start after
|
||||
the function or script is finished.
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+ex_extra|
|
||||
feature}
|
||||
|
||||
*:startgreplace*
|
||||
:startg[replace][!] Just like |:startreplace|, but use Virtual Replace
|
||||
mode, like with |gR|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+ex_extra|
|
||||
feature}
|
||||
|
||||
==============================================================================
|
||||
10. Inserting a file *inserting-file*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*netbeans.txt* For Vim version 7.4. Last change: 2016 Jan 27
|
||||
*netbeans.txt* For Vim version 7.4. Last change: 2016 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur et al.
|
||||
@@ -823,7 +823,7 @@ REJECT Not used.
|
||||
6.7 Protocol errors *nb-protocol_errors*
|
||||
|
||||
These errors occur when a message violates the protocol:
|
||||
*E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636*
|
||||
*E627* *E628* *E629* *E632* *E633* *E634* *E635* *E636*
|
||||
*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
|
||||
*E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.4. Last change: 2016 Jan 19
|
||||
*options.txt* For Vim version 7.4. Last change: 2016 Feb 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2308,7 +2308,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the encrypted bytes will be different.
|
||||
*blowfish2*
|
||||
blowfish2 Blowfish method. Medium strong encryption. Requires
|
||||
Vim 7.4.399 or later, files can NOT be read by Vim 7.3
|
||||
Vim 7.4.401 or later, files can NOT be read by Vim 7.3
|
||||
and older. This adds a "seed" to the file, every time
|
||||
you write the file the encrypted bytes will be
|
||||
different. The whole undo file is encrypted, not just
|
||||
@@ -3109,17 +3109,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
item default Used for ~
|
||||
stl:c ' ' or '^' statusline of the current window
|
||||
stlnc:c ' ' or '-' statusline of the non-current windows
|
||||
stlnc:c ' ' or '=' statusline of the non-current windows
|
||||
vert:c '|' vertical separators |:vsplit|
|
||||
fold:c '-' filling 'foldtext'
|
||||
diff:c '-' deleted lines of the 'diff' option
|
||||
|
||||
Any one that is omitted will fall back to the default. For "stl" and
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '-'
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '='
|
||||
otherwise.
|
||||
|
||||
Example: >
|
||||
:set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:-
|
||||
:set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:-
|
||||
< This is similar to the default, except that these characters will also
|
||||
be used when there is highlighting.
|
||||
|
||||
@@ -7119,7 +7119,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The option consists of printf style '%' items interspersed with
|
||||
normal text. Each status line item is of the form:
|
||||
%-0{minwid}.{maxwid}{item}
|
||||
All fields except the {item} is optional. A single percent sign can
|
||||
All fields except the {item} are optional. A single percent sign can
|
||||
be given as "%%". Up to 80 items can be specified. *E541*
|
||||
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
@@ -7710,6 +7710,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
non-keyword characters (white space is preferred). Maximum line
|
||||
length is 510 bytes.
|
||||
To obtain a file to be used here, check out this ftp site:
|
||||
[Sorry this link doesn't work anymore, do you know the right one?]
|
||||
ftp://ftp.ox.ac.uk/pub/wordlists/ First get the README file.
|
||||
To include a comma in a file name precede it with a backslash. Spaces
|
||||
after a comma are ignored, otherwise spaces are included in the file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2016 Jan 16
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -490,7 +490,7 @@ Additionally, these commands can be used:
|
||||
bt
|
||||
where
|
||||
*>frame*
|
||||
frame N Goes to N bactrace level. + and - signs make movement
|
||||
frame N Goes to N backtrace level. + and - signs make movement
|
||||
relative. E.g., ":frame +3" goes three frames up.
|
||||
*>up*
|
||||
up Goes one level up from call stacktrace.
|
||||
|
||||
+57
-7
@@ -9,6 +9,7 @@ $MYVIMRC starting.txt /*$MYVIMRC*
|
||||
$VIM starting.txt /*$VIM*
|
||||
$VIM-use version5.txt /*$VIM-use*
|
||||
$VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
$VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
% motion.txt /*%*
|
||||
%:. cmdline.txt /*%:.*
|
||||
%:8 cmdline.txt /*%:8*
|
||||
@@ -1235,6 +1236,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
+iconv various.txt /*+iconv*
|
||||
+iconv/dyn various.txt /*+iconv\/dyn*
|
||||
+insert_expand various.txt /*+insert_expand*
|
||||
+job various.txt /*+job*
|
||||
+jumplist various.txt /*+jumplist*
|
||||
+keymap various.txt /*+keymap*
|
||||
+langmap various.txt /*+langmap*
|
||||
@@ -4184,8 +4186,8 @@ E627 netbeans.txt /*E627*
|
||||
E628 netbeans.txt /*E628*
|
||||
E629 netbeans.txt /*E629*
|
||||
E63 pattern.txt /*E63*
|
||||
E630 netbeans.txt /*E630*
|
||||
E631 netbeans.txt /*E631*
|
||||
E630 channel.txt /*E630*
|
||||
E631 channel.txt /*E631*
|
||||
E632 netbeans.txt /*E632*
|
||||
E633 netbeans.txt /*E633*
|
||||
E634 netbeans.txt /*E634*
|
||||
@@ -4473,8 +4475,27 @@ E892 eval.txt /*E892*
|
||||
E893 eval.txt /*E893*
|
||||
E894 eval.txt /*E894*
|
||||
E895 if_mzsch.txt /*E895*
|
||||
E896 channel.txt /*E896*
|
||||
E897 channel.txt /*E897*
|
||||
E898 channel.txt /*E898*
|
||||
E899 channel.txt /*E899*
|
||||
E90 message.txt /*E90*
|
||||
E900 channel.txt /*E900*
|
||||
E901 channel.txt /*E901*
|
||||
E902 channel.txt /*E902*
|
||||
E903 channel.txt /*E903*
|
||||
E904 channel.txt /*E904*
|
||||
E905 channel.txt /*E905*
|
||||
E906 channel.txt /*E906*
|
||||
E907 eval.txt /*E907*
|
||||
E908 eval.txt /*E908*
|
||||
E909 eval.txt /*E909*
|
||||
E91 options.txt /*E91*
|
||||
E910 eval.txt /*E910*
|
||||
E911 eval.txt /*E911*
|
||||
E912 eval.txt /*E912*
|
||||
E913 eval.txt /*E913*
|
||||
E914 eval.txt /*E914*
|
||||
E92 message.txt /*E92*
|
||||
E93 windows.txt /*E93*
|
||||
E94 windows.txt /*E94*
|
||||
@@ -5198,6 +5219,13 @@ catch-text eval.txt /*catch-text*
|
||||
cc change.txt /*cc*
|
||||
ceil() eval.txt /*ceil()*
|
||||
ch.vim syntax.txt /*ch.vim*
|
||||
ch_close() eval.txt /*ch_close()*
|
||||
ch_logfile() eval.txt /*ch_logfile()*
|
||||
ch_open() eval.txt /*ch_open()*
|
||||
ch_readraw() eval.txt /*ch_readraw()*
|
||||
ch_sendexpr() eval.txt /*ch_sendexpr()*
|
||||
ch_sendraw() eval.txt /*ch_sendraw()*
|
||||
ch_status() eval.txt /*ch_status()*
|
||||
change-list-jumps motion.txt /*change-list-jumps*
|
||||
change-name tips.txt /*change-name*
|
||||
change-tabs change.txt /*change-tabs*
|
||||
@@ -5228,6 +5256,7 @@ channel-callback channel.txt /*channel-callback*
|
||||
channel-commands channel.txt /*channel-commands*
|
||||
channel-demo channel.txt /*channel-demo*
|
||||
channel-mode channel.txt /*channel-mode*
|
||||
channel-more channel.txt /*channel-more*
|
||||
channel-open channel.txt /*channel-open*
|
||||
channel-raw channel.txt /*channel-raw*
|
||||
channel-use channel.txt /*channel-use*
|
||||
@@ -5366,7 +5395,6 @@ complex-repeat repeat.txt /*complex-repeat*
|
||||
compress pi_gzip.txt /*compress*
|
||||
conceal syntax.txt /*conceal*
|
||||
confirm() eval.txt /*confirm()*
|
||||
connect() eval.txt /*connect()*
|
||||
connection-refused message.txt /*connection-refused*
|
||||
console-menus gui.txt /*console-menus*
|
||||
control intro.txt /*control*
|
||||
@@ -5599,6 +5627,7 @@ dip motion.txt /*dip*
|
||||
dircolors.vim syntax.txt /*dircolors.vim*
|
||||
dis motion.txt /*dis*
|
||||
disable-menus gui.txt /*disable-menus*
|
||||
disable_char_avail_for_testing() eval.txt /*disable_char_avail_for_testing()*
|
||||
discard editing.txt /*discard*
|
||||
distribute-script usr_41.txt /*distribute-script*
|
||||
distribution intro.txt /*distribution*
|
||||
@@ -6856,11 +6885,32 @@ java-indenting indent.txt /*java-indenting*
|
||||
java.vim syntax.txt /*java.vim*
|
||||
javascript-cinoptions indent.txt /*javascript-cinoptions*
|
||||
javascript-indenting indent.txt /*javascript-indenting*
|
||||
job channel.txt /*job*
|
||||
job-channel-overview channel.txt /*job-channel-overview*
|
||||
job-close-cb channel.txt /*job-close-cb*
|
||||
job-control channel.txt /*job-control*
|
||||
job-err-cb channel.txt /*job-err-cb*
|
||||
job-err-io channel.txt /*job-err-io*
|
||||
job-exit-cb channel.txt /*job-exit-cb*
|
||||
job-in-io channel.txt /*job-in-io*
|
||||
job-killonexit channel.txt /*job-killonexit*
|
||||
job-may-start channel.txt /*job-may-start*
|
||||
job-options channel.txt /*job-options*
|
||||
job-out-cb channel.txt /*job-out-cb*
|
||||
job-out-io channel.txt /*job-out-io*
|
||||
job-start channel.txt /*job-start*
|
||||
job-start-nochannel channel.txt /*job-start-nochannel*
|
||||
job-term channel.txt /*job-term*
|
||||
job_getchannel() eval.txt /*job_getchannel()*
|
||||
job_start() eval.txt /*job_start()*
|
||||
job_status() eval.txt /*job_status()*
|
||||
job_stop() eval.txt /*job_stop()*
|
||||
join() eval.txt /*join()*
|
||||
js_decode() eval.txt /*js_decode()*
|
||||
js_encode() eval.txt /*js_encode()*
|
||||
jsbterm-mouse options.txt /*jsbterm-mouse*
|
||||
jsondecode() eval.txt /*jsondecode()*
|
||||
jsonencode() eval.txt /*jsonencode()*
|
||||
json_decode() eval.txt /*json_decode()*
|
||||
json_encode() eval.txt /*json_encode()*
|
||||
jtags tagsrch.txt /*jtags*
|
||||
jump-motions motion.txt /*jump-motions*
|
||||
jumplist motion.txt /*jumplist*
|
||||
@@ -8001,8 +8051,6 @@ sed.vim syntax.txt /*sed.vim*
|
||||
self eval.txt /*self*
|
||||
send-money sponsor.txt /*send-money*
|
||||
send-to-menu gui_w32.txt /*send-to-menu*
|
||||
sendexpr() eval.txt /*sendexpr()*
|
||||
sendraw() eval.txt /*sendraw()*
|
||||
sendto gui_w32.txt /*sendto*
|
||||
sentence motion.txt /*sentence*
|
||||
server-functions usr_41.txt /*server-functions*
|
||||
@@ -8615,6 +8663,7 @@ timestamps editing.txt /*timestamps*
|
||||
tips tips.txt /*tips*
|
||||
tips.txt tips.txt /*tips.txt*
|
||||
todo todo.txt /*todo*
|
||||
todo.txt todo.txt /*todo.txt*
|
||||
toggle options.txt /*toggle*
|
||||
toggle-revins version4.txt /*toggle-revins*
|
||||
tolower() eval.txt /*tolower()*
|
||||
@@ -8652,6 +8701,7 @@ undo-tree undo.txt /*undo-tree*
|
||||
undo-two-ways undo.txt /*undo-two-ways*
|
||||
undo.txt undo.txt /*undo.txt*
|
||||
undo_ftplugin usr_41.txt /*undo_ftplugin*
|
||||
undo_indent usr_41.txt /*undo_indent*
|
||||
undofile() eval.txt /*undofile()*
|
||||
undotree() eval.txt /*undotree()*
|
||||
unicode mbyte.txt /*unicode*
|
||||
|
||||
+154
-36
@@ -1,4 +1,4 @@
|
||||
todo.txt* For Vim version 7.4. Last change: 2016 Jan 27
|
||||
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -34,6 +34,100 @@ not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
+channel:
|
||||
- Move netbeans NL handling to channel.c, use it for NL mode channel
|
||||
- ch_open fails when socket isn't present yet. (Marcin Szamotulski)
|
||||
Retry when error is "connection refused".
|
||||
- channel test waittime is disabled for MS-Windows, causes a crash.
|
||||
- channel needs both stdout and stderr (GUI implementation)
|
||||
- implement TODO items in ":help channel":
|
||||
- implement ch_setoptions(handle, {options})
|
||||
- job_setoptions(job, {options})
|
||||
- ch_close() closes stdin/stdout/stderr
|
||||
- out-cb
|
||||
- err-cb
|
||||
- exit-cb move code from mch_clear_job()
|
||||
- job argument: killonexit
|
||||
- ch_read() for stderr
|
||||
- ch_getjob(handle)
|
||||
- ch_read(handle [, timeout])
|
||||
- ch_readall(handle [, timeout])
|
||||
- job_info() should remove usable info: process ID, run/dead, etc.
|
||||
- job_maystart()
|
||||
- job_gethandle(), job_sethandle()
|
||||
- add ch_status(): Whether channel is open. Perhaps also mode, timeout.
|
||||
- When channel closes invoke "close-cb".
|
||||
- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
|
||||
- When receiving malformed json starting with a quote it doesn't get
|
||||
discarded.
|
||||
- When message in queue but there is no callback, drop it after a while?
|
||||
- Crash when closing channel after ch_sendexpr() with callback and outstanding
|
||||
request (Christian Robinson).
|
||||
- cleanup on exit? in mch_getout() and getout().
|
||||
- On Mac a 1 msec waittime is needed in ch_open(), why?
|
||||
- Add more log calls, basically at every branch, before every callback, etc.
|
||||
- Add timestamp to queued messages and callbacks with ID, remove after a
|
||||
minute.
|
||||
- add remark about undo sync, is there a way to force it?
|
||||
- When starting a job, have an option to open the server socket, so we know
|
||||
the port, and pass it to the command with --socket-fd {nr}. (Olaf Dabrunz,
|
||||
Feb 9) How to do this on MS-Windows?
|
||||
- Add more unit-testing in json_test.c
|
||||
- Add a test where ["eval","getline(123)"] gets a line with special
|
||||
characters (NUL, 0x80, etc.). Check that it isn't garbled.
|
||||
- make sure errors lead to a useful error msg. ["ex","foobar"]
|
||||
- json: implement UTF-16 surrogate pair.
|
||||
- For connection to server, a "keep open" flag would be useful. Retry
|
||||
connecting in the main loop with zero timeout.
|
||||
More plugin support:
|
||||
- Have a way to install a callback from the main loop. Called every second or
|
||||
so.
|
||||
- Need way to uniquely identify a window, no matter how windows are
|
||||
rearranged. Same for tab pages.
|
||||
getwinid() ID of current winow
|
||||
getwinid({nr}) ID of window {nr}
|
||||
getwinid({nr}, {tab}) ID of window {nr} in tab page {tab}
|
||||
getwinnr({id}) window nr of {id} or -1 if not open
|
||||
gettabnr({id}) tab page nr of {id} or -1 if not open
|
||||
gotowin({id})
|
||||
Make it so that the window ID can be used where currently a window nr is used
|
||||
|
||||
Patch on #608: (Ken Takata)
|
||||
https://bitbucket.org/k_takata/vim-ktakata-mq/src/479934b94fd56b064c9e4bd8737585c5df69d56a/fix-gvimext-loadlibrary.patch?fileviewer=file-view-default
|
||||
|
||||
This difference is unexpected:
|
||||
echo v:true == 1
|
||||
1
|
||||
echo [v:true] == [1]
|
||||
0
|
||||
It's because tv_equal() works different.
|
||||
|
||||
Add "runtime/bundles" ?
|
||||
runtime/bundles/netrw/spec.vim
|
||||
runtime/bundles/netrw/autoload/netrw.vim
|
||||
runtime/bundles/netrw/syntax/netrw.vim
|
||||
etc.
|
||||
Need an alternative for 'runtimepath' that tells where bundles are to be
|
||||
found. 'bundlepath' ?
|
||||
The plugins under 'bundlepath' would always be loaded. Also have a path for
|
||||
optional plugins? 'optbundlepath'? Or have directories "bundlesdef" and
|
||||
"bundlesopt"?
|
||||
Then use a command "loadplugin" to find a plugin in "optional".
|
||||
"bundles" is used by some plugin managers, need another name. "packages"?
|
||||
Add a "requires" / "provides" mechanism?
|
||||
if my_feature_enabled
|
||||
require +python
|
||||
endif
|
||||
require my_other_plugin
|
||||
~/vim/packages/netrw/def/netrw/plugin/netrw.vim
|
||||
~/vim/packages/netrw/opt/nwdebug/plugin/nwdebug.vim
|
||||
|
||||
Why does this: echo "a" . 1.1
|
||||
result in: a11
|
||||
Should recognize float (so long as it's not ".1.1").
|
||||
|
||||
Allow for an empty dictionary key.
|
||||
|
||||
Regexp problems:
|
||||
- The regexp engines are not reentrant, causing havoc when interrupted by a
|
||||
remote expression or something else. Move global variables onto the stack
|
||||
@@ -75,27 +169,23 @@ Regexp problems:
|
||||
- The pattern "\1" with the old engine gives E65, with the new engine it
|
||||
matches the empty string. (Dominique Pelle, 2015 Oct 2, Nov 24)
|
||||
- Search for \\~ causes error E874.
|
||||
- "\%1l^#.*" does not match on a line starting with "#". The zero-width match
|
||||
clears the start-of-line flag.
|
||||
|
||||
+channel:
|
||||
- cleanup on exit? in mch_getout() and getout().
|
||||
- more contents in channel.txt
|
||||
Also include update_curswant() fix for getcurpos(). (Christian Brabandt, 2016
|
||||
Feb 9)
|
||||
|
||||
C89: remove __ARGS in more places
|
||||
- /tmp/noargs.vim
|
||||
- /tmp/eliminate__ARGS.vim
|
||||
- Script: Hirohito Higashi, Jan 25, 2nd one.
|
||||
- Assume HAVE_STDARG_H is always defined.
|
||||
Patch to put undo options together in undo window.
|
||||
(Gary Johnson, 2016 Jan 28)
|
||||
|
||||
This difference is unexpected:
|
||||
echo v:true == 1
|
||||
1
|
||||
echo [v:true] == [1]
|
||||
0
|
||||
It's because tv_equal() works different.
|
||||
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
|
||||
has tests)
|
||||
|
||||
Do we need to roll-back patch 1165, that put libintl-8.dll before libintl.dll?
|
||||
Patch to update the GTK icon cache when installing. (Kazunobu Kuriyama, 2016
|
||||
Feb 3)
|
||||
|
||||
Patch for test86 and test87. (Roland Puntaier, #622)
|
||||
|
||||
Patch for Python: #622. (Roland Puntaier, 2016 Feb 2)
|
||||
What does it change?
|
||||
|
||||
Need to try out instructions in INSSTALLpc.txt about how to install all
|
||||
interfaces and how to build Vim with them.
|
||||
@@ -106,6 +196,9 @@ result: https://ci.appveyor.com/project/k-takata/vim/history
|
||||
Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
|
||||
More info Jul 24. Not clear why.
|
||||
|
||||
Duplication of completion suggestions for ":!hom". Issue 539.
|
||||
Patch by Christian, 2016 Jan 29
|
||||
>
|
||||
Problem that a previous silent ":throw" causes a following try/catch not to
|
||||
work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
|
||||
|
||||
@@ -117,6 +210,8 @@ What if there is an invalid character?
|
||||
Should jsonencode()/jsondecode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
Patch to fix bug in statusline highlighting. (Christian Brabandt, 2016 Feb 2)
|
||||
|
||||
Use vim.vim syntax highlighting for help file examples, but without ":" in
|
||||
'iskeyword' for syntax.
|
||||
|
||||
@@ -132,23 +227,33 @@ Should use /usr/local/share/applications or /usr/share/applications.
|
||||
Or use $XDG_DATA_DIRS.
|
||||
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
|
||||
|
||||
Move the README files that are for including in archives to a subdirectory.
|
||||
"readmedir/" ?
|
||||
|
||||
Access to uninitialized memory in match_backref() regexp_nda.c:4882
|
||||
(Dominique Pelle, 2015 Nov 6)
|
||||
|
||||
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
|
||||
directory exists. (Sergio Gallelli, 2013 Dec 29)
|
||||
|
||||
Patch to avoid redrawing tabline when the popup menu is visible.
|
||||
(Christian Brabandt, 2016 Jan 28)
|
||||
|
||||
Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
|
||||
More tests May 14. Update May 29. Update Aug 10.
|
||||
Now part of large file patches. (Ken Takata, 2016 Jan 19, second one)
|
||||
Updated patches with ordering: Jan 20.
|
||||
And another update: Jan 24
|
||||
Now part of large file patches. (Ken Takata, 2016 Feb 1)
|
||||
Two patches now?
|
||||
|
||||
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
|
||||
|
||||
7 Add a watchpoint in the debug mode: An expression that breaks execution
|
||||
when evaluating to non-zero. Add the "watchadd expr" command, stop when
|
||||
the value of the expression changes. ":watchdel" deletes an item,
|
||||
":watchlist" lists the items. (Charles Campbell)
|
||||
Patch by Christian Brabandt, 2016 Jan 27.
|
||||
Patch by Christian Brabandt, 2016 Feb 1.
|
||||
|
||||
Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6)
|
||||
Update Sep 7. Update by Christian Brabandt, 2015 Sep 8, 2016 Feb 1.
|
||||
|
||||
Using ":windo" to set options in all windows has the side effect that it
|
||||
changes the window layout and the current window. Make a variant that saves
|
||||
@@ -158,6 +263,21 @@ Patch to add <restore> to :windo, :bufdo, etc. (Christian Brabandt, 2015 Jan
|
||||
6, 2nd message)
|
||||
Alternative: ":keeppos" command modifier: ":keeppos windo {cmd}".
|
||||
|
||||
Patch to fix that executable() may fail on very long filename in MS-Windows.
|
||||
(Ken Takata, 2016 Feb 1)
|
||||
|
||||
Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
|
||||
Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
|
||||
https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
|
||||
|
||||
Patch to make the behavior of "w" more straightforward, but not Vi compatible.
|
||||
With a 'cpo' flag. (Christian Brabandt, 2016 Feb 8)
|
||||
|
||||
Patch to add TagNotFound autocommand. (Anton Lindqvist, 2016 Feb 3)
|
||||
|
||||
Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 14)
|
||||
Only remembers one error.
|
||||
|
||||
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
|
||||
|
||||
Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
|
||||
@@ -165,15 +285,11 @@ Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
|
||||
Unexpected delay when using CTRL-O u. It's not timeoutlen.
|
||||
(Gary Johnson, 2015 Aug 28)
|
||||
|
||||
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
|
||||
|
||||
Instead of separately uploading patches to the ftp site, we can get them from
|
||||
github with a URL like this:
|
||||
https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff
|
||||
Diff for version.c contains more context, can't skip a patch.
|
||||
|
||||
Duplication of completion suggestions for ":!hom". Issue 539.
|
||||
>
|
||||
When t_Co is changed from termresponse, the OptionSet autocmmand event isn't
|
||||
triggered. Use the code from the end of set_num_option() in
|
||||
set_color_count().
|
||||
@@ -210,6 +326,9 @@ Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||
Build with Python on Mac does not always use the right library.
|
||||
(Kazunobu Kuriyama, 2015 Mar 28)
|
||||
|
||||
Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
|
||||
Does not fully work yet.
|
||||
|
||||
Need a Vim equivalent of Python's None and a way to test for it.
|
||||
Use v:none. var == v:none
|
||||
|
||||
@@ -225,6 +344,9 @@ is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19)
|
||||
Test 44 fails when [[=A=]] is changed to [[=À=]]. Caused by getcmdline() not
|
||||
handling the 0x80 as a second byte correctly? (Dominique Pelle, 2015 Jun 10)
|
||||
|
||||
Patch to use two highlight groups for relative numbers. (Shaun Brady, 2016 Jan
|
||||
30)
|
||||
|
||||
Weird encryption problems on Windows. (Ben Fritz, 2015 Feb 13)
|
||||
Goes away when disabling the swap file. (might1, Feb 16)
|
||||
|
||||
@@ -262,9 +384,6 @@ Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
|
||||
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
|
||||
Sep 10)
|
||||
|
||||
Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6)
|
||||
Update Sep 7. Update by Christian Brabandt, 2015 Sep 8.
|
||||
|
||||
Patch to improve I/O for Perl. (Damien, 2015 Jan 9, update Jan 22 2nd one)
|
||||
|
||||
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
|
||||
@@ -409,7 +528,7 @@ Patch: On MS-Windows shellescape() may have to triple double quotes.
|
||||
(Ingo Karkat, 2015 Jan 16)
|
||||
|
||||
Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15)
|
||||
Update 2015 Jul 25 (email).
|
||||
Update 2016 Jan 31 (email).
|
||||
|
||||
Redo only remembers the last change. Could use "{count}g." to redo an older
|
||||
change. How does the user know which change? At least have a way to list
|
||||
@@ -433,7 +552,7 @@ Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not
|
||||
insert a space. (Micha Mos, 2014 Nov 7)
|
||||
|
||||
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
|
||||
Update Dec 6.
|
||||
Updated 2016 Feb 10
|
||||
|
||||
Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
|
||||
|
||||
@@ -456,6 +575,8 @@ compatible with Vim spell files. The old files can no longer be downloaded.
|
||||
Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
|
||||
Saito, 2013 Apr 24) Has a problem (email 2015 Jan 7).
|
||||
Update 2015 Jan 10.
|
||||
Also see issue #609.
|
||||
We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke.
|
||||
|
||||
Idea: For a window in the middle (has window above and below it), use
|
||||
right-mouse-drag on the status line to move a window up/down without changing
|
||||
@@ -543,10 +664,6 @@ Yasuhiro Matsumoto, 2013 May 31.
|
||||
Or should we add a more general mechanism, like a lambda() function?
|
||||
Patch by Yasuhiro Matsumoto, 2014 Sep 16.
|
||||
|
||||
Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
|
||||
Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
|
||||
https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
|
||||
|
||||
VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
|
||||
instead. (Samuel Ferencik, 2013 Sep 28)
|
||||
|
||||
@@ -568,6 +685,7 @@ Patch to add ":undorecover", get as much text out of the undo file as
|
||||
possible. (Christian Brabandt, 2014 Mar 12, update Aug 22)
|
||||
|
||||
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
|
||||
It can replace the BeOS code, which is likely not used anymore.
|
||||
|
||||
Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16)
|
||||
|
||||
@@ -2554,7 +2672,7 @@ GUI:
|
||||
Need better separation of Vim core and GUI code.
|
||||
8 When fontset support is enabled, setting 'guifont' to a single font
|
||||
doesn't work.
|
||||
8 Menu priority for sub-menus for: Amiga, BeOS.
|
||||
8 Menu priority for sub-menus for: Amiga.
|
||||
8 When translating menus ignore the part after the Tab, the shortcut. So
|
||||
that the same menu item with a different shortcut (e.g., for the Mac) are
|
||||
still translated.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2016 Jan 28
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2016 Feb 14
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -894,10 +894,10 @@ Testing: *test-functions*
|
||||
assert_true() assert that an expression is true
|
||||
|
||||
Inter-process communication:
|
||||
connect() open a channel
|
||||
disconnect() close a channel
|
||||
sendexpr() send a JSON message over a channel
|
||||
sendraw() send a raw message over a channel
|
||||
ch_open() open a channel
|
||||
ch_close() close a channel
|
||||
ch_sendexpr() send a JSON message over a channel
|
||||
ch_sendraw() send a raw message over a channel
|
||||
jsonencode() encode an expression to a JSON string
|
||||
jsondecode() decode a JSON string to Vim types
|
||||
|
||||
@@ -2235,7 +2235,7 @@ This construct makes sure the function is only defined once: >
|
||||
:endif
|
||||
<
|
||||
|
||||
UNDO *undo_ftplugin*
|
||||
UNDO *undo_indent* *undo_ftplugin*
|
||||
|
||||
When the user does ":setfiletype xyz" the effect of the previous filetype
|
||||
should be undone. Set the b:undo_ftplugin variable to the commands that will
|
||||
@@ -2250,6 +2250,9 @@ global value. That is mostly the best way to reset the option value.
|
||||
This does require removing the "C" flag from 'cpoptions' to allow line
|
||||
continuation, as mentioned above |use-cpo-save|.
|
||||
|
||||
For undoing the effect of an indent script, the b:undo_indent variable should
|
||||
be set accordingly.
|
||||
|
||||
|
||||
FILE NAME
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 7.4. Last change: 2016 Jan 27
|
||||
*various.txt* For Vim version 7.4. Last change: 2016 Feb 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -208,8 +208,6 @@ g8 Print the hex values of the bytes used in the
|
||||
Example: >
|
||||
:exe "normal \<c-w>\<c-w>"
|
||||
< {not in Vi, of course}
|
||||
{not available when the |+ex_extra| feature was
|
||||
disabled at compile time}
|
||||
|
||||
:{range}norm[al][!] {commands} *:normal-range*
|
||||
Execute Normal mode commands {commands} for each line
|
||||
@@ -218,8 +216,6 @@ g8 Print the hex values of the bytes used in the
|
||||
for each line. Otherwise it's the same as the
|
||||
":normal" command without a range.
|
||||
{not in Vi}
|
||||
{not available when |+ex_extra| feature was disabled
|
||||
at compile time}
|
||||
|
||||
*:sh* *:shell* *E371*
|
||||
:sh[ell] This command starts a shell. When the shell exits
|
||||
@@ -342,8 +338,7 @@ m *+directx* Win32 GUI only: DirectX and |'renderoptions'|
|
||||
*+dnd* Support for DnD into the "~ register |quote_~|.
|
||||
B *+emacs_tags* |emacs-tags| files
|
||||
N *+eval* expression evaluation |eval.txt|
|
||||
N *+ex_extra* Vim's extra Ex commands: |:center|, |:left|,
|
||||
|:normal|, |:retab| and |:right|
|
||||
N *+ex_extra* always on now, used to be for Vim's extra Ex commands
|
||||
N *+extra_search* |'hlsearch'| and |'incsearch'| options.
|
||||
B *+farsi* |farsi| language
|
||||
N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>|
|
||||
@@ -364,6 +359,7 @@ m *+hangul_input* Hangul input support |hangul|
|
||||
*+iconv* Compiled with the |iconv()| function
|
||||
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
|
||||
N *+insert_expand* |insert_expand| Insert mode completion
|
||||
m *+job* starting and stopping jobs |job|
|
||||
N *+jumplist* |jumplist|
|
||||
B *+keymap* |'keymap'|
|
||||
B *+langmap* |'langmap'|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vi_diff.txt* For Vim version 7.4. Last change: 2015 Nov 01
|
||||
*vi_diff.txt* For Vim version 7.4. Last change: 2016 Feb 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -960,7 +960,7 @@ Only Vim is able to accept options in between and after the file names.
|
||||
In 2005 the POSIX test suite was run to check the compatibility of Vim. Most
|
||||
of the test was executed properly. There are the few things where Vim
|
||||
is not POSIX compliant, even when run in Vi compatibility mode.
|
||||
|
||||
*$VIM_POSIX*
|
||||
Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX
|
||||
flags when Vim starts up. This makes Vim run as POSIX as it can. That's
|
||||
a bit different from being Vi compatible.
|
||||
|
||||
@@ -159,7 +159,7 @@ Note: "+" と "\-c" は合わせて 10 個まで指定できます。
|
||||
.TP
|
||||
\-b
|
||||
バイナリモード。
|
||||
バイナリファイルを編集ためのオプションがいくつか設定されます。
|
||||
バイナリファイルを編集するためのオプションがいくつか設定されます。
|
||||
.TP
|
||||
\-C
|
||||
互換モード。'compatible' オプションがオンになります。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 7.4. Last change: 2015 Nov 14
|
||||
*windows.txt* For Vim version 7.4. Last change: 2016 Feb 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -721,7 +721,7 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
*:bufdo*
|
||||
:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
|
||||
[range] is given only for buffers for which their
|
||||
buffer numer is in the [range]. It works like doing
|
||||
buffer number is in the [range]. It works like doing
|
||||
this: >
|
||||
:bfirst
|
||||
:{cmd}
|
||||
|
||||
@@ -61,6 +61,16 @@
|
||||
行末には ascii (または ebcdic) で表した場合の文字が表示されます。
|
||||
このモードでは \-r、\-p、\-i は機能しません。
|
||||
.TP
|
||||
.IR \-e
|
||||
リトルエンディアンの 16 進ダンプに切り替える。
|
||||
このオプションは、バイトのグループをリトルエンディアンのバイト順のワードとして
|
||||
扱います。標準のグルーピングは 4 バイトですが、
|
||||
.RI "" \-g
|
||||
を使うことで変更可能です。
|
||||
このオプションは 16 進ダンプのみに適用され、ASCII (あるいは EBCDIC) 表示は
|
||||
変更されません。
|
||||
このモードでは \-r、\-p、\-i は機能しません。
|
||||
.TP
|
||||
.IR "\-c cols " | " \-cols cols"
|
||||
一行
|
||||
.RI < cols >
|
||||
@@ -80,7 +90,8 @@
|
||||
.I \-g 0
|
||||
を指定してください。
|
||||
.RI < Bytes >
|
||||
の標準設定は \fI2\fP です。2 進ダンプの場合は \fI1\fP です。
|
||||
の標準設定は \fI2\fP で、リトルエンディアンモードの場合は \fI4\fP 、
|
||||
2 進ダンプの場合は \fI1\fP です。
|
||||
ポストスクリプト形式やインクルード形式で出力するときは、このオプションは使わ
|
||||
れません。
|
||||
.TP
|
||||
@@ -95,6 +106,11 @@ C インクルードファイル形式で出力します。入力ファイルの
|
||||
.RI < len >
|
||||
オクテットだけ出力する。
|
||||
.TP
|
||||
.I \-o offset
|
||||
表示されるファイル位置に
|
||||
.RI < offset >
|
||||
を加算する。
|
||||
.TP
|
||||
.IR \-p " | " \-ps " | " \-postscript " | " \-plain
|
||||
ポストスクリプト形式の 16 進ダンプを出力する。別名 プレーン 16 進ダンプ。
|
||||
.TP
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: man
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2015 Nov 24
|
||||
" Last Change: 2016 Feb 04
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -160,7 +160,9 @@ func <SID>GetPage(...)
|
||||
|
||||
setl ma nonu nornu nofen
|
||||
silent exec "norm 1GdG"
|
||||
let $MANWIDTH = winwidth(0)
|
||||
if empty($MANWIDTH)
|
||||
let $MANWIDTH = winwidth(0)
|
||||
endif
|
||||
silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
|
||||
" Remove blank lines from top and bottom.
|
||||
while getline(1) =~ '^\s*$'
|
||||
|
||||
+33
-27
@@ -3,8 +3,8 @@
|
||||
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
|
||||
" URL: http://www.2072productions.com/vim/indent/php.vim
|
||||
" Home: https://github.com/2072/PHP-Indenting-for-VIm
|
||||
" Last Change: 2014 November 26th
|
||||
" Version: 1.57
|
||||
" Last Change: 2015 September 8th
|
||||
" Version: 1.60
|
||||
"
|
||||
"
|
||||
" Type :help php-indent for available options
|
||||
@@ -50,16 +50,25 @@ let b:did_indent = 1
|
||||
|
||||
let g:php_sync_method = 0
|
||||
|
||||
if exists('*shiftwidth')
|
||||
function! s:sw()
|
||||
return shiftwidth()
|
||||
endfunction
|
||||
else
|
||||
function! s:sw()
|
||||
return &shiftwidth
|
||||
endfunction
|
||||
endif
|
||||
|
||||
|
||||
if exists("PHP_default_indenting")
|
||||
let b:PHP_default_indenting = PHP_default_indenting * &sw
|
||||
let b:PHP_default_indenting = PHP_default_indenting * s:sw()
|
||||
else
|
||||
let b:PHP_default_indenting = 0
|
||||
endif
|
||||
|
||||
if exists("PHP_outdentSLComments")
|
||||
let b:PHP_outdentSLComments = PHP_outdentSLComments * &sw
|
||||
let b:PHP_outdentSLComments = PHP_outdentSLComments * s:sw()
|
||||
else
|
||||
let b:PHP_outdentSLComments = 0
|
||||
endif
|
||||
@@ -124,7 +133,7 @@ endif
|
||||
|
||||
if exists("*GetPhpIndent")
|
||||
call ResetPhpOptions()
|
||||
finish " XXX -- comment this line for easy dev
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -135,7 +144,7 @@ let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
|
||||
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||
|
||||
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
|
||||
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
|
||||
|
||||
|
||||
@@ -200,7 +209,7 @@ function! GetLastRealCodeLNum(startline) " {{{
|
||||
|
||||
|
||||
elseif lastline =~? '^\a\w*;\=$' && lastline !~? s:notPhpHereDoc
|
||||
let tofind=substitute( lastline, '\(\a\w*\);\=', '<<<''\\=\1''\\=$', '')
|
||||
let tofind=substitute( lastline, '\(\a\w*\);\=', '<<<\\s*[''"]\\=\1[''"]\\=$', '')
|
||||
while getline(lnum) !~? tofind && lnum > 1
|
||||
let lnum = lnum - 1
|
||||
endwhile
|
||||
@@ -314,7 +323,7 @@ function! FindTheSwitchIndent (lnum) " {{{
|
||||
let test = GetLastRealCodeLNum(a:lnum - 1)
|
||||
|
||||
if test <= 1
|
||||
return indent(1) - &sw * b:PHP_vintage_case_default_indent
|
||||
return indent(1) - s:sw() * b:PHP_vintage_case_default_indent
|
||||
end
|
||||
|
||||
while getline(test) =~ '^\s*}' && test > 1
|
||||
@@ -328,7 +337,7 @@ function! FindTheSwitchIndent (lnum) " {{{
|
||||
if getline(test) =~# '^\s*switch\>'
|
||||
return indent(test)
|
||||
elseif getline(test) =~# s:defaultORcase
|
||||
return indent(test) - &sw * b:PHP_vintage_case_default_indent
|
||||
return indent(test) - s:sw() * b:PHP_vintage_case_default_indent
|
||||
else
|
||||
return FindTheSwitchIndent(test)
|
||||
endif
|
||||
@@ -401,7 +410,7 @@ function! GetPhpIndent()
|
||||
endif
|
||||
|
||||
if b:PHP_default_indenting
|
||||
let b:PHP_default_indenting = g:PHP_default_indenting * &sw
|
||||
let b:PHP_default_indenting = g:PHP_default_indenting * s:sw()
|
||||
endif
|
||||
|
||||
let cline = getline(v:lnum)
|
||||
@@ -439,6 +448,7 @@ function! GetPhpIndent()
|
||||
|
||||
if !b:InPHPcode_checked " {{{ One time check
|
||||
let b:InPHPcode_checked = 1
|
||||
let b:UserIsTypingComment = 0
|
||||
|
||||
let synname = ""
|
||||
if cline !~ '<?.*?>'
|
||||
@@ -447,8 +457,7 @@ function! GetPhpIndent()
|
||||
|
||||
if synname!=""
|
||||
if synname == "SpecStringEntrails"
|
||||
let b:InPHPcode = -1 " thumb down
|
||||
let b:UserIsTypingComment = 0
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode_tofind = ""
|
||||
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
|
||||
let b:InPHPcode = 1
|
||||
@@ -456,8 +465,7 @@ function! GetPhpIndent()
|
||||
|
||||
if synname =~# '^php\%(Doc\)\?Comment'
|
||||
let b:UserIsTypingComment = 1
|
||||
else
|
||||
let b:UserIsTypingComment = 0
|
||||
let b:InPHPcode_checked = 0
|
||||
endif
|
||||
|
||||
if synname =~? '^javaScript'
|
||||
@@ -466,18 +474,16 @@ function! GetPhpIndent()
|
||||
|
||||
else
|
||||
let b:InPHPcode = 0
|
||||
let b:UserIsTypingComment = 0
|
||||
|
||||
let lnum = v:lnum - 1
|
||||
while getline(lnum) !~? '<<<''\=\a\w*''\=$' && lnum > 1
|
||||
while getline(lnum) !~? '<<<\s*[''"]\=\a\w*[''"]\=$' && lnum > 1
|
||||
let lnum = lnum - 1
|
||||
endwhile
|
||||
|
||||
let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<''\=\(\a\w*\)''\=$', '^\\s*\1;\\=$', '')
|
||||
let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '')
|
||||
endif
|
||||
else
|
||||
let b:InPHPcode = 0
|
||||
let b:UserIsTypingComment = 0
|
||||
let b:InPHPcode_tofind = s:PHP_startindenttag
|
||||
endif
|
||||
endif "!b:InPHPcode_checked }}}
|
||||
@@ -537,9 +543,9 @@ function! GetPhpIndent()
|
||||
elseif last_line =~ '^[^''"`]\+[''"`]$'
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
|
||||
elseif last_line =~? '<<<''\=\a\w*''\=$'
|
||||
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
|
||||
let b:InPHPcode = 0
|
||||
let b:InPHPcode_tofind = substitute( last_line, '^.*<<<''\=\(\a\w*\)''\=$', '^\\s*\1;\\=$', '')
|
||||
let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '')
|
||||
|
||||
elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*'
|
||||
let b:InPHPcode = 0
|
||||
@@ -660,7 +666,7 @@ function! GetPhpIndent()
|
||||
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
|
||||
return indent(FindTheIfOfAnElse(v:lnum, 1))
|
||||
elseif cline =~# s:defaultORcase
|
||||
return FindTheSwitchIndent(v:lnum) + &sw * b:PHP_vintage_case_default_indent
|
||||
return FindTheSwitchIndent(v:lnum) + s:sw() * b:PHP_vintage_case_default_indent
|
||||
elseif cline =~ '^\s*)\=\s*{'
|
||||
let previous_line = last_line
|
||||
let last_line_num = lnum
|
||||
@@ -672,7 +678,7 @@ function! GetPhpIndent()
|
||||
let ind = indent(last_line_num)
|
||||
|
||||
if b:PHP_BracesAtCodeLevel
|
||||
let ind = ind + &sw
|
||||
let ind = ind + s:sw()
|
||||
endif
|
||||
|
||||
return ind
|
||||
@@ -683,7 +689,7 @@ function! GetPhpIndent()
|
||||
endwhile
|
||||
|
||||
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
|
||||
let ind = ind + &sw
|
||||
let ind = ind + s:sw()
|
||||
return ind + addSpecial
|
||||
|
||||
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
|
||||
@@ -782,7 +788,7 @@ function! GetPhpIndent()
|
||||
endif
|
||||
|
||||
if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{')
|
||||
let ind = ind + &sw
|
||||
let ind = ind + s:sw()
|
||||
endif
|
||||
|
||||
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1
|
||||
@@ -800,17 +806,17 @@ function! GetPhpIndent()
|
||||
endif
|
||||
|
||||
elseif last_line =~ '^\s*'.s:blockstart
|
||||
let ind = ind + &sw
|
||||
let ind = ind + s:sw()
|
||||
|
||||
|
||||
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
|
||||
let ind = ind + &sw
|
||||
let ind = ind + s:sw()
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
if cline =~ '^\s*[)\]];\='
|
||||
let ind = ind - &sw
|
||||
let ind = ind - s:sw()
|
||||
endif
|
||||
|
||||
let b:PHP_CurrentIndentLevel = ind
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-12-15
|
||||
" Latest Revision: 2016-01-15
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-sh-indent
|
||||
|
||||
@@ -28,7 +28,7 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function s:buffer_shiftwidth()
|
||||
return &shiftwidth
|
||||
return shiftwidth()
|
||||
endfunction
|
||||
|
||||
let s:sh_indent_defaults = {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
" vi:set ts=8 sts=8 sw=8 tw=0:
|
||||
"
|
||||
" Menu Translations: Japanese (EUC-JP)
|
||||
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 12-May-2013.
|
||||
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 28-Jan-2016.
|
||||
"
|
||||
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
|
||||
" vim-jp (http://vim-jp.org/)
|
||||
"
|
||||
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@@ -20,7 +22,7 @@ scriptencoding euc-jp
|
||||
" Help menu
|
||||
menutrans &Help ヘルプ(&H)
|
||||
menutrans &Overview<Tab><F1> 概略(&O)<Tab><F1>
|
||||
menutrans &User\ Manual ユーザマニュアル(&U)
|
||||
menutrans &User\ Manual ユーザーマニュアル(&U)
|
||||
menutrans &How-to\ links &How-toリンク
|
||||
menutrans &Credits クレジット(&C)
|
||||
menutrans Co&pying 著作権情報(&P)
|
||||
@@ -138,7 +140,7 @@ menutrans &Tools
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] タグジャンプ(&J)<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T 戻る(&B)<Tab>^T
|
||||
menutrans Build\ &Tags\ File タグファイル作成(&T)
|
||||
menutrans &Make<Tab>:make メイク(&M)<Tab>:make
|
||||
menutrans &Make<Tab>:make ビルド(&M)<Tab>:make
|
||||
menutrans &List\ Errors<Tab>:cl エラーリスト(&L)<Tab>:cl
|
||||
menutrans L&ist\ Messages<Tab>:cl! メッセージリスト(&I)<Tab>:cl!
|
||||
menutrans &Next\ Error<Tab>:cn 次のエラーへ(&N)<Tab>:cn
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
" vi:set ts=8 sts=8 sw=8 tw=0:
|
||||
"
|
||||
" Menu Translations: Japanese (UTF-8)
|
||||
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 12-May-2013.
|
||||
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 28-Jan-2016.
|
||||
"
|
||||
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
|
||||
" vim-jp (http://vim-jp.org/)
|
||||
"
|
||||
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@@ -20,7 +22,7 @@ scriptencoding utf-8
|
||||
" Help menu
|
||||
menutrans &Help ヘルプ(&H)
|
||||
menutrans &Overview<Tab><F1> 概略(&O)<Tab><F1>
|
||||
menutrans &User\ Manual ユーザマニュアル(&U)
|
||||
menutrans &User\ Manual ユーザーマニュアル(&U)
|
||||
menutrans &How-to\ links &How-toリンク
|
||||
menutrans &Credits クレジット(&C)
|
||||
menutrans Co&pying 著作権情報(&P)
|
||||
@@ -138,7 +140,7 @@ menutrans &Tools ツール(&T)
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] タグジャンプ(&J)<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T 戻る(&B)<Tab>^T
|
||||
menutrans Build\ &Tags\ File タグファイル作成(&T)
|
||||
menutrans &Make<Tab>:make メイク(&M)<Tab>:make
|
||||
menutrans &Make<Tab>:make ビルド(&M)<Tab>:make
|
||||
menutrans &List\ Errors<Tab>:cl エラーリスト(&L)<Tab>:cl
|
||||
menutrans L&ist\ Messages<Tab>:cl! メッセージリスト(&I)<Tab>:cl!
|
||||
menutrans &Next\ Error<Tab>:cn 次のエラーへ(&N)<Tab>:cn
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
" vi:set ts=8 sts=8 sw=8 tw=0:
|
||||
"
|
||||
" Menu Translations: Japanese (CP932)
|
||||
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 12-May-2013.
|
||||
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" Last Change: 28-Jan-2016.
|
||||
"
|
||||
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
|
||||
" vim-jp (http://vim-jp.org/)
|
||||
"
|
||||
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
|
||||
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@@ -20,7 +22,7 @@ scriptencoding cp932
|
||||
" Help menu
|
||||
menutrans &Help ヘルプ(&H)
|
||||
menutrans &Overview<Tab><F1> 概略(&O)<Tab><F1>
|
||||
menutrans &User\ Manual ユーザマニュアル(&U)
|
||||
menutrans &User\ Manual ユーザーマニュアル(&U)
|
||||
menutrans &How-to\ links &How-toリンク
|
||||
menutrans &Credits クレジット(&C)
|
||||
menutrans Co&pying 著作権情報(&P)
|
||||
@@ -138,7 +140,7 @@ menutrans &Tools
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] タグジャンプ(&J)<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T 戻る(&B)<Tab>^T
|
||||
menutrans Build\ &Tags\ File タグファイル作成(&T)
|
||||
menutrans &Make<Tab>:make メイク(&M)<Tab>:make
|
||||
menutrans &Make<Tab>:make ビルド(&M)<Tab>:make
|
||||
menutrans &List\ Errors<Tab>:cl エラーリスト(&L)<Tab>:cl
|
||||
menutrans L&ist\ Messages<Tab>:cl! メッセージリスト(&I)<Tab>:cl!
|
||||
menutrans &Next\ Error<Tab>:cn 次のエラーへ(&N)<Tab>:cn
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2015 Dec 31
|
||||
" Last Change: 2016 Feb 09
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@@ -97,6 +97,7 @@ function! s:Highlight_Matching_Pair()
|
||||
if has_getcurpos
|
||||
" getcurpos() is more efficient but doesn't exist before 7.4.313.
|
||||
let save_cursor = getcurpos()
|
||||
let g:saved_cursor = save_cursor
|
||||
else
|
||||
let save_cursor = winsaveview()
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2015 Mar 05
|
||||
" Last Change: 2016 Feb 08
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -264,7 +264,7 @@ syn keyword cStorageClass static register auto volatile extern const
|
||||
if exists("c_gnu")
|
||||
syn keyword cStorageClass inline __attribute__
|
||||
endif
|
||||
if !exists("c_no_c99")
|
||||
if !exists("c_no_c99") && s:ft !=# 'cpp'
|
||||
syn keyword cStorageClass inline restrict
|
||||
endif
|
||||
if !exists("c_no_c11")
|
||||
|
||||
+25
-17
@@ -1,9 +1,9 @@
|
||||
" Vim syntax file for the D programming language (version 1.076 and 2.063).
|
||||
" Vim syntax file for the D programming language (version 1.076 and 2.069).
|
||||
"
|
||||
" Language: D
|
||||
" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
|
||||
" Last Change: 2013 October 5
|
||||
" Version: 0.26
|
||||
" Last Change: 2016 Feb 2
|
||||
" Version: 0.28
|
||||
"
|
||||
" Contributors:
|
||||
" - Jason Mills: original Maintainer
|
||||
@@ -15,6 +15,7 @@
|
||||
" - Steven N. Oliver
|
||||
" - Sohgo Takeuchi
|
||||
" - Robert Clipsham
|
||||
" - Petar Kirov
|
||||
"
|
||||
" Please submit bugs/comments/suggestions to the github repo:
|
||||
" https://github.com/JesseKPhillips/d.vim
|
||||
@@ -114,17 +115,19 @@ syn keyword dTraitsIdentifier contained isIntegral isScalar isStaticArray
|
||||
syn keyword dTraitsIdentifier contained isUnsigned isVirtualFunction
|
||||
syn keyword dTraitsIdentifier contained isVirtualMethod isAbstractFunction
|
||||
syn keyword dTraitsIdentifier contained isFinalFunction isStaticFunction
|
||||
syn keyword dTraitsIdentifier contained isOverrideFunction isTemplate
|
||||
syn keyword dTraitsIdentifier contained isRef isOut isLazy hasMember
|
||||
syn keyword dTraitsIdentifier contained identifier getAttributes getMember
|
||||
syn keyword dTraitsIdentifier contained getOverloads getProtection
|
||||
syn keyword dTraitsIdentifier contained getVirtualFunctions
|
||||
syn keyword dTraitsIdentifier contained getVirtualMethods parent
|
||||
syn keyword dTraitsIdentifier contained classInstanceSize allMembers
|
||||
syn keyword dTraitsIdentifier contained identifier getAliasThis
|
||||
syn keyword dTraitsIdentifier contained getAttributes getFunctionAttributes getMember
|
||||
syn keyword dTraitsIdentifier contained getOverloads getPointerBitmap getProtection
|
||||
syn keyword dTraitsIdentifier contained getVirtualFunctions getVirtualIndex
|
||||
syn keyword dTraitsIdentifier contained getVirtualMethods getUnitTests
|
||||
syn keyword dTraitsIdentifier contained parent classInstanceSize allMembers
|
||||
syn keyword dTraitsIdentifier contained derivedMembers isSame compiles
|
||||
syn keyword dPragmaIdentifier contained lib msg startaddress GNU_asm
|
||||
syn keyword dExternIdentifier contained Windows Pascal Java System D
|
||||
syn keyword dPragmaIdentifier contained inline lib mangle msg startaddress GNU_asm
|
||||
syn keyword dExternIdentifier contained C C++ D Windows Pascal System Objective-C
|
||||
syn keyword dAttribute contained safe trusted system
|
||||
syn keyword dAttribute contained property disable
|
||||
syn keyword dAttribute contained property disable nogc
|
||||
syn keyword dVersionIdentifier contained DigitalMars GNU LDC SDC D_NET
|
||||
syn keyword dVersionIdentifier contained X86 X86_64 ARM PPC PPC64 IA64 MIPS MIPS64 Alpha
|
||||
syn keyword dVersionIdentifier contained SPARC SPARC64 S390 S390X HPPA HPPA64 SH SH64
|
||||
@@ -134,7 +137,7 @@ syn keyword dVersionIdentifier contained Cygwin MinGW
|
||||
syn keyword dVersionIdentifier contained LittleEndian BigEndian
|
||||
syn keyword dVersionIdentifier contained D_InlineAsm_X86 D_InlineAsm_X86_64
|
||||
syn keyword dVersionIdentifier contained D_Version2 D_Coverage D_Ddoc D_LP64 D_PIC
|
||||
syn keyword dVersionIdentifier contained unittest none all
|
||||
syn keyword dVersionIdentifier contained unittest assert none all
|
||||
|
||||
syn cluster dComment contains=dNestedComment,dBlockComment,dLineComment
|
||||
|
||||
@@ -168,10 +171,10 @@ syn match dExternal "\<extern\>"
|
||||
syn match dExtern "\<extern\s*([_a-zA-Z][_a-zA-Z0-9\+]*\>"he=s+6 contains=dExternIdentifier
|
||||
|
||||
" Make import a region to prevent highlighting keywords
|
||||
syn region dImport start="import\_s" end=";" contains=dExternal,@dComment
|
||||
syn region dImport start="\<import\_s" end=";" contains=dExternal,@dComment
|
||||
|
||||
" Make module a region to prevent highlighting keywords
|
||||
syn region dImport start="module\_s" end=";" contains=dExternal,@dComment
|
||||
syn region dImport start="\<module\_s" end=";" contains=dExternal,@dComment
|
||||
|
||||
" dTokens is used by the token string highlighting
|
||||
syn cluster dTokens contains=dExternal,dConditional,dBranch,dRepeat,dBoolean
|
||||
@@ -246,13 +249,17 @@ syn match dUnicode "\\u\d\{4\}"
|
||||
|
||||
" String.
|
||||
"
|
||||
syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dEscSequence,@Spell
|
||||
syn match dFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||
syn match dFormat display "%%" contained
|
||||
|
||||
syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dFormat,dEscSequence,@Spell
|
||||
syn region dRawString start=+`+ end=+`[cwd]\=+ contains=@Spell
|
||||
syn region dRawString start=+r"+ end=+"[cwd]\=+ contains=@Spell
|
||||
syn region dHexString start=+x"+ end=+"[cwd]\=+ contains=@Spell
|
||||
syn region dDelimString start=+q"\z(.\)+ end=+\z1"+ contains=@Spell
|
||||
syn region dHereString start=+q"\z(\I\i*\)\n+ end=+^\z1"+ contains=@Spell
|
||||
|
||||
|
||||
" Nesting delimited string contents
|
||||
"
|
||||
syn region dNestParenString start=+(+ end=+)+ contained transparent contains=dNestParenString,@Spell
|
||||
@@ -276,8 +283,8 @@ syn cluster dTokens add=dString,dRawString,dHexString,dDelimString,dNestString
|
||||
|
||||
" Token strings
|
||||
"
|
||||
syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens
|
||||
syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens
|
||||
syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens,dFormat
|
||||
syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens,dFormat
|
||||
|
||||
syn cluster dTokens add=dTokenString
|
||||
|
||||
@@ -357,6 +364,7 @@ hi def link dString String
|
||||
hi def link dHexString String
|
||||
hi def link dCharacter Character
|
||||
hi def link dEscSequence SpecialChar
|
||||
hi def link dFormat SpecialChar
|
||||
hi def link dSpecialCharError Error
|
||||
hi def link dOctalError Error
|
||||
hi def link dOperator Operator
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax support file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Jan 26
|
||||
" Last Change: 2016 Feb 01
|
||||
|
||||
" This file is used for ":syntax manual".
|
||||
" It installs the Syntax autocommands, but no the FileType autocommands.
|
||||
@@ -16,10 +16,11 @@ endif
|
||||
|
||||
let syntax_manual = 1
|
||||
|
||||
" Remove the connection between FileType and Syntax autocommands.
|
||||
if exists('#syntaxset')
|
||||
au! syntaxset FileType
|
||||
endif
|
||||
" Overrule the connection between FileType and Syntax autocommands. This sets
|
||||
" the syntax when the file type is detected, without changing the value.
|
||||
augroup syntaxset
|
||||
au! FileType * exe "set syntax=" . &syntax
|
||||
augroup END
|
||||
|
||||
" If the GUI is already running, may still need to install the FileType menu.
|
||||
" Don't do it when the 'M' flag is included in 'guioptions'.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Zsh shell script
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-12-25
|
||||
" Latest Revision: 2016-01-25
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-zsh
|
||||
|
||||
@@ -14,6 +14,7 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal iskeyword+=-
|
||||
setlocal foldmethod=syntax
|
||||
|
||||
syn keyword zshTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
@@ -307,19 +308,19 @@ syn match zshNumber '[+-]\=\d\+\.\d\+\>'
|
||||
" TODO: $[...] is the same as $((...)), so add that as well.
|
||||
syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst
|
||||
syn region zshSubst matchgroup=zshSubstDelim transparent
|
||||
\ start='\$(' skip='\\)' end=')' contains=TOP
|
||||
syn region zshParentheses transparent start='(' skip='\\)' end=')'
|
||||
\ start='\$(' skip='\\)' end=')' contains=TOP fold
|
||||
syn region zshParentheses transparent start='(' skip='\\)' end=')' fold
|
||||
syn region zshMathSubst matchgroup=zshSubstDelim transparent
|
||||
\ start='\$((' skip='\\)'
|
||||
\ matchgroup=zshSubstDelim end='))'
|
||||
\ contains=zshParentheses,@zshSubst,zshNumber,
|
||||
\ @zshDerefs,zshString keepend
|
||||
\ @zshDerefs,zshString keepend fold
|
||||
syn region zshBrackets contained transparent start='{' skip='\\}'
|
||||
\ end='}'
|
||||
\ end='}' fold
|
||||
syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
|
||||
\ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString
|
||||
\ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold
|
||||
syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+
|
||||
\ end=+`+ contains=TOP,zshOldSubst
|
||||
\ end=+`+ contains=TOP,zshOldSubst fold
|
||||
|
||||
syn sync minlines=50 maxlines=90
|
||||
syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)'
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
while (1)
|
||||
@@ -18,4 +19,5 @@ main()
|
||||
fflush(stdout);
|
||||
usleep(250000); /* off time */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,8 @@ const char USAGE[] =
|
||||
|
||||
|
||||
int ShowUsage( char *szError )
|
||||
{ int i;
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf( stderr, USAGE );
|
||||
|
||||
@@ -101,7 +102,8 @@ int ShowUsage( char *szError )
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *echogets(char *s, int echo) {
|
||||
char *echogets(char *s, int echo)
|
||||
{
|
||||
char * const retval=fgets(s, LINELENGTH, stdin);
|
||||
if (echo!=0 && retval!=NULL) {
|
||||
fputs(retval, stderr);
|
||||
|
||||
+42
-26
@@ -1,59 +1,75 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Server that will accept connections from a Vim channel.
|
||||
# Run this server and then in Vim you can open the channel:
|
||||
# :let handle = connect('localhost:8765', 'json')
|
||||
# :let handle = ch_open('localhost:8765', 'json')
|
||||
#
|
||||
# Then Vim can send requests to the server:
|
||||
# :let response = sendexpr(handle, 'hello!')
|
||||
# :let response = ch_sendexpr(handle, 'hello!')
|
||||
#
|
||||
# And you can control Vim by typing a JSON message here, e.g.:
|
||||
# ["ex","echo 'hi there'"]
|
||||
#
|
||||
# There is no prompt, just type a line and press Enter.
|
||||
# To exit cleanly type "quit<Enter>".
|
||||
#
|
||||
# See ":help channel-demo" in Vim.
|
||||
#
|
||||
# This requires Python 2.6 or later.
|
||||
|
||||
import SocketServer
|
||||
from __future__ import print_function
|
||||
import json
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
|
||||
try:
|
||||
# Python 3
|
||||
import socketserver
|
||||
except ImportError:
|
||||
# Python 2
|
||||
import SocketServer as socketserver
|
||||
|
||||
thesocket = None
|
||||
|
||||
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
|
||||
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||
|
||||
def handle(self):
|
||||
print "=== socket opened ==="
|
||||
print("=== socket opened ===")
|
||||
global thesocket
|
||||
thesocket = self.request
|
||||
while True:
|
||||
try:
|
||||
data = self.request.recv(4096)
|
||||
data = self.request.recv(4096).decode('utf-8')
|
||||
except socket.error:
|
||||
print "=== socket error ==="
|
||||
print("=== socket error ===")
|
||||
break
|
||||
except IOError:
|
||||
print "=== socket closed ==="
|
||||
print("=== socket closed ===")
|
||||
break
|
||||
if data == '':
|
||||
print "=== socket closed ==="
|
||||
print("=== socket closed ===")
|
||||
break
|
||||
print "received: {}".format(data)
|
||||
print("received: {}".format(data))
|
||||
try:
|
||||
decoded = json.loads(data)
|
||||
except ValueError:
|
||||
print "json decoding failed"
|
||||
decoded = [0, '']
|
||||
print("json decoding failed")
|
||||
decoded = [-1, '']
|
||||
|
||||
if decoded[1] == 'hello!':
|
||||
response = "got it"
|
||||
else:
|
||||
response = "what?"
|
||||
encoded = json.dumps([decoded[0], response])
|
||||
print "sending {}".format(encoded)
|
||||
self.request.sendall(encoded)
|
||||
# Send a response if the sequence number is positive.
|
||||
# Negative numbers are used for "eval" responses.
|
||||
if decoded[0] >= 0:
|
||||
if decoded[1] == 'hello!':
|
||||
response = "got it"
|
||||
else:
|
||||
response = "what?"
|
||||
encoded = json.dumps([decoded[0], response])
|
||||
print("sending {}".format(encoded))
|
||||
self.request.sendall(encoded.encode('utf-8'))
|
||||
thesocket = None
|
||||
|
||||
class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
|
||||
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -69,19 +85,19 @@ if __name__ == "__main__":
|
||||
# Exit the server thread when the main thread terminates
|
||||
server_thread.daemon = True
|
||||
server_thread.start()
|
||||
print "Server loop running in thread: ", server_thread.name
|
||||
print("Server loop running in thread: ", server_thread.name)
|
||||
|
||||
print "Listening on port {}".format(PORT)
|
||||
print("Listening on port {}".format(PORT))
|
||||
while True:
|
||||
typed = sys.stdin.readline()
|
||||
if "quit" in typed:
|
||||
print "Goodbye!"
|
||||
print("Goodbye!")
|
||||
break
|
||||
if thesocket is None:
|
||||
print "No socket yet"
|
||||
print("No socket yet")
|
||||
else:
|
||||
print "sending {}".format(typed)
|
||||
thesocket.sendall(typed)
|
||||
print("sending {}".format(typed))
|
||||
thesocket.sendall(typed.encode('utf-8'))
|
||||
|
||||
server.shutdown()
|
||||
server.server_close()
|
||||
|
||||
@@ -94,12 +94,12 @@ static int got_x_error = FALSE;
|
||||
*/
|
||||
|
||||
char *
|
||||
sendToVim(dpy, name, cmd, asKeys, code)
|
||||
Display *dpy; /* Where to send. */
|
||||
char *name; /* Where to send. */
|
||||
char *cmd; /* What to send. */
|
||||
int asKeys; /* Interpret as keystrokes or expr ? */
|
||||
int *code; /* Return code. 0 => OK */
|
||||
sendToVim(
|
||||
Display *dpy, /* Where to send. */
|
||||
char *name, /* Where to send. */
|
||||
char *cmd, /* What to send. */
|
||||
int asKeys, /* Interpret as keystrokes or expr ? */
|
||||
int *code) /* Return code. 0 => OK */
|
||||
{
|
||||
Window w;
|
||||
Atom *plist;
|
||||
@@ -245,8 +245,7 @@ sendToVim(dpy, name, cmd, asKeys, code)
|
||||
*/
|
||||
|
||||
static int
|
||||
SendInit(dpy)
|
||||
Display *dpy;
|
||||
SendInit(Display *dpy)
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@@ -289,11 +288,11 @@ SendInit(dpy)
|
||||
*/
|
||||
|
||||
static Window
|
||||
LookupName(dpy, name, delete, loose)
|
||||
Display *dpy; /* Display whose registry to check. */
|
||||
char *name; /* Name of an interpreter. */
|
||||
int delete; /* If non-zero, delete info about name. */
|
||||
char **loose; /* Do another search matching -999 if not found
|
||||
LookupName(
|
||||
Display *dpy, /* Display whose registry to check. */
|
||||
char *name, /* Name of an interpreter. */
|
||||
int delete, /* If non-zero, delete info about name. */
|
||||
char **loose) /* Do another search matching -999 if not found
|
||||
Return result here if a match is found */
|
||||
{
|
||||
unsigned char *regProp, *entry;
|
||||
@@ -396,11 +395,11 @@ LookupName(dpy, name, delete, loose)
|
||||
}
|
||||
|
||||
static char *
|
||||
SendEventProc(dpy, eventPtr, expected, code)
|
||||
Display *dpy;
|
||||
XEvent *eventPtr; /* Information about event. */
|
||||
int expected; /* The one were waiting for */
|
||||
int *code; /* Return code. 0 => OK */
|
||||
SendEventProc(
|
||||
Display *dpy,
|
||||
XEvent *eventPtr, /* Information about event. */
|
||||
int expected, /* The one were waiting for */
|
||||
int *code) /* Return code. 0 => OK */
|
||||
{
|
||||
unsigned char *propInfo;
|
||||
unsigned char *p;
|
||||
@@ -535,13 +534,13 @@ SendEventProc(dpy, eventPtr, expected, code)
|
||||
*/
|
||||
|
||||
static int
|
||||
AppendPropCarefully(dpy, window, property, value, length)
|
||||
Display *dpy; /* Display on which to operate. */
|
||||
Window window; /* Window whose property is to
|
||||
AppendPropCarefully(
|
||||
Display *dpy, /* Display on which to operate. */
|
||||
Window window, /* Window whose property is to
|
||||
* be modified. */
|
||||
Atom property; /* Name of property. */
|
||||
char *value; /* Characters to append to property. */
|
||||
int length; /* How much to append */
|
||||
Atom property, /* Name of property. */
|
||||
char *value, /* Characters to append to property. */
|
||||
int length) /* How much to append */
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@@ -560,9 +559,7 @@ AppendPropCarefully(dpy, window, property, value, length)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
x_error_check(dpy, error_event)
|
||||
Display *dpy;
|
||||
XErrorEvent *error_event;
|
||||
x_error_check(Display *dpy, XErrorEvent *error_event)
|
||||
{
|
||||
got_x_error = TRUE;
|
||||
return 0;
|
||||
@@ -573,8 +570,7 @@ x_error_check(dpy, error_event)
|
||||
* Actually just checks if the name ends in a digit.
|
||||
*/
|
||||
static int
|
||||
IsSerialName(str)
|
||||
char *str;
|
||||
IsSerialName(char *str)
|
||||
{
|
||||
int len = strlen(str);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ gvimext.obj: gvimext.h
|
||||
$(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp
|
||||
|
||||
gvimext.res: gvimext.rc
|
||||
$(rc) $(rcflags) $(rcvars) gvimext.rc
|
||||
$(rc) /nologo $(rcflags) $(rcvars) gvimext.rc
|
||||
|
||||
clean:
|
||||
- if exist gvimext.dll del gvimext.dll
|
||||
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{
|
||||
ACTIONS = {"_cycleWindows" = id; "_cycleWindowsBackwards" = id; addNewTab = id; };
|
||||
CLASS = FirstResponder;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
{
|
||||
ACTIONS = {
|
||||
fileOpen = id;
|
||||
fontSizeDown = id;
|
||||
fontSizeUp = id;
|
||||
forceNewWindow = id;
|
||||
newWindow = id;
|
||||
newWindowAndActivate = id;
|
||||
openWebsite = id;
|
||||
orderFrontPreferencePanel = id;
|
||||
selectNextWindow = id;
|
||||
selectPreviousWindow = id;
|
||||
showHelp = id;
|
||||
showVimHelp = id;
|
||||
zoomAll = id;
|
||||
};
|
||||
CLASS = MMAppController;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
{CLASS = NSMenu; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
ACTIONS = {didAdjustSubviews = RBSplitView; willAdjustSubviews = RBSplitView; };
|
||||
CLASS = NSObject;
|
||||
LANGUAGE = ObjC;
|
||||
},
|
||||
{CLASS = RBSplitSubview; LANGUAGE = ObjC; SUPERCLASS = NSView; },
|
||||
{
|
||||
CLASS = RBSplitView;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {delegate = id; };
|
||||
SUPERCLASS = RBSplitSubview;
|
||||
},
|
||||
{
|
||||
ACTIONS = {checkForUpdates = id; };
|
||||
CLASS = SUUpdater;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
}
|
||||
);
|
||||
IBVersion = 1;
|
||||
}
|
||||
+211
-1102
File diff suppressed because it is too large
Load Diff
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>84 130 356 240 0 0 1024 746 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>84 375 281 44 0 0 1024 746 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>489.0</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../../MacVim.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8S165</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
+276
-1704
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>95</string>
|
||||
<string>97</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -56,7 +56,6 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
|
||||
unsigned numWholeLineChanges;
|
||||
unsigned offsetForDrawDataPrune;
|
||||
BOOL imState;
|
||||
NSMutableDictionary *channelDict;
|
||||
int winposX;
|
||||
int winposY;
|
||||
#ifdef FEAT_BEVAL
|
||||
@@ -156,8 +155,8 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
|
||||
- (BOOL)imState;
|
||||
- (void)setImState:(BOOL)activated;
|
||||
|
||||
- (void)addChannel:(int)idx fileDescriptor:(int)fd;
|
||||
- (void)removeChannel:(int)idx;
|
||||
- (void *)addChannel:(channel_T *)channel which:(int)which;
|
||||
- (void)removeChannel:(void *)cookie;
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)setLastToolTip:(NSString *)toolTip;
|
||||
|
||||
+26
-21
@@ -164,11 +164,14 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
|
||||
|
||||
@interface MMChannel : NSObject {
|
||||
channel_T *channel;
|
||||
int which;
|
||||
CFSocketRef socket;
|
||||
CFRunLoopSourceRef runLoopSource;
|
||||
}
|
||||
|
||||
- (id)initWithIndex:(int)idx fileDescriptor:(int)fd;
|
||||
- (id)initWithChannel:(channel_T *)c which:(int)w;
|
||||
- (void)read;
|
||||
@end
|
||||
|
||||
|
||||
@@ -241,7 +244,6 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
connectionNameDict = [[NSMutableDictionary alloc] init];
|
||||
clientProxyDict = [[NSMutableDictionary alloc] init];
|
||||
serverReplyDict = [[NSMutableDictionary alloc] init];
|
||||
channelDict = [[NSMutableDictionary alloc] init];
|
||||
|
||||
NSBundle *mainBundle = [NSBundle mainBundle];
|
||||
NSString *path = [mainBundle pathForResource:@"Colors" ofType:@"plist"];
|
||||
@@ -273,7 +275,6 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
gui_mch_free_font(oldWideFont); oldWideFont = NOFONT;
|
||||
[blinkTimer release]; blinkTimer = nil;
|
||||
[alternateServerName release]; alternateServerName = nil;
|
||||
[channelDict release]; channelDict = nil;
|
||||
[serverReplyDict release]; serverReplyDict = nil;
|
||||
[clientProxyDict release]; clientProxyDict = nil;
|
||||
[connectionNameDict release]; connectionNameDict = nil;
|
||||
@@ -1684,21 +1685,17 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[self flushQueue:YES];
|
||||
}
|
||||
|
||||
- (void)addChannel:(int)idx fileDescriptor:(int)fd
|
||||
- (void *)addChannel:(channel_T *)channel which:(int)which
|
||||
{
|
||||
if (fd == -1)
|
||||
return;
|
||||
|
||||
NSNumber *key = [NSNumber numberWithInt:idx];
|
||||
MMChannel *channel =
|
||||
[[[MMChannel alloc] initWithIndex:idx fileDescriptor:fd] autorelease];
|
||||
[channelDict setObject:channel forKey:key];
|
||||
MMChannel *mmChannel =
|
||||
[[MMChannel alloc] initWithChannel:channel which:which];
|
||||
return (__bridge void *)mmChannel;
|
||||
}
|
||||
|
||||
- (void)removeChannel:(int)idx
|
||||
- (void)removeChannel:(void *)cookie
|
||||
{
|
||||
NSNumber *key = [NSNumber numberWithInt:idx];
|
||||
[channelDict removeObjectForKey:key];
|
||||
MMChannel *mmChannel = (__bridge MMChannel *)cookie;
|
||||
[mmChannel release];
|
||||
}
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
@@ -3431,21 +3428,22 @@ static void socketReadCallback(CFSocketRef s,
|
||||
const void *data,
|
||||
void *info)
|
||||
{
|
||||
#ifdef FEAT_CHANNEL
|
||||
int idx = (int)(intptr_t)info;
|
||||
channel_read(idx);
|
||||
#endif
|
||||
MMChannel *mmChannel = (__bridge MMChannel *)info;
|
||||
[mmChannel read];
|
||||
}
|
||||
|
||||
- (id)initWithIndex:(int)idx fileDescriptor:(int)fd
|
||||
- (id)initWithChannel:(channel_T *)c which:(int)w
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) return nil;
|
||||
|
||||
channel = c;
|
||||
which = w;
|
||||
|
||||
// Tell CFRunLoop that we are interested in channel socket input.
|
||||
CFSocketContext ctx = {0, (void *)(intptr_t)idx, NULL, NULL, NULL};
|
||||
CFSocketContext ctx = {0, (__bridge void *)self, NULL, NULL, NULL};
|
||||
socket = CFSocketCreateWithNative(kCFAllocatorDefault,
|
||||
fd,
|
||||
channel->ch_pfd[which].ch_fd,
|
||||
kCFSocketReadCallBack,
|
||||
&socketReadCallback,
|
||||
&ctx);
|
||||
@@ -3459,4 +3457,11 @@ static void socketReadCallback(CFSocketRef s,
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)read
|
||||
{
|
||||
#ifdef FEAT_CHANNEL
|
||||
channel_read(channel, which, "MMChannel_read");
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -44,10 +44,11 @@
|
||||
#define DRAW_CURSOR 0x20
|
||||
#define DRAW_WIDE 0x40 /* draw wide text */
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
|
||||
#define kCTFontOrientationDefault kCTFontDefaultOrientation
|
||||
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
static void
|
||||
CTFontDrawGlyphs(CTFontRef fontRef, const CGGlyph glyphs[],
|
||||
const CGPoint positions[], UniCharCount count,
|
||||
@@ -58,7 +59,6 @@ CTFontDrawGlyphs(CTFontRef fontRef, const CGGlyph glyphs[],
|
||||
CGContextShowGlyphsAtPositions(context, glyphs, positions, count);
|
||||
CGFontRelease(cgFontRef);
|
||||
}
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
|
||||
@interface MMCoreTextView (Private)
|
||||
|
||||
@@ -65,7 +65,9 @@
|
||||
1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; };
|
||||
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
|
||||
52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; };
|
||||
52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; };
|
||||
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
@@ -94,6 +96,13 @@
|
||||
remoteGlobalIDString = 8D576316048677EA00EA77CD;
|
||||
remoteInfo = QuickLookStephen;
|
||||
};
|
||||
52818B001C1C084100F59085 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8D57630D048677EA00EA77CD;
|
||||
remoteInfo = QuickLookStephen;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@@ -114,6 +123,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */,
|
||||
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
@@ -132,6 +142,17 @@
|
||||
name = "Copy Vim Runtime Files";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
52818B021C1C088000F59085 /* Copy QuickLookPlugin */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = ../Library/QuickLook;
|
||||
dstSubfolderSpec = 6;
|
||||
files = (
|
||||
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */,
|
||||
);
|
||||
name = "Copy QuickLookPlugin";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -445,14 +466,15 @@
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
1D0DCAD80BA3604D00B6CCFA /* Copy Executables */,
|
||||
1D9EB2840C366D7B0074B739 /* Copy Frameworks */,
|
||||
52818B021C1C088000F59085 /* Copy QuickLookPlugin */,
|
||||
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
|
||||
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
|
||||
520E0E2B1C2FBAF300949DD8 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
1D493DCD0C5254A400AB718C /* PBXTargetDependency */,
|
||||
52818B011C1C084100F59085 /* PBXTargetDependency */,
|
||||
);
|
||||
name = MacVim;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
@@ -576,20 +598,6 @@
|
||||
shellScript = "# Clear deployment target, else the python script always thinks we're building on Tiger\nunset MACOSX_DEPLOYMENT_TARGET\n\n# Generate the icons (redirect stderr to ignore warnings)\ncd \"$PROJECT_DIR\"/icons/\nmake OUTDIR=\"$TARGET_BUILD_DIR\"/$UNLOCALIZED_RESOURCES_FOLDER_PATH 2> /dev/null\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
520E0E2B1C2FBAF300949DD8 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "OSX_MINOR_VERSION=`/usr/bin/sw_vers -productVersion|cut -f2 -d'.'`\nif [ $OSX_MINOR_VERSION -ge 8 ]; then\n cp -pr Sparkle.framework $BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH\n strip -S $BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate || exit 1\n xcodebuild -project qlstephen/QuickLookStephen.xcodeproj\n mkdir -p $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/QuickLook\n cp -pr qlstephen/build/Release/QLStephen.qlgenerator $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/QuickLook\nfi";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -627,6 +635,11 @@
|
||||
name = PSMTabBarControlFramework;
|
||||
targetProxy = 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */;
|
||||
};
|
||||
52818B011C1C084100F59085 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = QuickLookStephen;
|
||||
targetProxy = 52818B001C1C084100F59085 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
@@ -668,6 +681,7 @@
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@@ -700,6 +714,7 @@
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
||||
@@ -583,6 +583,7 @@
|
||||
C056398008A954F8003078D8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@@ -608,6 +609,7 @@
|
||||
C056398108A954F8003078D8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>15C50</string>
|
||||
<string>15E27e</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.13.0</string>
|
||||
<string>1.13.1 git-2afc553</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
@@ -25,7 +25,7 @@
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.13.0</string>
|
||||
<string>1.13.1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>15C50</string>
|
||||
<string>15E27e</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.13.0</string>
|
||||
<string>1.13.1 git-2afc553</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
@@ -25,7 +25,7 @@
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.13.0</string>
|
||||
<string>1.13.1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
|
||||
Binary file not shown.
@@ -2241,16 +2241,16 @@ static int vimModMaskToEventModifierFlags(int mods)
|
||||
|
||||
// -- Channel Support ------------------------------------------------------
|
||||
|
||||
void
|
||||
gui_macvim_add_channel(int idx, int fd)
|
||||
void *
|
||||
gui_macvim_add_channel(channel_T *channel, int which)
|
||||
{
|
||||
[[MMBackend sharedInstance] addChannel:idx fileDescriptor:fd];
|
||||
return [[MMBackend sharedInstance] addChannel:channel which:which];
|
||||
}
|
||||
|
||||
void
|
||||
gui_macvim_remove_channel(int idx)
|
||||
gui_macvim_remove_channel(void *cookie)
|
||||
{
|
||||
[[MMBackend sharedInstance] removeChannel:idx];
|
||||
[[MMBackend sharedInstance] removeChannel:cookie];
|
||||
}
|
||||
|
||||
|
||||
|
||||
+12
-13
@@ -42,7 +42,7 @@ DIRECTX=no
|
||||
FEATURES=HUGE
|
||||
# Set to one of i386, i486, i586, i686 as the minimum target processor.
|
||||
# For amd64/x64 architecture set ARCH=x86-64 .
|
||||
ARCH=i386
|
||||
ARCH=i686
|
||||
# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
|
||||
CROSS=no
|
||||
# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
|
||||
@@ -58,9 +58,9 @@ DYNAMIC_IME=yes
|
||||
POSTSCRIPT=no
|
||||
# Set to yes to enable OLE support.
|
||||
OLE=no
|
||||
# Set the default $(WINVER) to make it work with pre-Win2k.
|
||||
# Set the default $(WINVER) to make it work with WinXP.
|
||||
ifndef WINVER
|
||||
WINVER = 0x0500
|
||||
WINVER = 0x0501
|
||||
endif
|
||||
# Set to yes to enable Cscope support.
|
||||
CSCOPE=yes
|
||||
@@ -264,7 +264,7 @@ ifndef DYNAMIC_PYTHON3_DLL
|
||||
DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll
|
||||
endif
|
||||
ifdef PYTHON3_HOME
|
||||
PYTHON3_HOME_DEF=-DPYTHON3_HOME=\"$(PYTHON3_HOME)\"
|
||||
PYTHON3_HOME_DEF=-DPYTHON3_HOME=L\"$(PYTHON3_HOME)\"
|
||||
endif
|
||||
|
||||
ifeq (no,$(DYNAMIC_PYTHON3))
|
||||
@@ -414,7 +414,7 @@ WINDRES_CC = $(CC)
|
||||
#>>>>> end of choices
|
||||
###########################################################################
|
||||
|
||||
CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
|
||||
CFLAGS = -Iproto $(DEFINES) -pipe -march=$(ARCH) -Wall
|
||||
WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
|
||||
EXTRA_LIBS =
|
||||
|
||||
@@ -483,14 +483,14 @@ endif
|
||||
endif
|
||||
|
||||
ifdef PYTHON
|
||||
CFLAGS += -DFEAT_PYTHON
|
||||
CFLAGS += -DFEAT_PYTHON
|
||||
ifeq (yes, $(DYNAMIC_PYTHON))
|
||||
CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\"
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PYTHON3
|
||||
CFLAGS += -DFEAT_PYTHON3
|
||||
ifdef PYTHON3
|
||||
CFLAGS += -DFEAT_PYTHON3
|
||||
ifeq (yes, $(DYNAMIC_PYTHON3))
|
||||
CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\"
|
||||
endif
|
||||
@@ -679,20 +679,19 @@ ifneq ($(CHANNEL),yes)
|
||||
# Cannot use Netbeans without CHANNEL
|
||||
NETBEANS=no
|
||||
else
|
||||
# Only allow NETBEANS for a GUI build.
|
||||
ifeq (yes, $(GUI))
|
||||
ifneq (yes, $(GUI))
|
||||
# Cannot use Netbeans without GUI.
|
||||
NETBEANS=no
|
||||
else
|
||||
OBJ += $(OUTDIR)/netbeans.o
|
||||
LIB += -lwsock32
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CHANNEL),yes)
|
||||
OBJ += $(OUTDIR)/channel.o
|
||||
ifneq ($(NETBEANS),yes)
|
||||
LIB += -lwsock32
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(DIRECTX),yes)
|
||||
# Only allow DIRECTX for a GUI build.
|
||||
|
||||
+3
-4
@@ -113,7 +113,7 @@
|
||||
# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
|
||||
# i386)
|
||||
#
|
||||
# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
|
||||
# Version Support: WINVER=[0x0501, 0x0600] (default is 0x0501)
|
||||
#
|
||||
# Debug version: DEBUG=yes
|
||||
# Mapfile: MAP=[no, yes or lines] (default is yes)
|
||||
@@ -370,9 +370,8 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
|
||||
!endif
|
||||
|
||||
### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
|
||||
# When set to 0x0500 ":browse" stops working.
|
||||
!ifndef WINVER
|
||||
WINVER = 0x0400
|
||||
WINVER = 0x0501
|
||||
!endif
|
||||
|
||||
# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
|
||||
@@ -1294,7 +1293,7 @@ $(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
|
||||
$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
|
||||
tearoff.bmp vim.ico vim_error.ico \
|
||||
vim_alert.ico vim_info.ico vim_quest.ico
|
||||
$(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
|
||||
$(RC) /nologo /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
|
||||
|
||||
iid_ole.c if_ole.h vim.tlb: if_ole.idl
|
||||
midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
|
||||
|
||||
+41
-8
@@ -1562,11 +1562,13 @@ EXTRA_SRC = hangulin.c if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
|
||||
$(GRESOURCE_SRC)
|
||||
|
||||
# Unittest files
|
||||
JSON_TEST_SRC = json_test.c
|
||||
JSON_TEST_TARGET = json_test$(EXEEXT)
|
||||
MEMFILE_TEST_SRC = memfile_test.c
|
||||
MEMFILE_TEST_TARGET = memfile_test$(EXEEXT)
|
||||
|
||||
UNITTEST_SRC = $(MEMFILE_TEST_SRC)
|
||||
UNITTEST_TARGETS = $(MEMFILE_TEST_TARGET)
|
||||
UNITTEST_SRC = $(JSON_TEST_SRC) $(MEMFILE_TEST_SRC)
|
||||
UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(MEMFILE_TEST_TARGET)
|
||||
|
||||
# All sources, also the ones that are not configured
|
||||
ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
||||
@@ -1605,9 +1607,8 @@ OBJ_COMMON = \
|
||||
$(HANGULIN_OBJ) \
|
||||
objects/if_cscope.o \
|
||||
objects/if_xcmdsrv.o \
|
||||
objects/json.o \
|
||||
objects/mark.o \
|
||||
objects/memline.o \
|
||||
objects/memline.o \
|
||||
objects/menu.o \
|
||||
objects/message.o \
|
||||
objects/misc1.o \
|
||||
@@ -1649,11 +1650,17 @@ OBJ_COMMON = \
|
||||
$(WSDEBUG_OBJ)
|
||||
|
||||
OBJ = $(OBJ_COMMON) \
|
||||
objects/json.o \
|
||||
objects/main.o \
|
||||
objects/memfile.o
|
||||
|
||||
JSON_TEST_OBJ = $(OBJ_COMMON) \
|
||||
objects/json_test.o \
|
||||
objects/memfile.o
|
||||
|
||||
MEMFILE_TEST_OBJ = $(OBJ_COMMON) \
|
||||
objects/memfile_test.o
|
||||
objects/json.o \
|
||||
objects/memfile_test.o
|
||||
|
||||
PRO_AUTO = \
|
||||
blowfish.pro \
|
||||
@@ -1678,6 +1685,7 @@ PRO_AUTO = \
|
||||
hangulin.pro \
|
||||
if_cscope.pro \
|
||||
if_lua.pro \
|
||||
if_mzsch.pro \
|
||||
if_python.pro \
|
||||
if_python3.pro \
|
||||
if_ruby.pro \
|
||||
@@ -1685,6 +1693,7 @@ PRO_AUTO = \
|
||||
json.pro \
|
||||
main.pro \
|
||||
mark.pro \
|
||||
mbyte.pro \
|
||||
memfile.pro \
|
||||
memline.pro \
|
||||
menu.pro \
|
||||
@@ -1692,7 +1701,6 @@ PRO_AUTO = \
|
||||
misc1.pro \
|
||||
misc2.pro \
|
||||
move.pro \
|
||||
mbyte.pro \
|
||||
normal.pro \
|
||||
ops.pro \
|
||||
option.pro \
|
||||
@@ -1930,6 +1938,7 @@ types.vim: $(TAGS_SRC) $(TAGS_INCL)
|
||||
ctags --c-kinds=gstu -o- $(TAGS_SRC) $(TAGS_INCL) |\
|
||||
awk 'BEGIN{printf("syntax keyword Type\t")}\
|
||||
{printf("%s ", $$1)}END{print ""}' > $@
|
||||
echo "syn keyword Constant OK FAIL TRUE FALSE MAYBE" >> $@
|
||||
|
||||
# Execute the test scripts. Run these after compiling Vim, before installing.
|
||||
# This doesn't depend on $(VIMTARGET), because that won't work when configure
|
||||
@@ -1964,6 +1973,12 @@ unittest unittests: $(UNITTEST_TARGETS)
|
||||
./$$t || exit 1; echo $$t passed; \
|
||||
done
|
||||
|
||||
run_json_test: $(JSON_TEST_TARGET)
|
||||
./$(JSON_TEST_TARGET)
|
||||
|
||||
run_memfile_test: $(MEMFILE_TEST_TARGET)
|
||||
./$(MEMFILE_TEST_TARGET)
|
||||
|
||||
# Run individual OLD style test, assuming that Vim was already compiled.
|
||||
test1 \
|
||||
test_autocmd_option \
|
||||
@@ -2014,6 +2029,7 @@ test_arglist \
|
||||
test_assert \
|
||||
test_backspace_opt \
|
||||
test_cdo \
|
||||
test_channel \
|
||||
test_cursor_func \
|
||||
test_delete \
|
||||
test_expand \
|
||||
@@ -2056,6 +2072,13 @@ testclean:
|
||||
|
||||
# Unittests
|
||||
# It's build just like Vim to satisfy all dependencies.
|
||||
$(JSON_TEST_TARGET): auto/config.mk objects $(JSON_TEST_OBJ)
|
||||
$(CCC) version.c -o objects/version.o
|
||||
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
||||
-o $(JSON_TEST_TARGET) $(JSON_TEST_OBJ) $(ALL_LIBS)" \
|
||||
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
||||
sh $(srcdir)/link.sh
|
||||
|
||||
$(MEMFILE_TEST_TARGET): auto/config.mk objects $(MEMFILE_TEST_OBJ)
|
||||
$(CCC) version.c -o objects/version.o
|
||||
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
||||
@@ -2547,6 +2570,7 @@ shadow: runtime pixmaps
|
||||
../../testdir/Make_all.mak \
|
||||
../../testdir/*.in \
|
||||
../../testdir/*.vim \
|
||||
../../testdir/*.py \
|
||||
../../testdir/python* \
|
||||
../../testdir/sautest \
|
||||
../../testdir/test83-tags? \
|
||||
@@ -2662,9 +2686,11 @@ GUI_GTK_RES_INPUTS = \
|
||||
../pixmaps/stock_vim_window_split_vertical.png
|
||||
|
||||
auto/gui_gtk_gresources.c: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
|
||||
$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register $<
|
||||
$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register gui_gtk_res.xml
|
||||
auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
|
||||
$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register $<
|
||||
if test -z "$(GLIB_COMPILE_RESOURCES)"; then touch $@; else \
|
||||
$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../pixmaps --generate --c-name=gui_gtk --manual-register gui_gtk_res.xml; \
|
||||
fi
|
||||
|
||||
# All the object files are put in the "objects" directory. Since not all make
|
||||
# commands understand putting object files in another directory, it must be
|
||||
@@ -2834,6 +2860,9 @@ objects/integration.o: integration.c
|
||||
objects/json.o: json.c
|
||||
$(CCC) -o $@ json.c
|
||||
|
||||
objects/json_test.o: json_test.c
|
||||
$(CCC) -o $@ json_test.c
|
||||
|
||||
objects/main.o: main.c
|
||||
$(CCC) -o $@ main.c
|
||||
|
||||
@@ -3357,6 +3386,10 @@ objects/gui_at_fs.o: gui_at_fs.c vim.h auto/config.h feature.h os_unix.h \
|
||||
objects/pty.o: pty.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \
|
||||
keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \
|
||||
proto/gui_beval.pro alloc.h ex_cmds.h proto.h globals.h farsi.h arabic.h
|
||||
objects/json_test.o: json_test.c main.c vim.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||
regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h farsi.c arabic.c json.c
|
||||
objects/memfile_test.o: memfile_test.c main.c vim.h auto/config.h feature.h \
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \
|
||||
structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro alloc.h \
|
||||
|
||||
+28
-46
@@ -43,8 +43,7 @@ static int A_is_special(int c);
|
||||
* Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered)
|
||||
*/
|
||||
static int
|
||||
A_is_a(cur_c)
|
||||
int cur_c;
|
||||
A_is_a(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@@ -96,8 +95,7 @@ A_is_a(cur_c)
|
||||
* Returns True if c is an Isolated Form-B ARABIC letter
|
||||
*/
|
||||
static int
|
||||
A_is_s(cur_c)
|
||||
int cur_c;
|
||||
A_is_s(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@@ -148,8 +146,7 @@ A_is_s(cur_c)
|
||||
* Returns True if c is a Final shape of an ARABIC letter
|
||||
*/
|
||||
static int
|
||||
A_is_f(cur_c)
|
||||
int cur_c;
|
||||
A_is_f(int cur_c)
|
||||
{
|
||||
switch (cur_c)
|
||||
{
|
||||
@@ -202,8 +199,7 @@ A_is_f(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Form-B Isolated
|
||||
*/
|
||||
static int
|
||||
chg_c_a2s(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2s(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -332,8 +328,7 @@ chg_c_a2s(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Initial
|
||||
*/
|
||||
static int
|
||||
chg_c_a2i(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2i(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -462,8 +457,7 @@ chg_c_a2i(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_a2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -592,8 +586,7 @@ chg_c_a2m(cur_c)
|
||||
* Change shape - from ISO-8859-6/Isolated to final
|
||||
*/
|
||||
static int
|
||||
chg_c_a2f(cur_c)
|
||||
int cur_c;
|
||||
chg_c_a2f(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -732,8 +725,7 @@ chg_c_a2f(cur_c)
|
||||
* Change shape - from Initial to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_i2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_i2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -820,8 +812,7 @@ chg_c_i2m(cur_c)
|
||||
* Change shape - from Final to Medial
|
||||
*/
|
||||
static int
|
||||
chg_c_f2m(cur_c)
|
||||
int cur_c;
|
||||
chg_c_f2m(int cur_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -930,8 +921,7 @@ chg_c_f2m(cur_c)
|
||||
* Change shape - from Combination (2 char) to an Isolated
|
||||
*/
|
||||
static int
|
||||
chg_c_laa2i(hid_c)
|
||||
int hid_c;
|
||||
chg_c_laa2i(int hid_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -961,8 +951,7 @@ chg_c_laa2i(hid_c)
|
||||
* Change shape - from Combination-Isolated to Final
|
||||
*/
|
||||
static int
|
||||
chg_c_laa2f(hid_c)
|
||||
int hid_c;
|
||||
chg_c_laa2f(int hid_c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -991,8 +980,7 @@ chg_c_laa2f(hid_c)
|
||||
* Do "half-shaping" on character "c". Return zero if no shaping.
|
||||
*/
|
||||
static int
|
||||
half_shape(c)
|
||||
int c;
|
||||
half_shape(int c)
|
||||
{
|
||||
if (A_is_a(c))
|
||||
return chg_c_a2i(c);
|
||||
@@ -1011,13 +999,13 @@ half_shape(c)
|
||||
* in: "next_c" is the next character (not shaped).
|
||||
*/
|
||||
int
|
||||
arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
|
||||
int c;
|
||||
int *ccp;
|
||||
int *c1p;
|
||||
int prev_c;
|
||||
int prev_c1;
|
||||
int next_c;
|
||||
arabic_shape(
|
||||
int c,
|
||||
int *ccp,
|
||||
int *c1p,
|
||||
int prev_c,
|
||||
int prev_c1,
|
||||
int next_c)
|
||||
{
|
||||
int curr_c;
|
||||
int shape_c;
|
||||
@@ -1082,9 +1070,9 @@ arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
|
||||
* A_firstc_laa returns first character of LAA combination if it exists
|
||||
*/
|
||||
static int
|
||||
A_firstc_laa(c, c1)
|
||||
int c; /* base character */
|
||||
int c1; /* first composing character */
|
||||
A_firstc_laa(
|
||||
int c, /* base character */
|
||||
int c1) /* first composing character */
|
||||
{
|
||||
if (c1 != NUL && c == a_LAM && !A_is_harakat(c1))
|
||||
return c1;
|
||||
@@ -1097,8 +1085,7 @@ A_firstc_laa(c, c1)
|
||||
* (harakat/tanween)
|
||||
*/
|
||||
static int
|
||||
A_is_harakat(c)
|
||||
int c;
|
||||
A_is_harakat(int c)
|
||||
{
|
||||
return (c >= a_FATHATAN && c <= a_SUKUN);
|
||||
}
|
||||
@@ -1109,8 +1096,7 @@ A_is_harakat(c)
|
||||
* (alphabet/number/punctuation)
|
||||
*/
|
||||
static int
|
||||
A_is_iso(c)
|
||||
int c;
|
||||
A_is_iso(int c)
|
||||
{
|
||||
return ((c >= a_HAMZA && c <= a_GHAIN)
|
||||
|| (c >= a_TATWEEL && c <= a_HAMZA_BELOW)
|
||||
@@ -1123,8 +1109,7 @@ A_is_iso(c)
|
||||
* (alphabet/number/punctuation)
|
||||
*/
|
||||
static int
|
||||
A_is_formb(c)
|
||||
int c;
|
||||
A_is_formb(int c)
|
||||
{
|
||||
return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
|
||||
|| c == a_s_KASRATAN
|
||||
@@ -1137,8 +1122,7 @@ A_is_formb(c)
|
||||
* A_is_ok returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
|
||||
*/
|
||||
static int
|
||||
A_is_ok(c)
|
||||
int c;
|
||||
A_is_ok(int c)
|
||||
{
|
||||
return (A_is_iso(c) || A_is_formb(c));
|
||||
}
|
||||
@@ -1149,8 +1133,7 @@ A_is_ok(c)
|
||||
* with some exceptions/exclusions
|
||||
*/
|
||||
static int
|
||||
A_is_valid(c)
|
||||
int c;
|
||||
A_is_valid(int c)
|
||||
{
|
||||
return (A_is_ok(c) && !A_is_special(c));
|
||||
}
|
||||
@@ -1161,8 +1144,7 @@ A_is_valid(c)
|
||||
* Specials don't adhere to most of the rules.
|
||||
*/
|
||||
static int
|
||||
A_is_special(c)
|
||||
int c;
|
||||
A_is_special(int c)
|
||||
{
|
||||
return (c == a_HAMZA || c == a_s_HAMZA);
|
||||
}
|
||||
|
||||
Vendored
+22
-6
@@ -639,7 +639,6 @@ NARROW_PROTO
|
||||
MOTIF_LIBNAME
|
||||
GRESOURCE_OBJ
|
||||
GRESOURCE_SRC
|
||||
GRESOURCE_HDR
|
||||
GLIB_COMPILE_RESOURCES
|
||||
GNOME_INCLUDEDIR
|
||||
GNOME_LIBDIR
|
||||
@@ -4906,6 +4905,10 @@ fi
|
||||
$as_echo "$enable_luainterp" >&6; }
|
||||
|
||||
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
as_fn_error $? "cannot use Lua with tiny or small features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-lua-prefix argument" >&5
|
||||
@@ -5646,6 +5649,9 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_perlinterp" >&5
|
||||
$as_echo "$enable_perlinterp" >&6; }
|
||||
if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
as_fn_error $? "cannot use Perl with tiny or small features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Extract the first word of "perl", so it can be a program name with args.
|
||||
set dummy perl; ac_word=$2
|
||||
@@ -7319,8 +7325,14 @@ else
|
||||
fi
|
||||
|
||||
if test "$enable_netbeans" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny or small features" >&5
|
||||
$as_echo "cannot use NetBeans with tiny or small features" >&6; }
|
||||
enable_netbeans="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
@@ -7336,8 +7348,14 @@ else
|
||||
fi
|
||||
|
||||
if test "$enable_channel" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny or small features" >&5
|
||||
$as_echo "cannot use channels with tiny or small features" >&6; }
|
||||
enable_channel="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
else
|
||||
if test "$enable_netbeans" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, netbeans also disabled" >&5
|
||||
@@ -9199,7 +9217,6 @@ $as_echo "cannot be found in PATH." >&6; }
|
||||
$as_echo "usable." >&6; }
|
||||
$as_echo "#define USE_GRESOURCE 1" >>confdefs.h
|
||||
|
||||
GRESOURCE_HDR="auto/gui_gtk_gresources.h"
|
||||
GRESOURCE_SRC="auto/gui_gtk_gresources.c"
|
||||
GRESOURCE_OBJ="objects/gui_gtk_gresources.o"
|
||||
fi
|
||||
@@ -9217,7 +9234,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test -z "$SKIP_MOTIF"; then
|
||||
gui_XXX="/usr/XXX/Motif* /usr/Motif*/XXX /usr/XXX /usr/shlib /usr/X11*/XXX /usr/XXX/X11* /usr/dt/XXX /local/Motif*/XXX /local/XXX/Motif* /usr/local/Motif*/XXX /usr/local/XXX/Motif* /usr/local/XXX /usr/local/X11*/XXX /usr/local/LessTif/Motif*/XXX $MOTIFHOME/XXX"
|
||||
GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
|
||||
@@ -10175,7 +10191,7 @@ fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
for ac_header in stdarg.h stdint.h stdlib.h string.h \
|
||||
for ac_header in stdint.h stdlib.h string.h \
|
||||
sys/select.h sys/utsname.h termcap.h fcntl.h \
|
||||
sgtty.h sys/ioctl.h sys/time.h sys/types.h \
|
||||
termio.h iconv.h inttypes.h langinfo.h math.h \
|
||||
|
||||
+39
-39
@@ -348,10 +348,10 @@ static UINT32_T sbx_init[4][256] = {
|
||||
bfs->sbx[3][xr & 0xFF];
|
||||
|
||||
static void
|
||||
bf_e_block(bfs, p_xl, p_xr)
|
||||
bf_state_T *bfs;
|
||||
UINT32_T *p_xl;
|
||||
UINT32_T *p_xr;
|
||||
bf_e_block(
|
||||
bf_state_T *bfs,
|
||||
UINT32_T *p_xl,
|
||||
UINT32_T *p_xr)
|
||||
{
|
||||
UINT32_T temp;
|
||||
UINT32_T xl = *p_xl;
|
||||
@@ -384,9 +384,9 @@ bf_e_block(bfs, p_xl, p_xr)
|
||||
#endif
|
||||
|
||||
static void
|
||||
bf_e_cblock(bfs, block)
|
||||
bf_state_T *bfs;
|
||||
char_u *block;
|
||||
bf_e_cblock(
|
||||
bf_state_T *bfs,
|
||||
char_u *block)
|
||||
{
|
||||
block8 bk;
|
||||
|
||||
@@ -404,11 +404,11 @@ bf_e_cblock(bfs, block)
|
||||
* "salt[salt_len]" as the salt.
|
||||
*/
|
||||
static void
|
||||
bf_key_init(bfs, password, salt, salt_len)
|
||||
bf_state_T *bfs;
|
||||
char_u *password;
|
||||
char_u *salt;
|
||||
int salt_len;
|
||||
bf_key_init(
|
||||
bf_state_T *bfs,
|
||||
char_u *password,
|
||||
char_u *salt,
|
||||
int salt_len)
|
||||
{
|
||||
int i, j, keypos = 0;
|
||||
unsigned u;
|
||||
@@ -470,10 +470,10 @@ bf_key_init(bfs, password, salt, salt_len)
|
||||
* Blowfish self-test for corrupted tables or instructions.
|
||||
*/
|
||||
static int
|
||||
bf_check_tables(pax, sbx, val)
|
||||
UINT32_T pax[18];
|
||||
UINT32_T sbx[4][256];
|
||||
UINT32_T val;
|
||||
bf_check_tables(
|
||||
UINT32_T pax[18],
|
||||
UINT32_T sbx[4][256],
|
||||
UINT32_T val)
|
||||
{
|
||||
int i, j;
|
||||
UINT32_T c = 0;
|
||||
@@ -514,7 +514,7 @@ static struct_bf_test_data bf_test_data[] = {
|
||||
* Return FAIL when there is something wrong with blowfish encryption.
|
||||
*/
|
||||
static int
|
||||
bf_self_test()
|
||||
bf_self_test(void)
|
||||
{
|
||||
int i, bn;
|
||||
int err = 0;
|
||||
@@ -566,10 +566,10 @@ bf_self_test()
|
||||
* Initialize with seed "seed[seed_len]".
|
||||
*/
|
||||
static void
|
||||
bf_cfb_init(bfs, seed, seed_len)
|
||||
bf_state_T *bfs;
|
||||
char_u *seed;
|
||||
int seed_len;
|
||||
bf_cfb_init(
|
||||
bf_state_T *bfs,
|
||||
char_u *seed,
|
||||
int seed_len)
|
||||
{
|
||||
int i, mi;
|
||||
|
||||
@@ -602,11 +602,11 @@ bf_cfb_init(bfs, seed, seed_len)
|
||||
* "from" and "to" can be equal to encrypt in place.
|
||||
*/
|
||||
void
|
||||
crypt_blowfish_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_blowfish_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@@ -625,11 +625,11 @@ crypt_blowfish_encode(state, from, len, to)
|
||||
* Decrypt "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_blowfish_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_blowfish_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@@ -644,13 +644,13 @@ crypt_blowfish_decode(state, from, len, to)
|
||||
}
|
||||
|
||||
void
|
||||
crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
|
||||
cryptstate_T *state;
|
||||
char_u* key;
|
||||
char_u* salt;
|
||||
int salt_len;
|
||||
char_u* seed;
|
||||
int seed_len;
|
||||
crypt_blowfish_init(
|
||||
cryptstate_T *state,
|
||||
char_u* key,
|
||||
char_u* salt,
|
||||
int salt_len,
|
||||
char_u* seed,
|
||||
int seed_len)
|
||||
{
|
||||
bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
|
||||
|
||||
@@ -672,7 +672,7 @@ crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
|
||||
* Give an error and return FAIL when not.
|
||||
*/
|
||||
int
|
||||
blowfish_self_test()
|
||||
blowfish_self_test(void)
|
||||
{
|
||||
if (sha256_self_test() == FAIL)
|
||||
{
|
||||
|
||||
+233
-276
File diff suppressed because it is too large
Load Diff
+1663
-560
File diff suppressed because it is too large
Load Diff
+108
-175
@@ -68,15 +68,15 @@ static char_u g_chartab[256];
|
||||
* error, OK otherwise.
|
||||
*/
|
||||
int
|
||||
init_chartab()
|
||||
init_chartab(void)
|
||||
{
|
||||
return buf_init_chartab(curbuf, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
buf_init_chartab(buf, global)
|
||||
buf_T *buf;
|
||||
int global; /* FALSE: only set buf->b_chartab[] */
|
||||
buf_init_chartab(
|
||||
buf_T *buf,
|
||||
int global) /* FALSE: only set buf->b_chartab[] */
|
||||
{
|
||||
int c;
|
||||
int c2;
|
||||
@@ -313,9 +313,9 @@ buf_init_chartab(buf, global)
|
||||
* enough room, not all characters will be translated.
|
||||
*/
|
||||
void
|
||||
trans_characters(buf, bufsize)
|
||||
char_u *buf;
|
||||
int bufsize;
|
||||
trans_characters(
|
||||
char_u *buf,
|
||||
int bufsize)
|
||||
{
|
||||
int len; /* length of string needing translation */
|
||||
int room; /* room in buffer after string */
|
||||
@@ -356,8 +356,7 @@ trans_characters(buf, bufsize)
|
||||
* printable chars. Returns NULL when out of memory.
|
||||
*/
|
||||
char_u *
|
||||
transstr(s)
|
||||
char_u *s;
|
||||
transstr(char_u *s)
|
||||
{
|
||||
char_u *res;
|
||||
char_u *p;
|
||||
@@ -434,11 +433,11 @@ transstr(s)
|
||||
* Otherwise puts the result in "buf[buflen]".
|
||||
*/
|
||||
char_u *
|
||||
str_foldcase(str, orglen, buf, buflen)
|
||||
char_u *str;
|
||||
int orglen;
|
||||
char_u *buf;
|
||||
int buflen;
|
||||
str_foldcase(
|
||||
char_u *str,
|
||||
int orglen,
|
||||
char_u *buf,
|
||||
int buflen)
|
||||
{
|
||||
garray_T ga;
|
||||
int i;
|
||||
@@ -552,8 +551,7 @@ str_foldcase(str, orglen, buf, buflen)
|
||||
static char_u transchar_buf[7];
|
||||
|
||||
char_u *
|
||||
transchar(c)
|
||||
int c;
|
||||
transchar(int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -592,8 +590,7 @@ transchar(c)
|
||||
* for an illegal UTF-8 byte.
|
||||
*/
|
||||
char_u *
|
||||
transchar_byte(c)
|
||||
int c;
|
||||
transchar_byte(int c)
|
||||
{
|
||||
if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
@@ -610,9 +607,7 @@ transchar_byte(c)
|
||||
* Does NOT work for multi-byte characters, c must be <= 255.
|
||||
*/
|
||||
void
|
||||
transchar_nonprint(buf, c)
|
||||
char_u *buf;
|
||||
int c;
|
||||
transchar_nonprint(char_u *buf, int c)
|
||||
{
|
||||
if (c == NL)
|
||||
c = NUL; /* we use newline in place of a NUL */
|
||||
@@ -679,9 +674,7 @@ transchar_nonprint(buf, c)
|
||||
}
|
||||
|
||||
void
|
||||
transchar_hex(buf, c)
|
||||
char_u *buf;
|
||||
int c;
|
||||
transchar_hex(char_u *buf, int c)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@@ -705,8 +698,7 @@ transchar_hex(buf, c)
|
||||
* function key 1.
|
||||
*/
|
||||
static unsigned
|
||||
nr2hex(c)
|
||||
unsigned c;
|
||||
nr2hex(unsigned c)
|
||||
{
|
||||
if ((c & 0xf) <= 9)
|
||||
return (c & 0xf) + '0';
|
||||
@@ -722,8 +714,7 @@ nr2hex(c)
|
||||
* cells depends on further bytes.
|
||||
*/
|
||||
int
|
||||
byte2cells(b)
|
||||
int b;
|
||||
byte2cells(int b)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8 && b >= 0x80)
|
||||
@@ -738,8 +729,7 @@ byte2cells(b)
|
||||
* A TAB is counted as two cells: "^I" or four: "<09>".
|
||||
*/
|
||||
int
|
||||
char2cells(c)
|
||||
int c;
|
||||
char2cells(int c)
|
||||
{
|
||||
if (IS_SPECIAL(c))
|
||||
return char2cells(K_SECOND(c)) + 2;
|
||||
@@ -767,8 +757,7 @@ char2cells(c)
|
||||
* A TAB is counted as two cells: "^I" or four: "<09>".
|
||||
*/
|
||||
int
|
||||
ptr2cells(p)
|
||||
char_u *p;
|
||||
ptr2cells(char_u *p)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
/* For UTF-8 we need to look at more bytes if the first byte is >= 0x80. */
|
||||
@@ -784,8 +773,7 @@ ptr2cells(p)
|
||||
* counting TABs as two characters: "^I".
|
||||
*/
|
||||
int
|
||||
vim_strsize(s)
|
||||
char_u *s;
|
||||
vim_strsize(char_u *s)
|
||||
{
|
||||
return vim_strnsize(s, (int)MAXCOL);
|
||||
}
|
||||
@@ -795,9 +783,7 @@ vim_strsize(s)
|
||||
* screen, counting TABs as two characters: "^I".
|
||||
*/
|
||||
int
|
||||
vim_strnsize(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
vim_strnsize(char_u *s, int len)
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
@@ -836,23 +822,15 @@ vim_strnsize(s, len)
|
||||
else \
|
||||
return ptr2cells(p);
|
||||
|
||||
#if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || defined(FEAT_GUI) \
|
||||
|| defined(FEAT_VIRTUALEDIT) || defined(PROTO)
|
||||
int
|
||||
chartabsize(p, col)
|
||||
char_u *p;
|
||||
colnr_T col;
|
||||
chartabsize(char_u *p, colnr_T col)
|
||||
{
|
||||
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_LINEBREAK
|
||||
static int
|
||||
win_chartabsize(wp, p, col)
|
||||
win_T *wp;
|
||||
char_u *p;
|
||||
colnr_T col;
|
||||
win_chartabsize(win_T *wp, char_u *p, colnr_T col)
|
||||
{
|
||||
RET_WIN_BUF_CHARTABSIZE(wp, wp->w_buffer, p, col)
|
||||
}
|
||||
@@ -863,8 +841,7 @@ win_chartabsize(wp, p, col)
|
||||
* taking into account the size of a tab.
|
||||
*/
|
||||
int
|
||||
linetabsize(s)
|
||||
char_u *s;
|
||||
linetabsize(char_u *s)
|
||||
{
|
||||
return linetabsize_col(0, s);
|
||||
}
|
||||
@@ -873,9 +850,7 @@ linetabsize(s)
|
||||
* Like linetabsize(), but starting at column "startcol".
|
||||
*/
|
||||
int
|
||||
linetabsize_col(startcol, s)
|
||||
int startcol;
|
||||
char_u *s;
|
||||
linetabsize_col(int startcol, char_u *s)
|
||||
{
|
||||
colnr_T col = startcol;
|
||||
char_u *line = s; /* pointer to start of line, for breakindent */
|
||||
@@ -889,10 +864,7 @@ linetabsize_col(startcol, s)
|
||||
* Like linetabsize(), but for a given window instead of the current one.
|
||||
*/
|
||||
int
|
||||
win_linetabsize(wp, line, len)
|
||||
win_T *wp;
|
||||
char_u *line;
|
||||
colnr_T len;
|
||||
win_linetabsize(win_T *wp, char_u *line, colnr_T len)
|
||||
{
|
||||
colnr_T col = 0;
|
||||
char_u *s;
|
||||
@@ -908,8 +880,7 @@ win_linetabsize(wp, line, len)
|
||||
* Letters and characters from the 'isident' option.
|
||||
*/
|
||||
int
|
||||
vim_isIDc(c)
|
||||
int c;
|
||||
vim_isIDc(int c)
|
||||
{
|
||||
return (c > 0 && c < 0x100 && (g_chartab[c] & CT_ID_CHAR));
|
||||
}
|
||||
@@ -920,16 +891,13 @@ vim_isIDc(c)
|
||||
* For multi-byte characters mb_get_class() is used (builtin rules).
|
||||
*/
|
||||
int
|
||||
vim_iswordc(c)
|
||||
int c;
|
||||
vim_iswordc(int c)
|
||||
{
|
||||
return vim_iswordc_buf(c, curbuf);
|
||||
}
|
||||
|
||||
int
|
||||
vim_iswordc_buf(c, buf)
|
||||
int c;
|
||||
buf_T *buf;
|
||||
vim_iswordc_buf(int c, buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (c >= 0x100)
|
||||
@@ -947,8 +915,7 @@ vim_iswordc_buf(c, buf)
|
||||
* Just like vim_iswordc() but uses a pointer to the (multi-byte) character.
|
||||
*/
|
||||
int
|
||||
vim_iswordp(p)
|
||||
char_u *p;
|
||||
vim_iswordp(char_u *p)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
@@ -958,9 +925,7 @@ vim_iswordp(p)
|
||||
}
|
||||
|
||||
int
|
||||
vim_iswordp_buf(p, buf)
|
||||
char_u *p;
|
||||
buf_T *buf;
|
||||
vim_iswordp_buf(char_u *p, buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
@@ -974,8 +939,7 @@ vim_iswordp_buf(p, buf)
|
||||
* Assume characters above 0x100 are valid (multi-byte).
|
||||
*/
|
||||
int
|
||||
vim_isfilec(c)
|
||||
int c;
|
||||
vim_isfilec(int c)
|
||||
{
|
||||
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_FNAME_CHAR)));
|
||||
}
|
||||
@@ -987,8 +951,7 @@ vim_isfilec(c)
|
||||
* returns false.
|
||||
*/
|
||||
int
|
||||
vim_isfilec_or_wc(c)
|
||||
int c;
|
||||
vim_isfilec_or_wc(int c)
|
||||
{
|
||||
char_u buf[2];
|
||||
|
||||
@@ -1003,8 +966,7 @@ vim_isfilec_or_wc(c)
|
||||
* Unicode.
|
||||
*/
|
||||
int
|
||||
vim_isprintc(c)
|
||||
int c;
|
||||
vim_isprintc(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8 && c >= 0x100)
|
||||
@@ -1018,8 +980,7 @@ vim_isprintc(c)
|
||||
* byte of a double-byte character.
|
||||
*/
|
||||
int
|
||||
vim_isprintc_strict(c)
|
||||
int c;
|
||||
vim_isprintc_strict(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_dbcs != 0 && c < 0x100 && MB_BYTE2LEN(c) > 1)
|
||||
@@ -1034,10 +995,10 @@ vim_isprintc_strict(c)
|
||||
* like chartabsize(), but also check for line breaks on the screen
|
||||
*/
|
||||
int
|
||||
lbr_chartabsize(line, s, col)
|
||||
char_u *line UNUSED; /* start of the line */
|
||||
unsigned char *s;
|
||||
colnr_T col;
|
||||
lbr_chartabsize(
|
||||
char_u *line UNUSED, /* start of the line */
|
||||
unsigned char *s,
|
||||
colnr_T col)
|
||||
{
|
||||
#ifdef FEAT_LINEBREAK
|
||||
if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri)
|
||||
@@ -1058,10 +1019,10 @@ lbr_chartabsize(line, s, col)
|
||||
* Call lbr_chartabsize() and advance the pointer.
|
||||
*/
|
||||
int
|
||||
lbr_chartabsize_adv(line, s, col)
|
||||
char_u *line; /* start of the line */
|
||||
char_u **s;
|
||||
colnr_T col;
|
||||
lbr_chartabsize_adv(
|
||||
char_u *line, /* start of the line */
|
||||
char_u **s,
|
||||
colnr_T col)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -1078,12 +1039,12 @@ lbr_chartabsize_adv(line, s, col)
|
||||
* value, init to 0 before calling.
|
||||
*/
|
||||
int
|
||||
win_lbr_chartabsize(wp, line, s, col, headp)
|
||||
win_T *wp;
|
||||
char_u *line UNUSED; /* start of the line */
|
||||
char_u *s;
|
||||
colnr_T col;
|
||||
int *headp UNUSED;
|
||||
win_lbr_chartabsize(
|
||||
win_T *wp,
|
||||
char_u *line UNUSED, /* start of the line */
|
||||
char_u *s,
|
||||
colnr_T col,
|
||||
int *headp UNUSED)
|
||||
{
|
||||
#ifdef FEAT_LINEBREAK
|
||||
int c;
|
||||
@@ -1254,11 +1215,11 @@ win_lbr_chartabsize(wp, line, s, col, headp)
|
||||
* doesn't fit at the end of the screen line.
|
||||
*/
|
||||
static int
|
||||
win_nolbr_chartabsize(wp, s, col, headp)
|
||||
win_T *wp;
|
||||
char_u *s;
|
||||
colnr_T col;
|
||||
int *headp;
|
||||
win_nolbr_chartabsize(
|
||||
win_T *wp,
|
||||
char_u *s,
|
||||
colnr_T col,
|
||||
int *headp)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -1284,9 +1245,7 @@ win_nolbr_chartabsize(wp, s, col, headp)
|
||||
* "wp".
|
||||
*/
|
||||
int
|
||||
in_win_border(wp, vcol)
|
||||
win_T *wp;
|
||||
colnr_T vcol;
|
||||
in_win_border(win_T *wp, colnr_T vcol)
|
||||
{
|
||||
int width1; /* width of first line (after line number) */
|
||||
int width2; /* width of further lines */
|
||||
@@ -1316,12 +1275,12 @@ in_win_border(wp, vcol)
|
||||
* This is used very often, keep it fast!
|
||||
*/
|
||||
void
|
||||
getvcol(wp, pos, start, cursor, end)
|
||||
win_T *wp;
|
||||
pos_T *pos;
|
||||
colnr_T *start;
|
||||
colnr_T *cursor;
|
||||
colnr_T *end;
|
||||
getvcol(
|
||||
win_T *wp,
|
||||
pos_T *pos,
|
||||
colnr_T *start,
|
||||
colnr_T *cursor,
|
||||
colnr_T *end)
|
||||
{
|
||||
colnr_T vcol;
|
||||
char_u *ptr; /* points to current char */
|
||||
@@ -1446,8 +1405,7 @@ getvcol(wp, pos, start, cursor, end)
|
||||
* Get virtual cursor column in the current window, pretending 'list' is off.
|
||||
*/
|
||||
colnr_T
|
||||
getvcol_nolist(posp)
|
||||
pos_T *posp;
|
||||
getvcol_nolist(pos_T *posp)
|
||||
{
|
||||
int list_save = curwin->w_p_list;
|
||||
colnr_T vcol;
|
||||
@@ -1463,12 +1421,12 @@ getvcol_nolist(posp)
|
||||
* Get virtual column in virtual mode.
|
||||
*/
|
||||
void
|
||||
getvvcol(wp, pos, start, cursor, end)
|
||||
win_T *wp;
|
||||
pos_T *pos;
|
||||
colnr_T *start;
|
||||
colnr_T *cursor;
|
||||
colnr_T *end;
|
||||
getvvcol(
|
||||
win_T *wp,
|
||||
pos_T *pos,
|
||||
colnr_T *start,
|
||||
colnr_T *cursor,
|
||||
colnr_T *end)
|
||||
{
|
||||
colnr_T col;
|
||||
colnr_T coladd;
|
||||
@@ -1519,10 +1477,12 @@ getvvcol(wp, pos, start, cursor, end)
|
||||
* Used for Visual block mode.
|
||||
*/
|
||||
void
|
||||
getvcols(wp, pos1, pos2, left, right)
|
||||
win_T *wp;
|
||||
pos_T *pos1, *pos2;
|
||||
colnr_T *left, *right;
|
||||
getvcols(
|
||||
win_T *wp,
|
||||
pos_T *pos1,
|
||||
pos_T *pos2,
|
||||
colnr_T *left,
|
||||
colnr_T *right)
|
||||
{
|
||||
colnr_T from1, from2, to1, to2;
|
||||
|
||||
@@ -1555,8 +1515,7 @@ getvcols(wp, pos1, pos2, left, right)
|
||||
* skipwhite: skip over ' ' and '\t'.
|
||||
*/
|
||||
char_u *
|
||||
skipwhite(q)
|
||||
char_u *q;
|
||||
skipwhite(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1569,8 +1528,7 @@ skipwhite(q)
|
||||
* skip over digits
|
||||
*/
|
||||
char_u *
|
||||
skipdigits(q)
|
||||
char_u *q;
|
||||
skipdigits(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1584,8 +1542,7 @@ skipdigits(q)
|
||||
* skip over binary digits
|
||||
*/
|
||||
char_u *
|
||||
skipbin(q)
|
||||
char_u *q;
|
||||
skipbin(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1598,8 +1555,7 @@ skipbin(q)
|
||||
* skip over digits and hex characters
|
||||
*/
|
||||
char_u *
|
||||
skiphex(q)
|
||||
char_u *q;
|
||||
skiphex(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1609,13 +1565,11 @@ skiphex(q)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
|
||||
/*
|
||||
* skip to bin digit (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptobin(q)
|
||||
char_u *q;
|
||||
skiptobin(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1628,8 +1582,7 @@ skiptobin(q)
|
||||
* skip to digit (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptodigit(q)
|
||||
char_u *q;
|
||||
skiptodigit(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1642,8 +1595,7 @@ skiptodigit(q)
|
||||
* skip to hex character (or NUL after the string)
|
||||
*/
|
||||
char_u *
|
||||
skiptohex(q)
|
||||
char_u *q;
|
||||
skiptohex(char_u *q)
|
||||
{
|
||||
char_u *p = q;
|
||||
|
||||
@@ -1651,7 +1603,6 @@ skiptohex(q)
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Variant of isdigit() that can handle characters > 0x100.
|
||||
@@ -1660,8 +1611,7 @@ skiptohex(q)
|
||||
* Use the VIM_ISDIGIT() macro for simple arguments.
|
||||
*/
|
||||
int
|
||||
vim_isdigit(c)
|
||||
int c;
|
||||
vim_isdigit(int c)
|
||||
{
|
||||
return (c >= '0' && c <= '9');
|
||||
}
|
||||
@@ -1672,8 +1622,7 @@ vim_isdigit(c)
|
||||
* superscript 1 to be a digit.
|
||||
*/
|
||||
int
|
||||
vim_isxdigit(c)
|
||||
int c;
|
||||
vim_isxdigit(int c)
|
||||
{
|
||||
return (c >= '0' && c <= '9')
|
||||
|| (c >= 'a' && c <= 'f')
|
||||
@@ -1685,8 +1634,7 @@ vim_isxdigit(c)
|
||||
* characters > 0x100.
|
||||
*/
|
||||
int
|
||||
vim_isbdigit(c)
|
||||
int c;
|
||||
vim_isbdigit(int c)
|
||||
{
|
||||
return (c == '0' || c == '1');
|
||||
}
|
||||
@@ -1706,8 +1654,7 @@ static char_u latin1upper[257] = " !\"#$%&'()*+,
|
||||
static char_u latin1lower[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
|
||||
|
||||
int
|
||||
vim_islower(c)
|
||||
int c;
|
||||
vim_islower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return FALSE;
|
||||
@@ -1731,8 +1678,7 @@ vim_islower(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_isupper(c)
|
||||
int c;
|
||||
vim_isupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return FALSE;
|
||||
@@ -1756,8 +1702,7 @@ vim_isupper(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_toupper(c)
|
||||
int c;
|
||||
vim_toupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
@@ -1781,8 +1726,7 @@ vim_toupper(c)
|
||||
}
|
||||
|
||||
int
|
||||
vim_tolower(c)
|
||||
int c;
|
||||
vim_tolower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
@@ -1810,8 +1754,7 @@ vim_tolower(c)
|
||||
* skiptowhite: skip over text until ' ' or '\t' or NUL.
|
||||
*/
|
||||
char_u *
|
||||
skiptowhite(p)
|
||||
char_u *p;
|
||||
skiptowhite(char_u *p)
|
||||
{
|
||||
while (*p != ' ' && *p != '\t' && *p != NUL)
|
||||
++p;
|
||||
@@ -1824,8 +1767,7 @@ skiptowhite(p)
|
||||
* skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
|
||||
*/
|
||||
char_u *
|
||||
skiptowhite_esc(p)
|
||||
char_u *p;
|
||||
skiptowhite_esc(char_u *p)
|
||||
{
|
||||
while (*p != ' ' && *p != '\t' && *p != NUL)
|
||||
{
|
||||
@@ -1842,8 +1784,7 @@ skiptowhite_esc(p)
|
||||
* Note: the argument is a pointer to a char_u pointer!
|
||||
*/
|
||||
long
|
||||
getdigits(pp)
|
||||
char_u **pp;
|
||||
getdigits(char_u **pp)
|
||||
{
|
||||
char_u *p;
|
||||
long retval;
|
||||
@@ -1861,8 +1802,7 @@ getdigits(pp)
|
||||
* Return TRUE if "lbuf" is empty or only contains blanks.
|
||||
*/
|
||||
int
|
||||
vim_isblankline(lbuf)
|
||||
char_u *lbuf;
|
||||
vim_isblankline(char_u *lbuf)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -1890,16 +1830,16 @@ vim_isblankline(lbuf)
|
||||
* If maxlen > 0, check at a maximum maxlen chars
|
||||
*/
|
||||
void
|
||||
vim_str2nr(start, prep, len, what, nptr, unptr, maxlen)
|
||||
char_u *start;
|
||||
int *prep; /* return: type of number 0 = decimal, 'x'
|
||||
vim_str2nr(
|
||||
char_u *start,
|
||||
int *prep, /* return: type of number 0 = decimal, 'x'
|
||||
or 'X' is hex, '0' = octal, 'b' or 'B'
|
||||
is bin */
|
||||
int *len; /* return: detected length of number */
|
||||
int what; /* what numbers to recognize */
|
||||
long *nptr; /* return: signed result */
|
||||
unsigned long *unptr; /* return: unsigned result */
|
||||
int maxlen; /* max length of string to check */
|
||||
int *len, /* return: detected length of number */
|
||||
int what, /* what numbers to recognize */
|
||||
long *nptr, /* return: signed result */
|
||||
unsigned long *unptr, /* return: unsigned result */
|
||||
int maxlen) /* max length of string to check */
|
||||
{
|
||||
char_u *ptr = start;
|
||||
int pre = 0; /* default is decimal */
|
||||
@@ -2024,8 +1964,7 @@ vim_str2nr(start, prep, len, what, nptr, unptr, maxlen)
|
||||
* Only valid when the argument is '0' - '9', 'A' - 'F' or 'a' - 'f'.
|
||||
*/
|
||||
int
|
||||
hex2nr(c)
|
||||
int c;
|
||||
hex2nr(int c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'f')
|
||||
return c - 'a' + 10;
|
||||
@@ -2041,8 +1980,7 @@ hex2nr(c)
|
||||
* Return -1 if one of the characters is not hex.
|
||||
*/
|
||||
int
|
||||
hexhex2nr(p)
|
||||
char_u *p;
|
||||
hexhex2nr(char_u *p)
|
||||
{
|
||||
if (!vim_isxdigit(p[0]) || !vim_isxdigit(p[1]))
|
||||
return -1;
|
||||
@@ -2064,8 +2002,7 @@ hexhex2nr(p)
|
||||
* characters.
|
||||
*/
|
||||
int
|
||||
rem_backslash(str)
|
||||
char_u *str;
|
||||
rem_backslash(char_u *str)
|
||||
{
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
return (str[0] == '\\'
|
||||
@@ -2088,8 +2025,7 @@ rem_backslash(str)
|
||||
* is not a normal file character.
|
||||
*/
|
||||
void
|
||||
backslash_halve(p)
|
||||
char_u *p;
|
||||
backslash_halve(char_u *p)
|
||||
{
|
||||
for ( ; *p; ++p)
|
||||
if (rem_backslash(p))
|
||||
@@ -2100,8 +2036,7 @@ backslash_halve(p)
|
||||
* backslash_halve() plus save the result in allocated memory.
|
||||
*/
|
||||
char_u *
|
||||
backslash_halve_save(p)
|
||||
char_u *p;
|
||||
backslash_halve_save(char_u *p)
|
||||
{
|
||||
char_u *res;
|
||||
|
||||
@@ -2159,9 +2094,7 @@ static char_u ebcdic2ascii_tab[256] =
|
||||
* wanting 7-bit ASCII characters out the other end.
|
||||
*/
|
||||
void
|
||||
ebcdic2ascii(buffer, len)
|
||||
char_u *buffer;
|
||||
int len;
|
||||
ebcdic2ascii(char_u *buffer, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -296,7 +296,6 @@
|
||||
/* #undef STDC_HEADERS */
|
||||
|
||||
/* instead, we check a few STDC things ourselves */
|
||||
#undef HAVE_STDARG_H
|
||||
#undef HAVE_STDLIB_H
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
|
||||
@@ -163,7 +163,6 @@ MOTIF_LIBNAME = @MOTIF_LIBNAME@
|
||||
GTK_LIBNAME = @GTK_LIBNAME@
|
||||
|
||||
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
|
||||
GRESOURCE_HDR = @GRESOURCE_HDR@
|
||||
GRESOURCE_SRC = @GRESOURCE_SRC@
|
||||
GRESOURCE_OBJ = @GRESOURCE_OBJ@
|
||||
|
||||
|
||||
+20
-5
@@ -509,6 +509,10 @@ AC_ARG_ENABLE(luainterp,
|
||||
AC_MSG_RESULT($enable_luainterp)
|
||||
|
||||
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
AC_MSG_ERROR([cannot use Lua with tiny or small features])
|
||||
fi
|
||||
|
||||
dnl -- find the lua executable
|
||||
AC_SUBST(vi_cv_path_lua)
|
||||
|
||||
@@ -969,6 +973,9 @@ AC_ARG_ENABLE(perlinterp,
|
||||
[enable_perlinterp="no"])
|
||||
AC_MSG_RESULT($enable_perlinterp)
|
||||
if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
AC_MSG_ERROR([cannot use Perl with tiny or small features])
|
||||
fi
|
||||
AC_SUBST(vi_cv_path_perl)
|
||||
AC_PATH_PROG(vi_cv_path_perl, perl)
|
||||
if test "X$vi_cv_path_perl" != "X"; then
|
||||
@@ -1990,7 +1997,12 @@ AC_ARG_ENABLE(netbeans,
|
||||
[ --disable-netbeans Disable NetBeans integration support.],
|
||||
, [enable_netbeans="yes"])
|
||||
if test "$enable_netbeans" = "yes"; then
|
||||
AC_MSG_RESULT(no)
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
AC_MSG_RESULT([cannot use NetBeans with tiny or small features])
|
||||
enable_netbeans="no"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
@@ -2000,7 +2012,12 @@ AC_ARG_ENABLE(channel,
|
||||
[ --disable-channel Disable process communication support.],
|
||||
, [enable_channel="yes"])
|
||||
if test "$enable_channel" = "yes"; then
|
||||
AC_MSG_RESULT(no)
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
AC_MSG_RESULT([cannot use channels with tiny or small features])
|
||||
enable_channel="no"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
if test "$enable_netbeans" = "yes"; then
|
||||
AC_MSG_RESULT([yes, netbeans also disabled])
|
||||
@@ -2676,7 +2693,6 @@ if test "x$GUITYPE" = "xGTK"; then
|
||||
else
|
||||
AC_MSG_RESULT([usable.])
|
||||
AC_DEFINE(USE_GRESOURCE)
|
||||
GRESOURCE_HDR="auto/gui_gtk_gresources.h"
|
||||
GRESOURCE_SRC="auto/gui_gtk_gresources.c"
|
||||
GRESOURCE_OBJ="objects/gui_gtk_gresources.o"
|
||||
fi
|
||||
@@ -2688,7 +2704,6 @@ if test "x$GUITYPE" = "xGTK"; then
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(GLIB_COMPILE_RESOURCES)
|
||||
AC_SUBST(GRESOURCE_HDR)
|
||||
AC_SUBST(GRESOURCE_SRC)
|
||||
AC_SUBST(GRESOURCE_OBJ)
|
||||
|
||||
@@ -3068,7 +3083,7 @@ if test $ac_cv_header_sys_wait_h = no; then
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \
|
||||
AC_CHECK_HEADERS(stdint.h stdlib.h string.h \
|
||||
sys/select.h sys/utsname.h termcap.h fcntl.h \
|
||||
sgtty.h sys/ioctl.h sys/time.h sys/types.h \
|
||||
termio.h iconv.h inttypes.h langinfo.h math.h \
|
||||
|
||||
+62
-76
@@ -130,8 +130,7 @@ static char crypt_magic_head[] = "VimCrypt~";
|
||||
* 2 for "blowfish2".
|
||||
*/
|
||||
int
|
||||
crypt_method_nr_from_name(name)
|
||||
char_u *name;
|
||||
crypt_method_nr_from_name(char_u *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -147,9 +146,7 @@ crypt_method_nr_from_name(name)
|
||||
* Returns -1 when no encryption used.
|
||||
*/
|
||||
int
|
||||
crypt_method_nr_from_magic(ptr, len)
|
||||
char *ptr;
|
||||
int len;
|
||||
crypt_method_nr_from_magic(char *ptr, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -171,8 +168,7 @@ crypt_method_nr_from_magic(ptr, len)
|
||||
* Return TRUE if the crypt method for "method_nr" can be done in-place.
|
||||
*/
|
||||
int
|
||||
crypt_works_inplace(state)
|
||||
cryptstate_T *state;
|
||||
crypt_works_inplace(cryptstate_T *state)
|
||||
{
|
||||
return cryptmethods[state->method_nr].works_inplace;
|
||||
}
|
||||
@@ -181,8 +177,7 @@ crypt_works_inplace(state)
|
||||
* Get the crypt method for buffer "buf" as a number.
|
||||
*/
|
||||
int
|
||||
crypt_get_method_nr(buf)
|
||||
buf_T *buf;
|
||||
crypt_get_method_nr(buf_T *buf)
|
||||
{
|
||||
return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
|
||||
}
|
||||
@@ -192,8 +187,7 @@ crypt_get_method_nr(buf)
|
||||
* whole undo file, not only the text.
|
||||
*/
|
||||
int
|
||||
crypt_whole_undofile(method_nr)
|
||||
int method_nr;
|
||||
crypt_whole_undofile(int method_nr)
|
||||
{
|
||||
return cryptmethods[method_nr].whole_undofile;
|
||||
}
|
||||
@@ -202,8 +196,7 @@ crypt_whole_undofile(method_nr)
|
||||
* Get crypt method specifc length of the file header in bytes.
|
||||
*/
|
||||
int
|
||||
crypt_get_header_len(method_nr)
|
||||
int method_nr;
|
||||
crypt_get_header_len(int method_nr)
|
||||
{
|
||||
return CRYPT_MAGIC_LEN
|
||||
+ cryptmethods[method_nr].salt_len
|
||||
@@ -215,9 +208,7 @@ crypt_get_header_len(method_nr)
|
||||
* returned by crypt_method_nr_from_name().
|
||||
*/
|
||||
void
|
||||
crypt_set_cm_option(buf, method_nr)
|
||||
buf_T *buf;
|
||||
int method_nr;
|
||||
crypt_set_cm_option(buf_T *buf, int method_nr)
|
||||
{
|
||||
free_string_option(buf->b_p_cm);
|
||||
buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name);
|
||||
@@ -228,7 +219,7 @@ crypt_set_cm_option(buf, method_nr)
|
||||
* return OK/FAIL.
|
||||
*/
|
||||
int
|
||||
crypt_self_test()
|
||||
crypt_self_test(void)
|
||||
{
|
||||
int method_nr = crypt_get_method_nr(curbuf);
|
||||
|
||||
@@ -241,13 +232,13 @@ crypt_self_test()
|
||||
* Allocate a crypt state and initialize it.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u *salt;
|
||||
int salt_len;
|
||||
char_u *seed;
|
||||
int seed_len;
|
||||
crypt_create(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u *salt,
|
||||
int salt_len,
|
||||
char_u *seed,
|
||||
int seed_len)
|
||||
{
|
||||
cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
|
||||
|
||||
@@ -262,10 +253,10 @@ crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
|
||||
* crypt_get_header_len() returns for "method_nr".
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_from_header(method_nr, key, header)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u *header;
|
||||
crypt_create_from_header(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u *header)
|
||||
{
|
||||
char_u *salt = NULL;
|
||||
char_u *seed = NULL;
|
||||
@@ -285,9 +276,7 @@ crypt_create_from_header(method_nr, key, header)
|
||||
* Return an allocated cryptstate_T or NULL on error.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_from_file(fp, key)
|
||||
FILE *fp;
|
||||
char_u *key;
|
||||
crypt_create_from_file(FILE *fp, char_u *key)
|
||||
{
|
||||
int method_nr;
|
||||
int header_len;
|
||||
@@ -326,11 +315,11 @@ crypt_create_from_file(fp, key)
|
||||
* Returns the state or NULL on failure.
|
||||
*/
|
||||
cryptstate_T *
|
||||
crypt_create_for_writing(method_nr, key, header, header_len)
|
||||
int method_nr;
|
||||
char_u *key;
|
||||
char_u **header;
|
||||
int *header_len;
|
||||
crypt_create_for_writing(
|
||||
int method_nr,
|
||||
char_u *key,
|
||||
char_u **header,
|
||||
int *header_len)
|
||||
{
|
||||
int len = crypt_get_header_len(method_nr);
|
||||
char_u *salt = NULL;
|
||||
@@ -371,8 +360,7 @@ crypt_create_for_writing(method_nr, key, header, header_len)
|
||||
* Free the crypt state.
|
||||
*/
|
||||
void
|
||||
crypt_free_state(state)
|
||||
cryptstate_T *state;
|
||||
crypt_free_state(cryptstate_T *state)
|
||||
{
|
||||
vim_free(state->method_state);
|
||||
vim_free(state);
|
||||
@@ -384,11 +372,11 @@ crypt_free_state(state)
|
||||
* Return number of bytes in "newptr", 0 for need more or -1 on error.
|
||||
*/
|
||||
long
|
||||
crypt_encode_alloc(state, from, len, newptr)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u **newptr;
|
||||
crypt_encode_alloc(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u **newptr)
|
||||
{
|
||||
cryptmethod_T *method = &cryptmethods[state->method_nr];
|
||||
|
||||
@@ -412,11 +400,11 @@ crypt_encode_alloc(state, from, len, newptr)
|
||||
* Return number of bytes in "newptr", 0 for need more or -1 on error.
|
||||
*/
|
||||
long
|
||||
crypt_decode_alloc(state, ptr, len, newptr)
|
||||
cryptstate_T *state;
|
||||
char_u *ptr;
|
||||
long len;
|
||||
char_u **newptr;
|
||||
crypt_decode_alloc(
|
||||
cryptstate_T *state,
|
||||
char_u *ptr,
|
||||
long len,
|
||||
char_u **newptr)
|
||||
{
|
||||
cryptmethod_T *method = &cryptmethods[state->method_nr];
|
||||
|
||||
@@ -439,11 +427,11 @@ crypt_decode_alloc(state, ptr, len, newptr)
|
||||
* Encrypting "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
cryptmethods[state->method_nr].encode_fn(state, from, len, to);
|
||||
}
|
||||
@@ -452,11 +440,11 @@ crypt_encode(state, from, len, to)
|
||||
* decrypting "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
cryptmethods[state->method_nr].decode_fn(state, from, len, to);
|
||||
}
|
||||
@@ -465,10 +453,10 @@ crypt_decode(state, from, len, to)
|
||||
* Simple inplace encryption, modifies "buf[len]" in place.
|
||||
*/
|
||||
void
|
||||
crypt_encode_inplace(state, buf, len)
|
||||
cryptstate_T *state;
|
||||
char_u *buf;
|
||||
size_t len;
|
||||
crypt_encode_inplace(
|
||||
cryptstate_T *state,
|
||||
char_u *buf,
|
||||
size_t len)
|
||||
{
|
||||
cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf);
|
||||
}
|
||||
@@ -477,10 +465,10 @@ crypt_encode_inplace(state, buf, len)
|
||||
* Simple inplace decryption, modifies "buf[len]" in place.
|
||||
*/
|
||||
void
|
||||
crypt_decode_inplace(state, buf, len)
|
||||
cryptstate_T *state;
|
||||
char_u *buf;
|
||||
size_t len;
|
||||
crypt_decode_inplace(
|
||||
cryptstate_T *state,
|
||||
char_u *buf,
|
||||
size_t len)
|
||||
{
|
||||
cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf);
|
||||
}
|
||||
@@ -490,8 +478,7 @@ crypt_decode_inplace(state, buf, len)
|
||||
* in memory anywhere.
|
||||
*/
|
||||
void
|
||||
crypt_free_key(key)
|
||||
char_u *key;
|
||||
crypt_free_key(char_u *key)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -507,8 +494,7 @@ crypt_free_key(key)
|
||||
* Check the crypt method and give a warning if it's outdated.
|
||||
*/
|
||||
void
|
||||
crypt_check_method(method)
|
||||
int method;
|
||||
crypt_check_method(int method)
|
||||
{
|
||||
if (method < CRYPT_M_BF2)
|
||||
{
|
||||
@@ -518,7 +504,7 @@ crypt_check_method(method)
|
||||
}
|
||||
|
||||
void
|
||||
crypt_check_current_method()
|
||||
crypt_check_current_method(void)
|
||||
{
|
||||
crypt_check_method(crypt_get_method_nr(curbuf));
|
||||
}
|
||||
@@ -531,9 +517,9 @@ crypt_check_current_method()
|
||||
* Returns NULL on failure.
|
||||
*/
|
||||
char_u *
|
||||
crypt_get_key(store, twice)
|
||||
int store;
|
||||
int twice; /* Ask for the key twice. */
|
||||
crypt_get_key(
|
||||
int store,
|
||||
int twice) /* Ask for the key twice. */
|
||||
{
|
||||
char_u *p1, *p2 = NULL;
|
||||
int round;
|
||||
@@ -589,8 +575,8 @@ crypt_get_key(store, twice)
|
||||
* Append a message to IObuff for the encryption/decryption method being used.
|
||||
*/
|
||||
void
|
||||
crypt_append_msg(buf)
|
||||
buf_T *buf;
|
||||
crypt_append_msg(
|
||||
buf_T *buf)
|
||||
{
|
||||
if (crypt_get_method_nr(buf) == 0)
|
||||
STRCAT(IObuff, _("[crypted]"));
|
||||
|
||||
+18
-18
@@ -44,7 +44,7 @@ static u32_T crc_32_table[256];
|
||||
* Fill the CRC table, if not done already.
|
||||
*/
|
||||
static void
|
||||
make_crc_tab()
|
||||
make_crc_tab(void)
|
||||
{
|
||||
u32_T s, t, v;
|
||||
static int done = FALSE;
|
||||
@@ -85,13 +85,13 @@ make_crc_tab()
|
||||
* Initialize for encryption/decryption.
|
||||
*/
|
||||
void
|
||||
crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
|
||||
cryptstate_T *state;
|
||||
char_u *key;
|
||||
char_u *salt UNUSED;
|
||||
int salt_len UNUSED;
|
||||
char_u *seed UNUSED;
|
||||
int seed_len UNUSED;
|
||||
crypt_zip_init(
|
||||
cryptstate_T *state,
|
||||
char_u *key,
|
||||
char_u *salt UNUSED,
|
||||
int salt_len UNUSED,
|
||||
char_u *seed UNUSED,
|
||||
int seed_len UNUSED)
|
||||
{
|
||||
char_u *p;
|
||||
zip_state_T *zs;
|
||||
@@ -114,11 +114,11 @@ crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
|
||||
* "from" and "to" can be equal to encrypt in place.
|
||||
*/
|
||||
void
|
||||
crypt_zip_encode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_zip_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
zip_state_T *zs = state->method_state;
|
||||
size_t i;
|
||||
@@ -137,11 +137,11 @@ crypt_zip_encode(state, from, len, to)
|
||||
* Decrypt "from[len]" into "to[len]".
|
||||
*/
|
||||
void
|
||||
crypt_zip_decode(state, from, len, to)
|
||||
cryptstate_T *state;
|
||||
char_u *from;
|
||||
size_t len;
|
||||
char_u *to;
|
||||
crypt_zip_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
{
|
||||
zip_state_T *zs = state->method_state;
|
||||
size_t i;
|
||||
|
||||
+71
-115
@@ -60,8 +60,7 @@ static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp);
|
||||
* Called when deleting or unloading a buffer: No longer make a diff with it.
|
||||
*/
|
||||
void
|
||||
diff_buf_delete(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_delete(buf_T *buf)
|
||||
{
|
||||
int i;
|
||||
tabpage_T *tp;
|
||||
@@ -84,8 +83,7 @@ diff_buf_delete(buf)
|
||||
* diff buffers.
|
||||
*/
|
||||
void
|
||||
diff_buf_adjust(win)
|
||||
win_T *win;
|
||||
diff_buf_adjust(win_T *win)
|
||||
{
|
||||
win_T *wp;
|
||||
int i;
|
||||
@@ -121,8 +119,7 @@ diff_buf_adjust(win)
|
||||
* about the screen contents.
|
||||
*/
|
||||
void
|
||||
diff_buf_add(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_add(buf_T *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -146,8 +143,7 @@ diff_buf_add(buf)
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
diff_buf_idx(buf)
|
||||
buf_T *buf;
|
||||
diff_buf_idx(buf_T *buf)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -162,9 +158,7 @@ diff_buf_idx(buf)
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
diff_buf_idx_tp(buf, tp)
|
||||
buf_T *buf;
|
||||
tabpage_T *tp;
|
||||
diff_buf_idx_tp(buf_T *buf, tabpage_T *tp)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -179,8 +173,7 @@ diff_buf_idx_tp(buf, tp)
|
||||
* when info is requested.
|
||||
*/
|
||||
void
|
||||
diff_invalidate(buf)
|
||||
buf_T *buf;
|
||||
diff_invalidate(buf_T *buf)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int i;
|
||||
@@ -201,11 +194,11 @@ diff_invalidate(buf)
|
||||
* Called by mark_adjust(): update line numbers in "curbuf".
|
||||
*/
|
||||
void
|
||||
diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
diff_mark_adjust(
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
int idx;
|
||||
tabpage_T *tp;
|
||||
@@ -227,13 +220,13 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
* When inserting/deleting lines in existing change blocks, update them.
|
||||
*/
|
||||
static void
|
||||
diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after)
|
||||
tabpage_T *tp;
|
||||
int idx;
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
diff_mark_adjust_tp(
|
||||
tabpage_T *tp,
|
||||
int idx,
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
diff_T *dp;
|
||||
diff_T *dprev;
|
||||
@@ -479,10 +472,7 @@ diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after)
|
||||
* Allocate a new diff block and link it between "dprev" and "dp".
|
||||
*/
|
||||
static diff_T *
|
||||
diff_alloc_new(tp, dprev, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dprev;
|
||||
diff_T *dp;
|
||||
diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
|
||||
{
|
||||
diff_T *dnew;
|
||||
|
||||
@@ -505,9 +495,7 @@ diff_alloc_new(tp, dprev, dp)
|
||||
* must take care of removing it.
|
||||
*/
|
||||
static void
|
||||
diff_check_unchanged(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
diff_check_unchanged(tabpage_T *tp, diff_T *dp)
|
||||
{
|
||||
int i_org;
|
||||
int i_new;
|
||||
@@ -581,9 +569,7 @@ diff_check_unchanged(tp, dp)
|
||||
* This can happen when the diff program returns invalid results.
|
||||
*/
|
||||
static int
|
||||
diff_check_sanity(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
diff_check_sanity(tabpage_T *tp, diff_T *dp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -599,8 +585,8 @@ diff_check_sanity(tp, dp)
|
||||
* Mark all diff buffers in the current tab page for redraw.
|
||||
*/
|
||||
static void
|
||||
diff_redraw(dofold)
|
||||
int dofold; /* also recompute the folds */
|
||||
diff_redraw(
|
||||
int dofold) /* also recompute the folds */
|
||||
{
|
||||
win_T *wp;
|
||||
int n;
|
||||
@@ -633,9 +619,7 @@ diff_redraw(dofold)
|
||||
* Return FAIL for failure
|
||||
*/
|
||||
static int
|
||||
diff_write(buf, fname)
|
||||
buf_T *buf;
|
||||
char_u *fname;
|
||||
diff_write(buf_T *buf, char_u *fname)
|
||||
{
|
||||
int r;
|
||||
char_u *save_ff;
|
||||
@@ -656,8 +640,8 @@ diff_write(buf, fname)
|
||||
* could have been produced by autocommands, e.g. the netrw plugin).
|
||||
*/
|
||||
void
|
||||
ex_diffupdate(eap)
|
||||
exarg_T *eap UNUSED; /* can be NULL */
|
||||
ex_diffupdate(
|
||||
exarg_T *eap UNUSED) /* can be NULL */
|
||||
{
|
||||
buf_T *buf;
|
||||
int idx_orig;
|
||||
@@ -832,10 +816,10 @@ theend:
|
||||
* Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff".
|
||||
*/
|
||||
static void
|
||||
diff_file(tmp_orig, tmp_new, tmp_diff)
|
||||
char_u *tmp_orig;
|
||||
char_u *tmp_new;
|
||||
char_u *tmp_diff;
|
||||
diff_file(
|
||||
char_u *tmp_orig,
|
||||
char_u *tmp_new,
|
||||
char_u *tmp_diff)
|
||||
{
|
||||
char_u *cmd;
|
||||
size_t len;
|
||||
@@ -888,8 +872,7 @@ diff_file(tmp_orig, tmp_new, tmp_diff)
|
||||
* could have been produced by autocommands, e.g. the netrw plugin).
|
||||
*/
|
||||
void
|
||||
ex_diffpatch(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffpatch(exarg_T *eap)
|
||||
{
|
||||
char_u *tmp_orig; /* name of original temp file */
|
||||
char_u *tmp_new; /* name of patched temp file */
|
||||
@@ -1083,8 +1066,7 @@ theend:
|
||||
* Split the window and edit another file, setting options to show the diffs.
|
||||
*/
|
||||
void
|
||||
ex_diffsplit(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffsplit(exarg_T *eap)
|
||||
{
|
||||
win_T *old_curwin = curwin;
|
||||
buf_T *old_curbuf = curbuf;
|
||||
@@ -1126,8 +1108,7 @@ ex_diffsplit(eap)
|
||||
* Set options to show diffs for the current window.
|
||||
*/
|
||||
void
|
||||
ex_diffthis(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_diffthis(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
|
||||
diff_win_options(curwin, TRUE);
|
||||
@@ -1137,9 +1118,9 @@ ex_diffthis(eap)
|
||||
* Set options in window "wp" for diff mode.
|
||||
*/
|
||||
void
|
||||
diff_win_options(wp, addbuf)
|
||||
win_T *wp;
|
||||
int addbuf; /* Add buffer to diff. */
|
||||
diff_win_options(
|
||||
win_T *wp,
|
||||
int addbuf) /* Add buffer to diff. */
|
||||
{
|
||||
# ifdef FEAT_FOLDING
|
||||
win_T *old_curwin = curwin;
|
||||
@@ -1209,8 +1190,7 @@ diff_win_options(wp, addbuf)
|
||||
* Only in the current tab page.
|
||||
*/
|
||||
void
|
||||
ex_diffoff(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffoff(exarg_T *eap)
|
||||
{
|
||||
win_T *wp;
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
@@ -1279,10 +1259,10 @@ ex_diffoff(eap)
|
||||
* Read the diff output and add each entry to the diff list.
|
||||
*/
|
||||
static void
|
||||
diff_read(idx_orig, idx_new, fname)
|
||||
int idx_orig; /* idx of original file */
|
||||
int idx_new; /* idx of new file */
|
||||
char_u *fname; /* name of diff output file */
|
||||
diff_read(
|
||||
int idx_orig, /* idx of original file */
|
||||
int idx_new, /* idx of new file */
|
||||
char_u *fname) /* name of diff output file */
|
||||
{
|
||||
FILE *fd;
|
||||
diff_T *dprev = NULL;
|
||||
@@ -1473,11 +1453,11 @@ done:
|
||||
* Copy an entry at "dp" from "idx_orig" to "idx_new".
|
||||
*/
|
||||
static void
|
||||
diff_copy_entry(dprev, dp, idx_orig, idx_new)
|
||||
diff_T *dprev;
|
||||
diff_T *dp;
|
||||
int idx_orig;
|
||||
int idx_new;
|
||||
diff_copy_entry(
|
||||
diff_T *dprev,
|
||||
diff_T *dp,
|
||||
int idx_orig,
|
||||
int idx_new)
|
||||
{
|
||||
long off;
|
||||
|
||||
@@ -1494,8 +1474,7 @@ diff_copy_entry(dprev, dp, idx_orig, idx_new)
|
||||
* Clear the list of diffblocks for tab page "tp".
|
||||
*/
|
||||
void
|
||||
diff_clear(tp)
|
||||
tabpage_T *tp;
|
||||
diff_clear(tabpage_T *tp)
|
||||
{
|
||||
diff_T *p, *next_p;
|
||||
|
||||
@@ -1517,9 +1496,7 @@ diff_clear(tp)
|
||||
* This should only be used for windows where 'diff' is set.
|
||||
*/
|
||||
int
|
||||
diff_check(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_check(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int idx; /* index in tp_diffbuf[] for this buffer */
|
||||
diff_T *dp;
|
||||
@@ -1611,10 +1588,7 @@ diff_check(wp, lnum)
|
||||
* Compare two entries in diff "*dp" and return TRUE if they are equal.
|
||||
*/
|
||||
static int
|
||||
diff_equal_entry(dp, idx1, idx2)
|
||||
diff_T *dp;
|
||||
int idx1;
|
||||
int idx2;
|
||||
diff_equal_entry(diff_T *dp, int idx1, int idx2)
|
||||
{
|
||||
int i;
|
||||
char_u *line;
|
||||
@@ -1644,9 +1618,7 @@ diff_equal_entry(dp, idx1, idx2)
|
||||
* Return non-zero when they are different.
|
||||
*/
|
||||
static int
|
||||
diff_cmp(s1, s2)
|
||||
char_u *s1;
|
||||
char_u *s2;
|
||||
diff_cmp(char_u *s1, char_u *s2)
|
||||
{
|
||||
char_u *p1, *p2;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -1709,9 +1681,7 @@ diff_cmp(s1, s2)
|
||||
* Return the number of filler lines above "lnum".
|
||||
*/
|
||||
int
|
||||
diff_check_fill(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_check_fill(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -1729,9 +1699,7 @@ diff_check_fill(wp, lnum)
|
||||
* show the same diff'ed lines.
|
||||
*/
|
||||
void
|
||||
diff_set_topline(fromwin, towin)
|
||||
win_T *fromwin;
|
||||
win_T *towin;
|
||||
diff_set_topline(win_T *fromwin, win_T *towin)
|
||||
{
|
||||
buf_T *frombuf = fromwin->w_buffer;
|
||||
linenr_T lnum = fromwin->w_topline;
|
||||
@@ -1851,7 +1819,7 @@ diff_set_topline(fromwin, towin)
|
||||
* This is called when 'diffopt' is changed.
|
||||
*/
|
||||
int
|
||||
diffopt_changed()
|
||||
diffopt_changed(void)
|
||||
{
|
||||
char_u *p;
|
||||
int diff_context_new = 6;
|
||||
@@ -1929,7 +1897,7 @@ diffopt_changed()
|
||||
* Return TRUE if 'diffopt' contains "horizontal".
|
||||
*/
|
||||
int
|
||||
diffopt_horizontal()
|
||||
diffopt_horizontal(void)
|
||||
{
|
||||
return (diff_flags & DIFF_HORIZONTAL) != 0;
|
||||
}
|
||||
@@ -1939,11 +1907,11 @@ diffopt_horizontal()
|
||||
* Returns TRUE if the line was added, no other buffer has it.
|
||||
*/
|
||||
int
|
||||
diff_find_change(wp, lnum, startp, endp)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
int *startp; /* first char of the change */
|
||||
int *endp; /* last char of the change */
|
||||
diff_find_change(
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
int *startp, /* first char of the change */
|
||||
int *endp) /* last char of the change */
|
||||
{
|
||||
char_u *line_org;
|
||||
char_u *line_new;
|
||||
@@ -2063,9 +2031,7 @@ diff_find_change(wp, lnum, startp, endp)
|
||||
* Return FALSE if there are no diff blocks at all in this window.
|
||||
*/
|
||||
int
|
||||
diff_infold(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
diff_infold(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
int i;
|
||||
int idx = -1;
|
||||
@@ -2112,9 +2078,7 @@ diff_infold(wp, lnum)
|
||||
* "dp" and "do" commands.
|
||||
*/
|
||||
void
|
||||
nv_diffgetput(put, count)
|
||||
int put;
|
||||
long count;
|
||||
nv_diffgetput(int put, long count)
|
||||
{
|
||||
exarg_T ea;
|
||||
char_u buf[30];
|
||||
@@ -2141,8 +2105,7 @@ nv_diffgetput(put, count)
|
||||
* ":diffput"
|
||||
*/
|
||||
void
|
||||
ex_diffgetput(eap)
|
||||
exarg_T *eap;
|
||||
ex_diffgetput(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int count;
|
||||
@@ -2464,9 +2427,7 @@ ex_diffgetput(eap)
|
||||
* When there are no diffs, all folds are removed.
|
||||
*/
|
||||
static void
|
||||
diff_fold_update(dp, skip_idx)
|
||||
diff_T *dp;
|
||||
int skip_idx;
|
||||
diff_fold_update(diff_T *dp, int skip_idx)
|
||||
{
|
||||
int i;
|
||||
win_T *wp;
|
||||
@@ -2483,8 +2444,7 @@ diff_fold_update(dp, skip_idx)
|
||||
* Return TRUE if buffer "buf" is in diff-mode.
|
||||
*/
|
||||
int
|
||||
diff_mode_buf(buf)
|
||||
buf_T *buf;
|
||||
diff_mode_buf(buf_T *buf)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
|
||||
@@ -2499,9 +2459,7 @@ diff_mode_buf(buf)
|
||||
* Return FAIL if there isn't such a diff block.
|
||||
*/
|
||||
int
|
||||
diff_move_to(dir, count)
|
||||
int dir;
|
||||
long count;
|
||||
diff_move_to(int dir, long count)
|
||||
{
|
||||
int idx;
|
||||
linenr_T lnum = curwin->w_cursor.lnum;
|
||||
@@ -2554,11 +2512,11 @@ diff_move_to(dir, count)
|
||||
}
|
||||
|
||||
linenr_T
|
||||
diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
||||
buf_T *buf1;
|
||||
linenr_T lnum1;
|
||||
buf_T *buf2;
|
||||
linenr_T lnum3;
|
||||
diff_get_corresponding_line(
|
||||
buf_T *buf1,
|
||||
linenr_T lnum1,
|
||||
buf_T *buf2,
|
||||
linenr_T lnum3)
|
||||
{
|
||||
int idx1;
|
||||
int idx2;
|
||||
@@ -2628,9 +2586,7 @@ diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
||||
* "wp", compensating for inserted/deleted lines.
|
||||
*/
|
||||
linenr_T
|
||||
diff_lnum_win(lnum, wp)
|
||||
linenr_T lnum;
|
||||
win_T *wp;
|
||||
diff_lnum_win(linenr_T lnum, win_T *wp)
|
||||
{
|
||||
diff_T *dp;
|
||||
int idx;
|
||||
|
||||
+11
-21
@@ -2013,8 +2013,7 @@ static digr_T digraphdefault[] =
|
||||
* handle digraphs after typing a character
|
||||
*/
|
||||
int
|
||||
do_digraph(c)
|
||||
int c;
|
||||
do_digraph(int c)
|
||||
{
|
||||
static int backspaced; /* character before K_BS */
|
||||
static int lastchar; /* last typed character */
|
||||
@@ -2041,8 +2040,8 @@ do_digraph(c)
|
||||
* Returns composed character, or NUL when ESC was used.
|
||||
*/
|
||||
int
|
||||
get_digraph(cmdline)
|
||||
int cmdline; /* TRUE when called from the cmdline */
|
||||
get_digraph(
|
||||
int cmdline) /* TRUE when called from the cmdline */
|
||||
{
|
||||
int c, cc;
|
||||
|
||||
@@ -2085,10 +2084,7 @@ get_digraph(cmdline)
|
||||
* If "meta_char" is TRUE and "char1" is a space, return "char2" | 0x80.
|
||||
*/
|
||||
static int
|
||||
getexactdigraph(char1, char2, meta_char)
|
||||
int char1;
|
||||
int char2;
|
||||
int meta_char;
|
||||
getexactdigraph(int char1, int char2, int meta_char)
|
||||
{
|
||||
int i;
|
||||
int retval = 0;
|
||||
@@ -2173,10 +2169,7 @@ getexactdigraph(char1, char2, meta_char)
|
||||
* Allow for both char1-char2 and char2-char1
|
||||
*/
|
||||
int
|
||||
getdigraph(char1, char2, meta_char)
|
||||
int char1;
|
||||
int char2;
|
||||
int meta_char;
|
||||
getdigraph(int char1, int char2, int meta_char)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -2192,8 +2185,7 @@ getdigraph(char1, char2, meta_char)
|
||||
* format: {c1}{c2} char {c1}{c2} char ...
|
||||
*/
|
||||
void
|
||||
putdigraph(str)
|
||||
char_u *str;
|
||||
putdigraph(char_u *str)
|
||||
{
|
||||
int char1, char2, n;
|
||||
int i;
|
||||
@@ -2252,7 +2244,7 @@ putdigraph(str)
|
||||
}
|
||||
|
||||
void
|
||||
listdigraphs()
|
||||
listdigraphs(void)
|
||||
{
|
||||
int i;
|
||||
digr_T *dp;
|
||||
@@ -2297,8 +2289,7 @@ listdigraphs()
|
||||
}
|
||||
|
||||
static void
|
||||
printdigraph(dp)
|
||||
digr_T *dp;
|
||||
printdigraph(digr_T *dp)
|
||||
{
|
||||
char_u buf[30];
|
||||
char_u *p;
|
||||
@@ -2366,7 +2357,7 @@ static void keymap_unload(void);
|
||||
* checked.
|
||||
*/
|
||||
char_u *
|
||||
keymap_init()
|
||||
keymap_init(void)
|
||||
{
|
||||
curbuf->b_kmap_state &= ~KEYMAP_INIT;
|
||||
|
||||
@@ -2419,8 +2410,7 @@ keymap_init()
|
||||
* ":loadkeymap" command: load the following lines as the keymap.
|
||||
*/
|
||||
void
|
||||
ex_loadkeymap(eap)
|
||||
exarg_T *eap;
|
||||
ex_loadkeymap(exarg_T *eap)
|
||||
{
|
||||
char_u *line;
|
||||
char_u *p;
|
||||
@@ -2505,7 +2495,7 @@ ex_loadkeymap(eap)
|
||||
* Stop using 'keymap'.
|
||||
*/
|
||||
static void
|
||||
keymap_unload()
|
||||
keymap_unload(void)
|
||||
{
|
||||
char_u buf[KMAP_MAXLEN + 10];
|
||||
int i;
|
||||
|
||||
+1
-1
@@ -452,7 +452,7 @@ run_command(char *cmd)
|
||||
/*
|
||||
* Append a backslash to "name" if there isn't one yet.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
add_pathsep(char *name)
|
||||
{
|
||||
int len = strlen(name);
|
||||
|
||||
+230
-289
File diff suppressed because it is too large
Load Diff
+2073
-2284
File diff suppressed because it is too large
Load Diff
+166
-230
@@ -18,9 +18,7 @@
|
||||
# include <float.h>
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
static int linelen(int *has_tab);
|
||||
#endif
|
||||
static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
|
||||
#ifdef FEAT_VIMINFO
|
||||
static char_u *viminfo_filename(char_u *);
|
||||
@@ -44,8 +42,7 @@ static void prepare_help_buffer(void);
|
||||
* ":ascii" and "ga".
|
||||
*/
|
||||
void
|
||||
do_ascii(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
do_ascii(exarg_T *eap UNUSED)
|
||||
{
|
||||
int c;
|
||||
int cval;
|
||||
@@ -139,13 +136,11 @@ do_ascii(eap)
|
||||
msg(IObuff);
|
||||
}
|
||||
|
||||
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
|
||||
/*
|
||||
* ":left", ":center" and ":right": align text.
|
||||
*/
|
||||
void
|
||||
ex_align(eap)
|
||||
exarg_T *eap;
|
||||
ex_align(exarg_T *eap)
|
||||
{
|
||||
pos_T save_curpos;
|
||||
int len;
|
||||
@@ -247,8 +242,7 @@ ex_align(eap)
|
||||
* Get the length of the current line, excluding trailing white space.
|
||||
*/
|
||||
static int
|
||||
linelen(has_tab)
|
||||
int *has_tab;
|
||||
linelen(int *has_tab)
|
||||
{
|
||||
char_u *line;
|
||||
char_u *first;
|
||||
@@ -315,9 +309,7 @@ sort_compare(const void *s1, const void *s2);
|
||||
#ifdef __BORLANDC__
|
||||
_RTLENTRYF
|
||||
#endif
|
||||
sort_compare(s1, s2)
|
||||
const void *s1;
|
||||
const void *s2;
|
||||
sort_compare(const void *s1, const void *s2)
|
||||
{
|
||||
sorti_T l1 = *(sorti_T *)s1;
|
||||
sorti_T l2 = *(sorti_T *)s2;
|
||||
@@ -368,8 +360,7 @@ sort_compare(s1, s2)
|
||||
* ":sort".
|
||||
*/
|
||||
void
|
||||
ex_sort(eap)
|
||||
exarg_T *eap;
|
||||
ex_sort(exarg_T *eap)
|
||||
{
|
||||
regmatch_T regmatch;
|
||||
int len;
|
||||
@@ -526,7 +517,11 @@ ex_sort(eap)
|
||||
if (regmatch.regprog != NULL)
|
||||
end_col = 0;
|
||||
|
||||
if (sort_nr || sort_flt)
|
||||
if (sort_nr
|
||||
#ifdef FEAT_FLOAT
|
||||
|| sort_flt
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* Make sure vim_str2nr doesn't read any digits past the end
|
||||
* of the match, by temporarily terminating the string there */
|
||||
@@ -648,8 +643,7 @@ sortend:
|
||||
* ":retab".
|
||||
*/
|
||||
void
|
||||
ex_retab(eap)
|
||||
exarg_T *eap;
|
||||
ex_retab(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int got_tab = FALSE;
|
||||
@@ -790,7 +784,6 @@ ex_retab(eap)
|
||||
|
||||
u_clearline();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* :move command - move lines line1-line2 to line dest
|
||||
@@ -798,10 +791,7 @@ ex_retab(eap)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
do_move(line1, line2, dest)
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
linenr_T dest;
|
||||
do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
{
|
||||
char_u *str;
|
||||
linenr_T l;
|
||||
@@ -929,10 +919,7 @@ do_move(line1, line2, dest)
|
||||
* ":copy"
|
||||
*/
|
||||
void
|
||||
ex_copy(line1, line2, n)
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
linenr_T n;
|
||||
ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
|
||||
{
|
||||
linenr_T count;
|
||||
char_u *p;
|
||||
@@ -987,7 +974,7 @@ static char_u *prevcmd = NULL; /* the previous command */
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
free_prev_shellcmd()
|
||||
free_prev_shellcmd(void)
|
||||
{
|
||||
vim_free(prevcmd);
|
||||
}
|
||||
@@ -999,11 +986,12 @@ free_prev_shellcmd()
|
||||
* Remember the argument.
|
||||
*/
|
||||
void
|
||||
do_bang(addr_count, eap, forceit, do_in, do_out)
|
||||
int addr_count;
|
||||
exarg_T *eap;
|
||||
int forceit;
|
||||
int do_in, do_out;
|
||||
do_bang(
|
||||
int addr_count,
|
||||
exarg_T *eap,
|
||||
int forceit,
|
||||
int do_in,
|
||||
int do_out)
|
||||
{
|
||||
char_u *arg = eap->arg; /* command */
|
||||
linenr_T line1 = eap->line1; /* start of range */
|
||||
@@ -1165,11 +1153,13 @@ do_bang(addr_count, eap, forceit, do_in, do_out)
|
||||
* We use output redirection if do_out is TRUE.
|
||||
*/
|
||||
static void
|
||||
do_filter(line1, line2, eap, cmd, do_in, do_out)
|
||||
linenr_T line1, line2;
|
||||
exarg_T *eap; /* for forced 'ff' and 'fenc' */
|
||||
char_u *cmd;
|
||||
int do_in, do_out;
|
||||
do_filter(
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
exarg_T *eap, /* for forced 'ff' and 'fenc' */
|
||||
char_u *cmd,
|
||||
int do_in,
|
||||
int do_out)
|
||||
{
|
||||
char_u *itmp = NULL;
|
||||
char_u *otmp = NULL;
|
||||
@@ -1445,9 +1435,9 @@ filterend:
|
||||
* When "cmd" is NULL start an interactive shell.
|
||||
*/
|
||||
void
|
||||
do_shell(cmd, flags)
|
||||
char_u *cmd;
|
||||
int flags; /* may be SHELL_DOOUT when output is redirected */
|
||||
do_shell(
|
||||
char_u *cmd,
|
||||
int flags) /* may be SHELL_DOOUT when output is redirected */
|
||||
{
|
||||
buf_T *buf;
|
||||
#ifndef FEAT_GUI_MSWIN
|
||||
@@ -1628,10 +1618,10 @@ do_shell(cmd, flags)
|
||||
* Returns an allocated string with the shell command, or NULL for failure.
|
||||
*/
|
||||
char_u *
|
||||
make_filter_cmd(cmd, itmp, otmp)
|
||||
char_u *cmd; /* command */
|
||||
char_u *itmp; /* NULL or name of input file */
|
||||
char_u *otmp; /* NULL or name of output file */
|
||||
make_filter_cmd(
|
||||
char_u *cmd, /* command */
|
||||
char_u *itmp, /* NULL or name of input file */
|
||||
char_u *otmp) /* NULL or name of output file */
|
||||
{
|
||||
char_u *buf;
|
||||
long_u len;
|
||||
@@ -1723,11 +1713,11 @@ make_filter_cmd(cmd, itmp, otmp)
|
||||
* STRLEN(opt) + STRLEN(fname) + 3
|
||||
*/
|
||||
void
|
||||
append_redir(buf, buflen, opt, fname)
|
||||
char_u *buf;
|
||||
int buflen;
|
||||
char_u *opt;
|
||||
char_u *fname;
|
||||
append_redir(
|
||||
char_u *buf,
|
||||
int buflen,
|
||||
char_u *opt,
|
||||
char_u *fname)
|
||||
{
|
||||
char_u *p;
|
||||
char_u *end;
|
||||
@@ -1764,7 +1754,7 @@ static void write_viminfo_barlines(vir_T *virp, FILE *fp_out);
|
||||
static int viminfo_errcnt;
|
||||
|
||||
static int
|
||||
no_viminfo()
|
||||
no_viminfo(void)
|
||||
{
|
||||
/* "vim -i NONE" does not read or write a viminfo file */
|
||||
return (use_viminfo != NULL && STRCMP(use_viminfo, "NONE") == 0);
|
||||
@@ -1775,10 +1765,7 @@ no_viminfo()
|
||||
* Count the number of errors. When there are more than 10, return TRUE.
|
||||
*/
|
||||
int
|
||||
viminfo_error(errnum, message, line)
|
||||
char *errnum;
|
||||
char *message;
|
||||
char_u *line;
|
||||
viminfo_error(char *errnum, char *message, char_u *line)
|
||||
{
|
||||
vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "),
|
||||
errnum, message);
|
||||
@@ -1799,9 +1786,9 @@ viminfo_error(errnum, message, line)
|
||||
* set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
|
||||
*/
|
||||
int
|
||||
read_viminfo(file, flags)
|
||||
char_u *file; /* file name or NULL to use default name */
|
||||
int flags; /* VIF_WANT_INFO et al. */
|
||||
read_viminfo(
|
||||
char_u *file, /* file name or NULL to use default name */
|
||||
int flags) /* VIF_WANT_INFO et al. */
|
||||
{
|
||||
FILE *fp;
|
||||
char_u *fname;
|
||||
@@ -1845,9 +1832,7 @@ read_viminfo(file, flags)
|
||||
* info is written to the file.
|
||||
*/
|
||||
void
|
||||
write_viminfo(file, forceit)
|
||||
char_u *file;
|
||||
int forceit;
|
||||
write_viminfo(char_u *file, int forceit)
|
||||
{
|
||||
char_u *fname;
|
||||
FILE *fp_in = NULL; /* input viminfo file, if any */
|
||||
@@ -2120,8 +2105,7 @@ end:
|
||||
* Returns an allocated string. NULL when out of memory.
|
||||
*/
|
||||
static char_u *
|
||||
viminfo_filename(file)
|
||||
char_u *file;
|
||||
viminfo_filename(char_u *file)
|
||||
{
|
||||
if (file == NULL || *file == NUL)
|
||||
{
|
||||
@@ -2158,10 +2142,7 @@ viminfo_filename(file)
|
||||
* do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
|
||||
*/
|
||||
static void
|
||||
do_viminfo(fp_in, fp_out, flags)
|
||||
FILE *fp_in;
|
||||
FILE *fp_out;
|
||||
int flags;
|
||||
do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
|
||||
{
|
||||
int count = 0;
|
||||
int eof = FALSE;
|
||||
@@ -2232,10 +2213,10 @@ do_viminfo(fp_in, fp_out, flags)
|
||||
* are local to a file. Returns TRUE when end-of-file is reached. -- webb
|
||||
*/
|
||||
static int
|
||||
read_viminfo_up_to_marks(virp, forceit, writing)
|
||||
vir_T *virp;
|
||||
int forceit;
|
||||
int writing;
|
||||
read_viminfo_up_to_marks(
|
||||
vir_T *virp,
|
||||
int forceit,
|
||||
int writing)
|
||||
{
|
||||
int eof;
|
||||
buf_T *buf;
|
||||
@@ -2331,8 +2312,7 @@ read_viminfo_up_to_marks(virp, forceit, writing)
|
||||
* conversion of text with iconv() in viminfo_readstring().
|
||||
*/
|
||||
static int
|
||||
viminfo_encoding(virp)
|
||||
vir_T *virp;
|
||||
viminfo_encoding(vir_T *virp)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *p;
|
||||
@@ -2361,8 +2341,7 @@ viminfo_encoding(virp)
|
||||
* Returns TRUE for end-of-file;
|
||||
*/
|
||||
int
|
||||
viminfo_readline(virp)
|
||||
vir_T *virp;
|
||||
viminfo_readline(vir_T *virp)
|
||||
{
|
||||
return vim_fgets(virp->vir_line, LSIZE, virp->vir_fd);
|
||||
}
|
||||
@@ -2378,10 +2357,10 @@ viminfo_readline(virp)
|
||||
* Return the string in allocated memory (NULL when out of memory).
|
||||
*/
|
||||
char_u *
|
||||
viminfo_readstring(virp, off, convert)
|
||||
vir_T *virp;
|
||||
int off; /* offset for virp->vir_line */
|
||||
int convert UNUSED; /* convert the string */
|
||||
viminfo_readstring(
|
||||
vir_T *virp,
|
||||
int off, /* offset for virp->vir_line */
|
||||
int convert UNUSED) /* convert the string */
|
||||
{
|
||||
char_u *retval;
|
||||
char_u *s, *d;
|
||||
@@ -2451,9 +2430,7 @@ viminfo_readstring(virp, off, convert)
|
||||
* - write " < <string> \n " in second line
|
||||
*/
|
||||
void
|
||||
viminfo_writestring(fd, p)
|
||||
FILE *fd;
|
||||
char_u *p;
|
||||
viminfo_writestring(FILE *fd, char_u *p)
|
||||
{
|
||||
int c;
|
||||
char_u *s;
|
||||
@@ -2509,8 +2486,7 @@ write_viminfo_barlines(vir_T *virp, FILE *fp_out)
|
||||
* not ^? ^?
|
||||
*/
|
||||
void
|
||||
do_fixdel(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
do_fixdel(exarg_T *eap UNUSED)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -2520,10 +2496,10 @@ do_fixdel(eap)
|
||||
}
|
||||
|
||||
void
|
||||
print_line_no_prefix(lnum, use_number, list)
|
||||
linenr_T lnum;
|
||||
int use_number;
|
||||
int list;
|
||||
print_line_no_prefix(
|
||||
linenr_T lnum,
|
||||
int use_number,
|
||||
int list)
|
||||
{
|
||||
char_u numbuf[30];
|
||||
|
||||
@@ -2540,10 +2516,7 @@ print_line_no_prefix(lnum, use_number, list)
|
||||
* Print a text line. Also in silent mode ("ex -s").
|
||||
*/
|
||||
void
|
||||
print_line(lnum, use_number, list)
|
||||
linenr_T lnum;
|
||||
int use_number;
|
||||
int list;
|
||||
print_line(linenr_T lnum, int use_number, int list)
|
||||
{
|
||||
int save_silent = silent_mode;
|
||||
|
||||
@@ -2562,8 +2535,7 @@ print_line(lnum, use_number, list)
|
||||
}
|
||||
|
||||
int
|
||||
rename_buffer(new_fname)
|
||||
char_u *new_fname;
|
||||
rename_buffer(char_u *new_fname)
|
||||
{
|
||||
char_u *fname, *sfname, *xfname;
|
||||
buf_T *buf;
|
||||
@@ -2618,8 +2590,7 @@ rename_buffer(new_fname)
|
||||
* ":file[!] [fname]".
|
||||
*/
|
||||
void
|
||||
ex_file(eap)
|
||||
exarg_T *eap;
|
||||
ex_file(exarg_T *eap)
|
||||
{
|
||||
/* ":0file" removes the file name. Check for illegal uses ":3file",
|
||||
* "0file name", etc. */
|
||||
@@ -2645,8 +2616,7 @@ ex_file(eap)
|
||||
* ":update".
|
||||
*/
|
||||
void
|
||||
ex_update(eap)
|
||||
exarg_T *eap;
|
||||
ex_update(exarg_T *eap)
|
||||
{
|
||||
if (curbufIsChanged())
|
||||
(void)do_write(eap);
|
||||
@@ -2656,8 +2626,7 @@ ex_update(eap)
|
||||
* ":write" and ":saveas".
|
||||
*/
|
||||
void
|
||||
ex_write(eap)
|
||||
exarg_T *eap;
|
||||
ex_write(exarg_T *eap)
|
||||
{
|
||||
if (eap->usefilter) /* input lines to shell command */
|
||||
do_bang(1, eap, FALSE, TRUE, FALSE);
|
||||
@@ -2674,8 +2643,7 @@ ex_write(eap)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
do_write(eap)
|
||||
exarg_T *eap;
|
||||
do_write(exarg_T *eap)
|
||||
{
|
||||
int other;
|
||||
char_u *fname = NULL; /* init to shut up gcc */
|
||||
@@ -2886,13 +2854,13 @@ theend:
|
||||
* Return OK if it's OK, FAIL if it is not.
|
||||
*/
|
||||
int
|
||||
check_overwrite(eap, buf, fname, ffname, other)
|
||||
exarg_T *eap;
|
||||
buf_T *buf;
|
||||
char_u *fname; /* file name to be used (can differ from
|
||||
check_overwrite(
|
||||
exarg_T *eap,
|
||||
buf_T *buf,
|
||||
char_u *fname, /* file name to be used (can differ from
|
||||
buf->ffname) */
|
||||
char_u *ffname; /* full path version of fname */
|
||||
int other; /* writing under other name */
|
||||
char_u *ffname, /* full path version of fname */
|
||||
int other) /* writing under other name */
|
||||
{
|
||||
/*
|
||||
* write to other file or b_flags set or not writing the whole file:
|
||||
@@ -3005,8 +2973,7 @@ check_overwrite(eap, buf, fname, ffname, other)
|
||||
* Handle ":wnext", ":wNext" and ":wprevious" commands.
|
||||
*/
|
||||
void
|
||||
ex_wnext(eap)
|
||||
exarg_T *eap;
|
||||
ex_wnext(exarg_T *eap)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -3024,8 +2991,7 @@ ex_wnext(eap)
|
||||
* ":wall", ":wqall" and ":xall": Write all changed files (and exit).
|
||||
*/
|
||||
void
|
||||
do_wqall(eap)
|
||||
exarg_T *eap;
|
||||
do_wqall(exarg_T *eap)
|
||||
{
|
||||
buf_T *buf;
|
||||
int error = 0;
|
||||
@@ -3092,7 +3058,7 @@ do_wqall(eap)
|
||||
* Return TRUE and give a message when it's not st.
|
||||
*/
|
||||
int
|
||||
not_writing()
|
||||
not_writing(void)
|
||||
{
|
||||
if (p_write)
|
||||
return FALSE;
|
||||
@@ -3106,9 +3072,7 @@ not_writing()
|
||||
* message when the buffer is readonly.
|
||||
*/
|
||||
static int
|
||||
check_readonly(forceit, buf)
|
||||
int *forceit;
|
||||
buf_T *buf;
|
||||
check_readonly(int *forceit, buf_T *buf)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
@@ -3163,13 +3127,13 @@ check_readonly(forceit, buf)
|
||||
* 'lnum' is the line number for the cursor in the new file (if non-zero).
|
||||
*/
|
||||
int
|
||||
getfile(fnum, ffname, sfname, setpm, lnum, forceit)
|
||||
int fnum;
|
||||
char_u *ffname;
|
||||
char_u *sfname;
|
||||
int setpm;
|
||||
linenr_T lnum;
|
||||
int forceit;
|
||||
getfile(
|
||||
int fnum,
|
||||
char_u *ffname,
|
||||
char_u *sfname,
|
||||
int setpm,
|
||||
linenr_T lnum,
|
||||
int forceit)
|
||||
{
|
||||
int other;
|
||||
int retval;
|
||||
@@ -3264,14 +3228,14 @@ theend:
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
int fnum;
|
||||
char_u *ffname;
|
||||
char_u *sfname;
|
||||
exarg_T *eap; /* can be NULL! */
|
||||
linenr_T newlnum;
|
||||
int flags;
|
||||
win_T *oldwin;
|
||||
do_ecmd(
|
||||
int fnum,
|
||||
char_u *ffname,
|
||||
char_u *sfname,
|
||||
exarg_T *eap, /* can be NULL! */
|
||||
linenr_T newlnum,
|
||||
int flags,
|
||||
win_T *oldwin)
|
||||
{
|
||||
int other_file; /* TRUE if editing another file */
|
||||
int oldbuf; /* TRUE if using existing buffer */
|
||||
@@ -3304,6 +3268,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
int did_get_winopts = FALSE;
|
||||
#endif
|
||||
int readfile_flags = 0;
|
||||
int did_inc_redrawing_disabled = FALSE;
|
||||
|
||||
if (eap != NULL)
|
||||
command = eap->do_ecmd_cmd;
|
||||
@@ -3636,6 +3601,11 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
oldbuf = (flags & ECMD_OLDBUF);
|
||||
}
|
||||
|
||||
/* Don't redraw until the cursor is in the right line, otherwise
|
||||
* autocommands may cause ml_get errors. */
|
||||
++RedrawingDisabled;
|
||||
did_inc_redrawing_disabled = TRUE;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
buf = curbuf;
|
||||
#endif
|
||||
@@ -3733,9 +3703,6 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
/*
|
||||
* If we get here we are sure to start editing
|
||||
*/
|
||||
/* don't redraw until the cursor is in the right line */
|
||||
++RedrawingDisabled;
|
||||
|
||||
/* Assume success now */
|
||||
retval = OK;
|
||||
|
||||
@@ -3935,6 +3902,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
#endif
|
||||
|
||||
--RedrawingDisabled;
|
||||
did_inc_redrawing_disabled = FALSE;
|
||||
if (!skip_redraw)
|
||||
{
|
||||
n = p_so;
|
||||
@@ -3969,6 +3937,8 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
#endif
|
||||
|
||||
theend:
|
||||
if (did_inc_redrawing_disabled)
|
||||
--RedrawingDisabled;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (did_set_swapcommand)
|
||||
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
|
||||
@@ -3982,8 +3952,7 @@ theend:
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static void
|
||||
delbuf_msg(name)
|
||||
char_u *name;
|
||||
delbuf_msg(char_u *name)
|
||||
{
|
||||
EMSG2(_("E143: Autocommands unexpectedly deleted new buffer %s"),
|
||||
name == NULL ? (char_u *)"" : name);
|
||||
@@ -3998,8 +3967,7 @@ static int append_indent = 0; /* autoindent for first line */
|
||||
* ":insert" and ":append", also used by ":change"
|
||||
*/
|
||||
void
|
||||
ex_append(eap)
|
||||
exarg_T *eap;
|
||||
ex_append(exarg_T *eap)
|
||||
{
|
||||
char_u *theline;
|
||||
int did_undo = FALSE;
|
||||
@@ -4143,8 +4111,7 @@ ex_append(eap)
|
||||
* ":change"
|
||||
*/
|
||||
void
|
||||
ex_change(eap)
|
||||
exarg_T *eap;
|
||||
ex_change(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
|
||||
@@ -4173,8 +4140,7 @@ ex_change(eap)
|
||||
}
|
||||
|
||||
void
|
||||
ex_z(eap)
|
||||
exarg_T *eap;
|
||||
ex_z(exarg_T *eap)
|
||||
{
|
||||
char_u *x;
|
||||
int bigness;
|
||||
@@ -4304,7 +4270,7 @@ ex_z(eap)
|
||||
* Otherwise, return FALSE.
|
||||
*/
|
||||
int
|
||||
check_restricted()
|
||||
check_restricted(void)
|
||||
{
|
||||
if (restricted)
|
||||
{
|
||||
@@ -4320,7 +4286,7 @@ check_restricted()
|
||||
* Otherwise, return FALSE.
|
||||
*/
|
||||
int
|
||||
check_secure()
|
||||
check_secure(void)
|
||||
{
|
||||
if (secure)
|
||||
{
|
||||
@@ -4355,8 +4321,7 @@ static int global_need_beginline; /* call beginline() after ":g" */
|
||||
* The usual escapes are supported as described in the regexp docs.
|
||||
*/
|
||||
void
|
||||
do_sub(eap)
|
||||
exarg_T *eap;
|
||||
do_sub(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
long i = 0;
|
||||
@@ -5434,8 +5399,8 @@ outofmem:
|
||||
* Return TRUE if a message was given.
|
||||
*/
|
||||
int
|
||||
do_sub_msg(count_only)
|
||||
int count_only; /* used 'n' flag for ":s" */
|
||||
do_sub_msg(
|
||||
int count_only) /* used 'n' flag for ":s" */
|
||||
{
|
||||
/*
|
||||
* Only report substitutions when:
|
||||
@@ -5494,8 +5459,7 @@ do_sub_msg(count_only)
|
||||
* lines we do not know where to search for the next match.
|
||||
*/
|
||||
void
|
||||
ex_global(eap)
|
||||
exarg_T *eap;
|
||||
ex_global(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum; /* line number according to old situation */
|
||||
int ndone = 0;
|
||||
@@ -5615,8 +5579,7 @@ ex_global(eap)
|
||||
* Execute "cmd" on lines marked with ml_setmarked().
|
||||
*/
|
||||
void
|
||||
global_exe(cmd)
|
||||
char_u *cmd;
|
||||
global_exe(char_u *cmd)
|
||||
{
|
||||
linenr_T old_lcount; /* b_ml.ml_line_count before the command */
|
||||
buf_T *old_buf = curbuf; /* remember what buffer we started in */
|
||||
@@ -5673,9 +5636,7 @@ global_exe(cmd)
|
||||
|
||||
#ifdef FEAT_VIMINFO
|
||||
int
|
||||
read_viminfo_sub_string(virp, force)
|
||||
vir_T *virp;
|
||||
int force;
|
||||
read_viminfo_sub_string(vir_T *virp, int force)
|
||||
{
|
||||
if (force)
|
||||
vim_free(old_sub);
|
||||
@@ -5685,8 +5646,7 @@ read_viminfo_sub_string(virp, force)
|
||||
}
|
||||
|
||||
void
|
||||
write_viminfo_sub_string(fp)
|
||||
FILE *fp;
|
||||
write_viminfo_sub_string(FILE *fp)
|
||||
{
|
||||
if (get_viminfo_parameter('/') != 0 && old_sub != NULL)
|
||||
{
|
||||
@@ -5698,7 +5658,7 @@ write_viminfo_sub_string(fp)
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
free_old_sub()
|
||||
free_old_sub(void)
|
||||
{
|
||||
vim_free(old_sub);
|
||||
}
|
||||
@@ -5710,8 +5670,8 @@ free_old_sub()
|
||||
* Return TRUE when it was created.
|
||||
*/
|
||||
int
|
||||
prepare_tagpreview(undo_sync)
|
||||
int undo_sync; /* sync undo when leaving the window */
|
||||
prepare_tagpreview(
|
||||
int undo_sync) /* sync undo when leaving the window */
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
@@ -5760,8 +5720,7 @@ prepare_tagpreview(undo_sync)
|
||||
* ":help": open a read-only window on a help file
|
||||
*/
|
||||
void
|
||||
ex_help(eap)
|
||||
exarg_T *eap;
|
||||
ex_help(exarg_T *eap)
|
||||
{
|
||||
char_u *arg;
|
||||
char_u *tag;
|
||||
@@ -5978,8 +5937,7 @@ erret:
|
||||
* ":helpclose": Close one help window
|
||||
*/
|
||||
void
|
||||
ex_helpclose(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_helpclose(exarg_T *eap UNUSED)
|
||||
{
|
||||
#if defined(FEAT_WINDOWS)
|
||||
win_T *win;
|
||||
@@ -6002,8 +5960,7 @@ ex_helpclose(eap)
|
||||
* Returns NULL if not found.
|
||||
*/
|
||||
char_u *
|
||||
check_help_lang(arg)
|
||||
char_u *arg;
|
||||
check_help_lang(char_u *arg)
|
||||
{
|
||||
int len = (int)STRLEN(arg);
|
||||
|
||||
@@ -6029,10 +5986,10 @@ check_help_lang(arg)
|
||||
* match some string for which help is requested. webb.
|
||||
*/
|
||||
int
|
||||
help_heuristic(matched_string, offset, wrong_case)
|
||||
char_u *matched_string;
|
||||
int offset; /* offset for match */
|
||||
int wrong_case; /* no matching case */
|
||||
help_heuristic(
|
||||
char_u *matched_string,
|
||||
int offset, /* offset for match */
|
||||
int wrong_case) /* no matching case */
|
||||
{
|
||||
int num_letters;
|
||||
char_u *p;
|
||||
@@ -6073,9 +6030,7 @@ help_heuristic(matched_string, offset, wrong_case)
|
||||
#ifdef __BORLANDC__
|
||||
_RTLENTRYF
|
||||
#endif
|
||||
help_compare(s1, s2)
|
||||
const void *s1;
|
||||
const void *s2;
|
||||
help_compare(const void *s1, const void *s2)
|
||||
{
|
||||
char *p1;
|
||||
char *p2;
|
||||
@@ -6092,11 +6047,11 @@ help_compare(s1, s2)
|
||||
* When "keep_lang" is TRUE try keeping the language of the current buffer.
|
||||
*/
|
||||
int
|
||||
find_help_tags(arg, num_matches, matches, keep_lang)
|
||||
char_u *arg;
|
||||
int *num_matches;
|
||||
char_u ***matches;
|
||||
int keep_lang;
|
||||
find_help_tags(
|
||||
char_u *arg,
|
||||
int *num_matches,
|
||||
char_u ***matches,
|
||||
int keep_lang)
|
||||
{
|
||||
char_u *s, *d;
|
||||
int i;
|
||||
@@ -6300,7 +6255,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
|
||||
* Called when starting to edit a buffer for a help file.
|
||||
*/
|
||||
static void
|
||||
prepare_help_buffer()
|
||||
prepare_help_buffer(void)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -6368,7 +6323,7 @@ prepare_help_buffer()
|
||||
* highlighting is not used.
|
||||
*/
|
||||
void
|
||||
fix_help_buffer()
|
||||
fix_help_buffer(void)
|
||||
{
|
||||
linenr_T lnum;
|
||||
char_u *line;
|
||||
@@ -6610,8 +6565,7 @@ fix_help_buffer()
|
||||
* ":exusage"
|
||||
*/
|
||||
void
|
||||
ex_exusage(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_exusage(exarg_T *eap UNUSED)
|
||||
{
|
||||
do_cmdline_cmd((char_u *)"help ex-cmd-index");
|
||||
}
|
||||
@@ -6620,35 +6574,32 @@ ex_exusage(eap)
|
||||
* ":viusage"
|
||||
*/
|
||||
void
|
||||
ex_viusage(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_viusage(exarg_T *eap UNUSED)
|
||||
{
|
||||
do_cmdline_cmd((char_u *)"help normal-index");
|
||||
}
|
||||
|
||||
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
|
||||
static void helptags_one(char_u *dir, char_u *ext, char_u *lang, int add_help_tags);
|
||||
|
||||
/*
|
||||
* ":helptags"
|
||||
*/
|
||||
void
|
||||
ex_helptags(eap)
|
||||
exarg_T *eap;
|
||||
ex_helptags(exarg_T *eap)
|
||||
{
|
||||
garray_T ga;
|
||||
int i, j;
|
||||
int len;
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
char_u lang[2];
|
||||
#endif
|
||||
expand_T xpc;
|
||||
char_u *dirname;
|
||||
int add_help_tags = FALSE;
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
int len;
|
||||
int i, j;
|
||||
garray_T ga;
|
||||
char_u lang[2];
|
||||
char_u ext[5];
|
||||
char_u fname[8];
|
||||
int filecount;
|
||||
char_u **files;
|
||||
int add_help_tags = FALSE;
|
||||
#endif
|
||||
|
||||
/* Check for ":helptags ++t {dir}". */
|
||||
if (STRNCMP(eap->arg, "++t", 3) == 0 && vim_iswhite(eap->arg[3]))
|
||||
@@ -6758,11 +6709,11 @@ ex_helptags(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
helptags_one(dir, ext, tagfname, add_help_tags)
|
||||
char_u *dir; /* doc directory */
|
||||
char_u *ext; /* suffix, ".txt", ".itx", ".frx", etc. */
|
||||
char_u *tagfname; /* "tags" for English, "tags-fr" for French. */
|
||||
int add_help_tags; /* add "help-tags" tag */
|
||||
helptags_one(
|
||||
char_u *dir, /* doc directory */
|
||||
char_u *ext, /* suffix, ".txt", ".itx", ".frx", etc. */
|
||||
char_u *tagfname, /* "tags" for English, "tags-fr" for French. */
|
||||
int add_help_tags) /* add "help-tags" tag */
|
||||
{
|
||||
FILE *fd_tags;
|
||||
FILE *fd;
|
||||
@@ -7012,7 +6963,6 @@ helptags_one(dir, ext, tagfname, add_help_tags)
|
||||
ga_clear(&ga);
|
||||
fclose(fd_tags); /* there is no check for an error... */
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_SIGNS) || defined(PROTO)
|
||||
|
||||
@@ -7064,9 +7014,9 @@ static char *cmds[] = {
|
||||
* "*end_cmd" must be writable.
|
||||
*/
|
||||
static int
|
||||
sign_cmd_idx(begin_cmd, end_cmd)
|
||||
char_u *begin_cmd; /* begin of sign subcmd */
|
||||
char_u *end_cmd; /* just after sign subcmd */
|
||||
sign_cmd_idx(
|
||||
char_u *begin_cmd, /* begin of sign subcmd */
|
||||
char_u *end_cmd) /* just after sign subcmd */
|
||||
{
|
||||
int idx;
|
||||
char save = *end_cmd;
|
||||
@@ -7083,8 +7033,7 @@ sign_cmd_idx(begin_cmd, end_cmd)
|
||||
* ":sign" command
|
||||
*/
|
||||
void
|
||||
ex_sign(eap)
|
||||
exarg_T *eap;
|
||||
ex_sign(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *p;
|
||||
@@ -7490,7 +7439,7 @@ ex_sign(eap)
|
||||
* signs before it starts.
|
||||
*/
|
||||
void
|
||||
sign_gui_started()
|
||||
sign_gui_started(void)
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7504,8 +7453,7 @@ sign_gui_started()
|
||||
* List one sign.
|
||||
*/
|
||||
static void
|
||||
sign_list_defined(sp)
|
||||
sign_T *sp;
|
||||
sign_list_defined(sign_T *sp)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -7550,9 +7498,7 @@ sign_list_defined(sp)
|
||||
* Undefine a sign and free its memory.
|
||||
*/
|
||||
static void
|
||||
sign_undefine(sp, sp_prev)
|
||||
sign_T *sp;
|
||||
sign_T *sp_prev;
|
||||
sign_undefine(sign_T *sp, sign_T *sp_prev)
|
||||
{
|
||||
vim_free(sp->sn_name);
|
||||
vim_free(sp->sn_icon);
|
||||
@@ -7576,9 +7522,7 @@ sign_undefine(sp, sp_prev)
|
||||
* If "line" is TRUE: line highl, if FALSE: text highl.
|
||||
*/
|
||||
int
|
||||
sign_get_attr(typenr, line)
|
||||
int typenr;
|
||||
int line;
|
||||
sign_get_attr(int typenr, int line)
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7605,8 +7549,7 @@ sign_get_attr(typenr, line)
|
||||
* Returns NULL if there isn't one.
|
||||
*/
|
||||
char_u *
|
||||
sign_get_text(typenr)
|
||||
int typenr;
|
||||
sign_get_text(int typenr)
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7618,8 +7561,8 @@ sign_get_text(typenr)
|
||||
|
||||
# if defined(FEAT_SIGN_ICONS) || defined(PROTO)
|
||||
void *
|
||||
sign_get_image(typenr)
|
||||
int typenr; /* the attribute which may have a sign */
|
||||
sign_get_image(
|
||||
int typenr) /* the attribute which may have a sign */
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7634,8 +7577,7 @@ sign_get_image(typenr)
|
||||
* Get the name of a sign by its typenr.
|
||||
*/
|
||||
char_u *
|
||||
sign_typenr2name(typenr)
|
||||
int typenr;
|
||||
sign_typenr2name(int typenr)
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7650,7 +7592,7 @@ sign_typenr2name(typenr)
|
||||
* Undefine/free all signs.
|
||||
*/
|
||||
void
|
||||
free_signs()
|
||||
free_signs(void)
|
||||
{
|
||||
while (first_sign != NULL)
|
||||
sign_undefine(first_sign, NULL);
|
||||
@@ -7672,9 +7614,7 @@ static enum
|
||||
* expansion.
|
||||
*/
|
||||
char_u *
|
||||
get_sign_name(xp, idx)
|
||||
expand_T *xp UNUSED;
|
||||
int idx;
|
||||
get_sign_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
sign_T *sp;
|
||||
int current_idx;
|
||||
@@ -7720,9 +7660,7 @@ get_sign_name(xp, idx)
|
||||
* Handle command line completion for :sign command.
|
||||
*/
|
||||
void
|
||||
set_context_in_sign_cmd(xp, arg)
|
||||
expand_T *xp;
|
||||
char_u *arg;
|
||||
set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
||||
{
|
||||
char_u *p;
|
||||
char_u *end_subcmd;
|
||||
@@ -7842,8 +7780,7 @@ set_context_in_sign_cmd(xp, arg)
|
||||
* Make the user happy.
|
||||
*/
|
||||
void
|
||||
ex_smile(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_smile(exarg_T *eap UNUSED)
|
||||
{
|
||||
static char *code = "\34 \4o\14$\4ox\30 \2o\30$\1ox\25 \2o\36$\1o\11 \1o\1$\3 \2$\1 \1o\1$x\5 \1o\1 \1$\1 \2o\10 \1o\44$\1o\7 \2$\1 \2$\1 \2$\1o\1$x\2 \2o\1 \1$\1 \1$\1 \1\"\1$\6 \1o\11$\4 \15$\4 \11$\1o\7 \3$\1o\2$\1o\1$x\2 \1\"\6$\1o\1$\5 \1o\11$\6 \13$\6 \12$\1o\4 \10$x\4 \7$\4 \13$\6 \13$\6 \27$x\4 \27$\4 \15$\4 \16$\2 \3\"\3$x\5 \1\"\3$\4\"\61$\5 \1\"\3$x\6 \3$\3 \1o\62$\5 \1\"\3$\1ox\5 \1o\2$\1\"\3 \63$\7 \3$\1ox\5 \3$\4 \55$\1\"\1 \1\"\6$\5o\4$\1ox\4 \1o\3$\4o\5$\2 \45$\3 \1o\21$x\4 \10$\1\"\4$\3 \42$\5 \4$\10\"x\3 \4\"\7 \4$\4 \1\"\34$\1\"\6 \1o\3$x\16 \1\"\3$\1o\5 \3\"\22$\1\"\2$\1\"\11 \3$x\20 \3$\1o\12 \1\"\2$\2\"\6$\4\"\13 \1o\3$x\21 \4$\1o\40 \1o\3$\1\"x\22 \1\"\4$\1o\6 \1o\6$\1o\1\"\4$\1o\10 \1o\4$x\24 \1\"\5$\2o\5 \2\"\4$\1o\5$\1o\3 \1o\4$\2\"x\27 \2\"\5$\4o\2 \1\"\3$\1o\11$\3\"x\32 \2\"\7$\2o\1 \12$x\42 \4\"\13$x\46 \14$x\47 \12$\1\"x\50 \1\"\3$\4\"x";
|
||||
char *p;
|
||||
@@ -7870,8 +7807,7 @@ ex_smile(eap)
|
||||
* the argument list is redefined.
|
||||
*/
|
||||
void
|
||||
ex_drop(eap)
|
||||
exarg_T *eap;
|
||||
ex_drop(exarg_T *eap)
|
||||
{
|
||||
int split = FALSE;
|
||||
win_T *wp;
|
||||
|
||||
+174
-263
File diff suppressed because it is too large
Load Diff
+324
-542
File diff suppressed because it is too large
Load Diff
+57
-92
@@ -93,7 +93,7 @@ static int cause_abort = FALSE;
|
||||
* due to a parsing error, aborting() always returns the same value.
|
||||
*/
|
||||
int
|
||||
aborting()
|
||||
aborting(void)
|
||||
{
|
||||
return (did_emsg && force_abort) || got_int || did_throw;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ aborting()
|
||||
* error message has been reached. update_force_abort() should be called then.
|
||||
*/
|
||||
void
|
||||
update_force_abort()
|
||||
update_force_abort(void)
|
||||
{
|
||||
if (cause_abort)
|
||||
force_abort = TRUE;
|
||||
@@ -118,8 +118,7 @@ update_force_abort()
|
||||
* displayed and actually caused the abortion.
|
||||
*/
|
||||
int
|
||||
should_abort(retcode)
|
||||
int retcode;
|
||||
should_abort(int retcode)
|
||||
{
|
||||
return ((retcode == FAIL && trylevel != 0 && !emsg_silent) || aborting());
|
||||
}
|
||||
@@ -131,7 +130,7 @@ should_abort(retcode)
|
||||
* commands are still reported.
|
||||
*/
|
||||
int
|
||||
aborted_in_try()
|
||||
aborted_in_try(void)
|
||||
{
|
||||
/* This function is only called after an error. In this case, "force_abort"
|
||||
* determines whether searching for finally clauses is necessary. */
|
||||
@@ -148,10 +147,10 @@ aborted_in_try()
|
||||
* set to TRUE, if a later but severer message should be used instead.
|
||||
*/
|
||||
int
|
||||
cause_errthrow(mesg, severe, ignore)
|
||||
char_u *mesg;
|
||||
int severe;
|
||||
int *ignore;
|
||||
cause_errthrow(
|
||||
char_u *mesg,
|
||||
int severe,
|
||||
int *ignore)
|
||||
{
|
||||
struct msglist *elem;
|
||||
struct msglist **plist;
|
||||
@@ -305,8 +304,7 @@ cause_errthrow(mesg, severe, ignore)
|
||||
* Free a "msg_list" and the messages it contains.
|
||||
*/
|
||||
static void
|
||||
free_msglist(l)
|
||||
struct msglist *l;
|
||||
free_msglist(struct msglist *l)
|
||||
{
|
||||
struct msglist *messages, *next;
|
||||
|
||||
@@ -325,7 +323,7 @@ free_msglist(l)
|
||||
* to NULL.
|
||||
*/
|
||||
void
|
||||
free_global_msglist()
|
||||
free_global_msglist(void)
|
||||
{
|
||||
free_msglist(*msg_list);
|
||||
*msg_list = NULL;
|
||||
@@ -337,9 +335,7 @@ free_global_msglist()
|
||||
* has returned (see do_one_cmd()).
|
||||
*/
|
||||
void
|
||||
do_errthrow(cstack, cmdname)
|
||||
struct condstack *cstack;
|
||||
char_u *cmdname;
|
||||
do_errthrow(struct condstack *cstack, char_u *cmdname)
|
||||
{
|
||||
/*
|
||||
* Ensure that all commands in nested function calls and sourced files
|
||||
@@ -374,8 +370,7 @@ do_errthrow(cstack, cmdname)
|
||||
* FALSE otherwise.
|
||||
*/
|
||||
int
|
||||
do_intthrow(cstack)
|
||||
struct condstack *cstack;
|
||||
do_intthrow(struct condstack *cstack)
|
||||
{
|
||||
/*
|
||||
* If no interrupt occurred or no try conditional is active and no exception
|
||||
@@ -425,11 +420,11 @@ do_intthrow(cstack)
|
||||
* Get an exception message that is to be stored in current_exception->value.
|
||||
*/
|
||||
char_u *
|
||||
get_exception_string(value, type, cmdname, should_free)
|
||||
void *value;
|
||||
int type;
|
||||
char_u *cmdname;
|
||||
int *should_free;
|
||||
get_exception_string(
|
||||
void *value,
|
||||
int type,
|
||||
char_u *cmdname,
|
||||
int *should_free)
|
||||
{
|
||||
char_u *ret, *mesg;
|
||||
int cmdlen;
|
||||
@@ -508,10 +503,7 @@ get_exception_string(value, type, cmdname, should_free)
|
||||
* error exception.
|
||||
*/
|
||||
static int
|
||||
throw_exception(value, type, cmdname)
|
||||
void *value;
|
||||
int type;
|
||||
char_u *cmdname;
|
||||
throw_exception(void *value, int type, char_u *cmdname)
|
||||
{
|
||||
except_T *excp;
|
||||
int should_free;
|
||||
@@ -597,9 +589,7 @@ fail:
|
||||
* caught and the catch clause has been ended normally.
|
||||
*/
|
||||
static void
|
||||
discard_exception(excp, was_finished)
|
||||
except_T *excp;
|
||||
int was_finished;
|
||||
discard_exception(except_T *excp, int was_finished)
|
||||
{
|
||||
char_u *saved_IObuff;
|
||||
|
||||
@@ -648,7 +638,7 @@ discard_exception(excp, was_finished)
|
||||
* Discard the exception currently being thrown.
|
||||
*/
|
||||
void
|
||||
discard_current_exception()
|
||||
discard_current_exception(void)
|
||||
{
|
||||
discard_exception(current_exception, FALSE);
|
||||
current_exception = NULL;
|
||||
@@ -660,8 +650,7 @@ discard_current_exception()
|
||||
* Put an exception on the caught stack.
|
||||
*/
|
||||
static void
|
||||
catch_exception(excp)
|
||||
except_T *excp;
|
||||
catch_exception(except_T *excp)
|
||||
{
|
||||
excp->caught = caught_stack;
|
||||
caught_stack = excp;
|
||||
@@ -708,8 +697,7 @@ catch_exception(excp)
|
||||
* Remove an exception from the caught stack.
|
||||
*/
|
||||
static void
|
||||
finish_exception(excp)
|
||||
except_T *excp;
|
||||
finish_exception(except_T *excp)
|
||||
{
|
||||
if (excp != caught_stack)
|
||||
EMSG(_(e_internal));
|
||||
@@ -758,10 +746,7 @@ finish_exception(excp)
|
||||
* or the exception value for a pending exception.
|
||||
*/
|
||||
static void
|
||||
report_pending(action, pending, value)
|
||||
int action;
|
||||
int pending;
|
||||
void *value;
|
||||
report_pending(int action, int pending, void *value)
|
||||
{
|
||||
char_u *mesg;
|
||||
char *s;
|
||||
@@ -841,9 +826,7 @@ report_pending(action, pending, value)
|
||||
* the 'verbose' option or when debugging.
|
||||
*/
|
||||
void
|
||||
report_make_pending(pending, value)
|
||||
int pending;
|
||||
void *value;
|
||||
report_make_pending(int pending, void *value)
|
||||
{
|
||||
if (p_verbose >= 14 || debug_break_level > 0)
|
||||
{
|
||||
@@ -860,9 +843,7 @@ report_make_pending(pending, value)
|
||||
* it if required by the 'verbose' option or when debugging.
|
||||
*/
|
||||
void
|
||||
report_resume_pending(pending, value)
|
||||
int pending;
|
||||
void *value;
|
||||
report_resume_pending(int pending, void *value)
|
||||
{
|
||||
if (p_verbose >= 14 || debug_break_level > 0)
|
||||
{
|
||||
@@ -879,9 +860,7 @@ report_resume_pending(pending, value)
|
||||
* by the 'verbose' option or when debugging.
|
||||
*/
|
||||
void
|
||||
report_discard_pending(pending, value)
|
||||
int pending;
|
||||
void *value;
|
||||
report_discard_pending(int pending, void *value)
|
||||
{
|
||||
if (p_verbose >= 14 || debug_break_level > 0)
|
||||
{
|
||||
@@ -898,8 +877,7 @@ report_discard_pending(pending, value)
|
||||
* ":if".
|
||||
*/
|
||||
void
|
||||
ex_if(eap)
|
||||
exarg_T *eap;
|
||||
ex_if(exarg_T *eap)
|
||||
{
|
||||
int error;
|
||||
int skip;
|
||||
@@ -937,8 +915,7 @@ ex_if(eap)
|
||||
* ":endif".
|
||||
*/
|
||||
void
|
||||
ex_endif(eap)
|
||||
exarg_T *eap;
|
||||
ex_endif(exarg_T *eap)
|
||||
{
|
||||
did_endif = TRUE;
|
||||
if (eap->cstack->cs_idx < 0
|
||||
@@ -968,8 +945,7 @@ ex_endif(eap)
|
||||
* ":else" and ":elseif".
|
||||
*/
|
||||
void
|
||||
ex_else(eap)
|
||||
exarg_T *eap;
|
||||
ex_else(exarg_T *eap)
|
||||
{
|
||||
int error;
|
||||
int skip;
|
||||
@@ -1060,8 +1036,7 @@ ex_else(eap)
|
||||
* Handle ":while" and ":for".
|
||||
*/
|
||||
void
|
||||
ex_while(eap)
|
||||
exarg_T *eap;
|
||||
ex_while(exarg_T *eap)
|
||||
{
|
||||
int error;
|
||||
int skip;
|
||||
@@ -1160,8 +1135,7 @@ ex_while(eap)
|
||||
* ":continue"
|
||||
*/
|
||||
void
|
||||
ex_continue(eap)
|
||||
exarg_T *eap;
|
||||
ex_continue(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
struct condstack *cstack = eap->cstack;
|
||||
@@ -1199,8 +1173,7 @@ ex_continue(eap)
|
||||
* ":break"
|
||||
*/
|
||||
void
|
||||
ex_break(eap)
|
||||
exarg_T *eap;
|
||||
ex_break(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
struct condstack *cstack = eap->cstack;
|
||||
@@ -1226,8 +1199,7 @@ ex_break(eap)
|
||||
* ":endwhile" and ":endfor"
|
||||
*/
|
||||
void
|
||||
ex_endwhile(eap)
|
||||
exarg_T *eap;
|
||||
ex_endwhile(exarg_T *eap)
|
||||
{
|
||||
struct condstack *cstack = eap->cstack;
|
||||
int idx;
|
||||
@@ -1313,8 +1285,7 @@ ex_endwhile(eap)
|
||||
* ":throw expr"
|
||||
*/
|
||||
void
|
||||
ex_throw(eap)
|
||||
exarg_T *eap;
|
||||
ex_throw(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *value;
|
||||
@@ -1344,8 +1315,7 @@ ex_throw(eap)
|
||||
* used for rethrowing an uncaught exception.
|
||||
*/
|
||||
void
|
||||
do_throw(cstack)
|
||||
struct condstack *cstack;
|
||||
do_throw(struct condstack *cstack)
|
||||
{
|
||||
int idx;
|
||||
int inactivate_try = FALSE;
|
||||
@@ -1426,8 +1396,7 @@ do_throw(cstack)
|
||||
* ":try"
|
||||
*/
|
||||
void
|
||||
ex_try(eap)
|
||||
exarg_T *eap;
|
||||
ex_try(exarg_T *eap)
|
||||
{
|
||||
int skip;
|
||||
struct condstack *cstack = eap->cstack;
|
||||
@@ -1496,8 +1465,7 @@ ex_try(eap)
|
||||
* ":catch /{pattern}/" and ":catch"
|
||||
*/
|
||||
void
|
||||
ex_catch(eap)
|
||||
exarg_T *eap;
|
||||
ex_catch(exarg_T *eap)
|
||||
{
|
||||
int idx = 0;
|
||||
int give_up = FALSE;
|
||||
@@ -1594,7 +1562,11 @@ ex_catch(eap)
|
||||
}
|
||||
save_cpo = p_cpo;
|
||||
p_cpo = (char_u *)"";
|
||||
/* Disable error messages, it will make current_exception
|
||||
* invalid. */
|
||||
++emsg_off;
|
||||
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
|
||||
--emsg_off;
|
||||
regmatch.rm_ic = FALSE;
|
||||
if (end != NULL)
|
||||
*end = save_char;
|
||||
@@ -1657,8 +1629,7 @@ ex_catch(eap)
|
||||
* ":finally"
|
||||
*/
|
||||
void
|
||||
ex_finally(eap)
|
||||
exarg_T *eap;
|
||||
ex_finally(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
int skip = FALSE;
|
||||
@@ -1785,8 +1756,7 @@ ex_finally(eap)
|
||||
* ":endtry"
|
||||
*/
|
||||
void
|
||||
ex_endtry(eap)
|
||||
exarg_T *eap;
|
||||
ex_endtry(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
int skip;
|
||||
@@ -1984,8 +1954,7 @@ ex_endtry(eap)
|
||||
* execution.
|
||||
*/
|
||||
void
|
||||
enter_cleanup(csp)
|
||||
cleanup_T *csp;
|
||||
enter_cleanup(cleanup_T *csp)
|
||||
{
|
||||
int pending = CSTP_NONE;
|
||||
|
||||
@@ -2047,8 +2016,7 @@ enter_cleanup(csp)
|
||||
* exception state is discarded.
|
||||
*/
|
||||
void
|
||||
leave_cleanup(csp)
|
||||
cleanup_T *csp;
|
||||
leave_cleanup(cleanup_T *csp)
|
||||
{
|
||||
int pending = csp->pending;
|
||||
|
||||
@@ -2133,10 +2101,10 @@ leave_cleanup(csp)
|
||||
* when such a try conditional is left.
|
||||
*/
|
||||
int
|
||||
cleanup_conditionals(cstack, searched_cond, inclusive)
|
||||
struct condstack *cstack;
|
||||
int searched_cond;
|
||||
int inclusive;
|
||||
cleanup_conditionals(
|
||||
struct condstack *cstack,
|
||||
int searched_cond,
|
||||
int inclusive)
|
||||
{
|
||||
int idx;
|
||||
int stop = FALSE;
|
||||
@@ -2256,8 +2224,7 @@ cleanup_conditionals(cstack, searched_cond, inclusive)
|
||||
* Return an appropriate error message for a missing endwhile/endfor/endif.
|
||||
*/
|
||||
static char_u *
|
||||
get_end_emsg(cstack)
|
||||
struct condstack *cstack;
|
||||
get_end_emsg(struct condstack *cstack)
|
||||
{
|
||||
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
|
||||
return e_endwhile;
|
||||
@@ -2275,11 +2242,11 @@ get_end_emsg(cstack)
|
||||
* Also free "for info" structures where needed.
|
||||
*/
|
||||
void
|
||||
rewind_conditionals(cstack, idx, cond_type, cond_level)
|
||||
struct condstack *cstack;
|
||||
int idx;
|
||||
int cond_type;
|
||||
int *cond_level;
|
||||
rewind_conditionals(
|
||||
struct condstack *cstack,
|
||||
int idx,
|
||||
int cond_type,
|
||||
int *cond_level)
|
||||
{
|
||||
while (cstack->cs_idx > idx)
|
||||
{
|
||||
@@ -2295,8 +2262,7 @@ rewind_conditionals(cstack, idx, cond_type, cond_level)
|
||||
* ":endfunction" when not after a ":function"
|
||||
*/
|
||||
void
|
||||
ex_endfunction(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_endfunction(exarg_T *eap UNUSED)
|
||||
{
|
||||
EMSG(_("E193: :endfunction not inside a function"));
|
||||
}
|
||||
@@ -2305,8 +2271,7 @@ ex_endfunction(eap)
|
||||
* Return TRUE if the string "p" looks like a ":while" or ":for" command.
|
||||
*/
|
||||
int
|
||||
has_loop_cmd(p)
|
||||
char_u *p;
|
||||
has_loop_cmd(char_u *p)
|
||||
{
|
||||
int len;
|
||||
|
||||
|
||||
+189
-253
File diff suppressed because it is too large
Load Diff
+34
-59
@@ -38,8 +38,7 @@ static void lrswapbuf(char_u *buf, int len);
|
||||
** Convert the given Farsi character into a _X or _X_ type
|
||||
*/
|
||||
static int
|
||||
toF_Xor_X_(c)
|
||||
int c;
|
||||
toF_Xor_X_(int c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -132,8 +131,7 @@ toF_Xor_X_(c)
|
||||
** Convert the given Farsi character into Farsi capital character .
|
||||
*/
|
||||
int
|
||||
toF_TyA(c)
|
||||
int c ;
|
||||
toF_TyA(int c )
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -212,8 +210,7 @@ toF_TyA(c)
|
||||
** Note: the offset is used only for command line buffer.
|
||||
*/
|
||||
static int
|
||||
F_is_TyB_TyC_TyD(src, offset)
|
||||
int src, offset;
|
||||
F_is_TyB_TyC_TyD(int src, int offset)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -264,8 +261,7 @@ F_is_TyB_TyC_TyD(src, offset)
|
||||
** Is the Farsi character one of the terminating only type.
|
||||
*/
|
||||
static int
|
||||
F_is_TyE(c)
|
||||
int c;
|
||||
F_is_TyE(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -288,8 +284,7 @@ F_is_TyE(c)
|
||||
** Is the Farsi character one of the none leading type.
|
||||
*/
|
||||
static int
|
||||
F_is_TyC_TyD(c)
|
||||
int c;
|
||||
F_is_TyC_TyD(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -313,8 +308,7 @@ F_is_TyC_TyD(c)
|
||||
** Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
static int
|
||||
toF_TyB(c)
|
||||
int c;
|
||||
toF_TyB(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -337,8 +331,7 @@ toF_TyB(c)
|
||||
** Overwrite the current redo and cursor characters + left adjust
|
||||
*/
|
||||
static void
|
||||
put_curr_and_l_to_X(c)
|
||||
int c;
|
||||
put_curr_and_l_to_X(int c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -372,8 +365,7 @@ put_curr_and_l_to_X(c)
|
||||
}
|
||||
|
||||
static void
|
||||
put_and_redo(c)
|
||||
int c;
|
||||
put_and_redo(int c)
|
||||
{
|
||||
pchar_cursor(c);
|
||||
AppendCharToRedobuff(K_BS);
|
||||
@@ -384,7 +376,7 @@ put_and_redo(c)
|
||||
** Change the char. under the cursor to a X_ or X type
|
||||
*/
|
||||
static void
|
||||
chg_c_toX_orX()
|
||||
chg_c_toX_orX(void)
|
||||
{
|
||||
int tempc, curc;
|
||||
|
||||
@@ -509,7 +501,7 @@ chg_c_toX_orX()
|
||||
*/
|
||||
|
||||
static void
|
||||
chg_c_to_X_orX_()
|
||||
chg_c_to_X_orX_(void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -560,7 +552,7 @@ chg_c_to_X_orX_()
|
||||
** Change the char. under the cursor to a _X_ or _X type
|
||||
*/
|
||||
static void
|
||||
chg_c_to_X_or_X ()
|
||||
chg_c_to_X_or_X (void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -591,7 +583,7 @@ chg_c_to_X_or_X ()
|
||||
** Change the character left to the cursor to a _X_ or X_ type
|
||||
*/
|
||||
static void
|
||||
chg_l_to_X_orX_ ()
|
||||
chg_l_to_X_orX_ (void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -660,7 +652,7 @@ chg_l_to_X_orX_ ()
|
||||
*/
|
||||
|
||||
static void
|
||||
chg_l_toXor_X ()
|
||||
chg_l_toXor_X (void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -729,7 +721,7 @@ chg_l_toXor_X ()
|
||||
*/
|
||||
|
||||
static void
|
||||
chg_r_to_Xor_X_()
|
||||
chg_r_to_Xor_X_(void)
|
||||
{
|
||||
int tempc, c;
|
||||
|
||||
@@ -754,8 +746,7 @@ chg_r_to_Xor_X_()
|
||||
*/
|
||||
|
||||
int
|
||||
fkmap(c)
|
||||
int c;
|
||||
fkmap(int c)
|
||||
{
|
||||
int tempc;
|
||||
static int revins;
|
||||
@@ -1473,8 +1464,7 @@ fkmap(c)
|
||||
** Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
static int
|
||||
toF_leading(c)
|
||||
int c;
|
||||
toF_leading(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -1528,8 +1518,7 @@ toF_leading(c)
|
||||
** Convert a given Farsi char into right joining type.
|
||||
*/
|
||||
static int
|
||||
toF_Rjoin(c)
|
||||
int c;
|
||||
toF_Rjoin(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -1585,8 +1574,7 @@ toF_Rjoin(c)
|
||||
** Can a given Farsi character join via its left edj.
|
||||
*/
|
||||
static int
|
||||
canF_Ljoin(c)
|
||||
int c;
|
||||
canF_Ljoin(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -1660,8 +1648,7 @@ canF_Ljoin(c)
|
||||
** Can a given Farsi character join via its right edj.
|
||||
*/
|
||||
static int
|
||||
canF_Rjoin(c)
|
||||
int c;
|
||||
canF_Rjoin(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -1689,8 +1676,7 @@ canF_Rjoin(c)
|
||||
** is a given Farsi character a terminating type.
|
||||
*/
|
||||
static int
|
||||
F_isterm(c)
|
||||
int c;
|
||||
F_isterm(int c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -1717,8 +1703,7 @@ F_isterm(c)
|
||||
** Convert the given Farsi character into a ending type .
|
||||
*/
|
||||
static int
|
||||
toF_ending(c)
|
||||
int c;
|
||||
toF_ending(int c)
|
||||
{
|
||||
|
||||
switch (c)
|
||||
@@ -1795,7 +1780,7 @@ toF_ending(c)
|
||||
** Convert the Farsi 3342 standard into Farsi VIM.
|
||||
*/
|
||||
void
|
||||
conv_to_pvim()
|
||||
conv_to_pvim(void)
|
||||
{
|
||||
char_u *ptr;
|
||||
int lnum, llen, i;
|
||||
@@ -1844,7 +1829,7 @@ conv_to_pvim()
|
||||
* Convert the Farsi VIM into Farsi 3342 standard.
|
||||
*/
|
||||
void
|
||||
conv_to_pstd()
|
||||
conv_to_pstd(void)
|
||||
{
|
||||
char_u *ptr;
|
||||
int lnum, llen, i;
|
||||
@@ -1877,9 +1862,7 @@ conv_to_pstd()
|
||||
* left-right swap the characters in buf[len].
|
||||
*/
|
||||
static void
|
||||
lrswapbuf(buf, len)
|
||||
char_u *buf;
|
||||
int len;
|
||||
lrswapbuf(char_u *buf, int len)
|
||||
{
|
||||
char_u *s, *e;
|
||||
int c;
|
||||
@@ -1901,8 +1884,7 @@ lrswapbuf(buf, len)
|
||||
* swap all the characters in reverse direction
|
||||
*/
|
||||
char_u *
|
||||
lrswap(ibuf)
|
||||
char_u *ibuf;
|
||||
lrswap(char_u *ibuf)
|
||||
{
|
||||
if (ibuf != NULL && *ibuf != NUL)
|
||||
lrswapbuf(ibuf, (int)STRLEN(ibuf));
|
||||
@@ -1913,9 +1895,7 @@ lrswap(ibuf)
|
||||
* swap all the Farsi characters in reverse direction
|
||||
*/
|
||||
char_u *
|
||||
lrFswap(cmdbuf, len)
|
||||
char_u *cmdbuf;
|
||||
int len;
|
||||
lrFswap(char_u *cmdbuf, int len)
|
||||
{
|
||||
int i, cnt;
|
||||
|
||||
@@ -1945,8 +1925,7 @@ lrFswap(cmdbuf, len)
|
||||
* TODO: handle different separator characters. Use skip_regexp().
|
||||
*/
|
||||
char_u *
|
||||
lrF_sub(ibuf)
|
||||
char_u *ibuf;
|
||||
lrF_sub(char_u *ibuf)
|
||||
{
|
||||
char_u *p, *ep;
|
||||
int i, cnt;
|
||||
@@ -1986,8 +1965,7 @@ lrF_sub(ibuf)
|
||||
* Map Farsi keyboard when in cmd_fkmap mode.
|
||||
*/
|
||||
int
|
||||
cmdl_fkmap(c)
|
||||
int c;
|
||||
cmdl_fkmap(int c)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -2246,8 +2224,7 @@ cmdl_fkmap(c)
|
||||
* F_isalpha returns TRUE if 'c' is a Farsi alphabet
|
||||
*/
|
||||
int
|
||||
F_isalpha(c)
|
||||
int c;
|
||||
F_isalpha(int c)
|
||||
{
|
||||
return (( c >= TEE_ && c <= _YE)
|
||||
|| (c >= ALEF_A && c <= YE)
|
||||
@@ -2258,8 +2235,7 @@ F_isalpha(c)
|
||||
* F_isdigit returns TRUE if 'c' is a Farsi digit
|
||||
*/
|
||||
int
|
||||
F_isdigit(c)
|
||||
int c;
|
||||
F_isdigit(int c)
|
||||
{
|
||||
return (c >= FARSI_0 && c <= FARSI_9);
|
||||
}
|
||||
@@ -2268,15 +2244,14 @@ F_isdigit(c)
|
||||
* F_ischar returns TRUE if 'c' is a Farsi character.
|
||||
*/
|
||||
int
|
||||
F_ischar(c)
|
||||
int c;
|
||||
F_ischar(int c)
|
||||
{
|
||||
return (c >= TEE_ && c <= YE_);
|
||||
return (c >= TEE_ && c <= YE_);
|
||||
}
|
||||
|
||||
void
|
||||
farsi_fkey(cap)
|
||||
cmdarg_T *cap;
|
||||
farsi_fkey(
|
||||
cmdarg_T *cap)
|
||||
{
|
||||
int c = cap->cmdchar;
|
||||
|
||||
|
||||
+8
-8
@@ -253,13 +253,6 @@
|
||||
# define FEAT_LINEBREAK
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +ex_extra ":retab", ":right", ":left", ":center", ":normal".
|
||||
*/
|
||||
#ifdef FEAT_NORMAL
|
||||
# define FEAT_EX_EXTRA
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +extra_search 'hlsearch' and 'incsearch' options.
|
||||
*/
|
||||
@@ -1276,12 +1269,19 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The Channel feature requires +eval.
|
||||
* The +channel feature requires +eval.
|
||||
*/
|
||||
#if !defined(FEAT_EVAL) && defined(FEAT_CHANNEL)
|
||||
# undef FEAT_CHANNEL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The +job feature requires +eval and Unix or MS-Windows.
|
||||
*/
|
||||
#if (defined(UNIX) || defined(WIN32)) && defined(FEAT_EVAL)
|
||||
# define FEAT_JOB
|
||||
#endif
|
||||
|
||||
/*
|
||||
* +signs Allow signs to be displayed to the left of text lines.
|
||||
* Adds the ":sign" command.
|
||||
|
||||
+224
-311
File diff suppressed because it is too large
Load Diff
+142
-232
@@ -100,9 +100,7 @@ static int foldendmarkerlen;
|
||||
* Copy that folding state from window "wp_from" to window "wp_to".
|
||||
*/
|
||||
void
|
||||
copyFoldingState(wp_from, wp_to)
|
||||
win_T *wp_from;
|
||||
win_T *wp_to;
|
||||
copyFoldingState(win_T *wp_from, win_T *wp_to)
|
||||
{
|
||||
wp_to->w_fold_manual = wp_from->w_fold_manual;
|
||||
wp_to->w_foldinvalid = wp_from->w_foldinvalid;
|
||||
@@ -115,8 +113,7 @@ copyFoldingState(wp_from, wp_to)
|
||||
* Return TRUE if there may be folded lines in the current window.
|
||||
*/
|
||||
int
|
||||
hasAnyFolding(win)
|
||||
win_T *win;
|
||||
hasAnyFolding(win_T *win)
|
||||
{
|
||||
/* very simple now, but can become more complex later */
|
||||
return (win->w_p_fen
|
||||
@@ -131,23 +128,20 @@ hasAnyFolding(win)
|
||||
* lnum of the sequence of folded lines (skipped when NULL).
|
||||
*/
|
||||
int
|
||||
hasFolding(lnum, firstp, lastp)
|
||||
linenr_T lnum;
|
||||
linenr_T *firstp;
|
||||
linenr_T *lastp;
|
||||
hasFolding(linenr_T lnum, linenr_T *firstp, linenr_T *lastp)
|
||||
{
|
||||
return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL);
|
||||
}
|
||||
|
||||
/* hasFoldingWin() {{{2 */
|
||||
int
|
||||
hasFoldingWin(win, lnum, firstp, lastp, cache, infop)
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
linenr_T *firstp;
|
||||
linenr_T *lastp;
|
||||
int cache; /* when TRUE: use cached values of window */
|
||||
foldinfo_T *infop; /* where to store fold info */
|
||||
hasFoldingWin(
|
||||
win_T *win,
|
||||
linenr_T lnum,
|
||||
linenr_T *firstp,
|
||||
linenr_T *lastp,
|
||||
int cache, /* when TRUE: use cached values of window */
|
||||
foldinfo_T *infop) /* where to store fold info */
|
||||
{
|
||||
int had_folded = FALSE;
|
||||
linenr_T first = 0;
|
||||
@@ -254,8 +248,7 @@ hasFoldingWin(win, lnum, firstp, lastp, cache, infop)
|
||||
* Return fold level at line number "lnum" in the current window.
|
||||
*/
|
||||
int
|
||||
foldLevel(lnum)
|
||||
linenr_T lnum;
|
||||
foldLevel(linenr_T lnum)
|
||||
{
|
||||
/* While updating the folds lines between invalid_top and invalid_bot have
|
||||
* an undefined fold level. Otherwise update the folds first. */
|
||||
@@ -281,9 +274,7 @@ foldLevel(lnum)
|
||||
* Return MAYBE if the line is folded when next to a folded line.
|
||||
*/
|
||||
int
|
||||
lineFolded(win, lnum)
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
lineFolded(win_T *win, linenr_T lnum)
|
||||
{
|
||||
return foldedCount(win, lnum, NULL) != 0;
|
||||
}
|
||||
@@ -298,10 +289,7 @@ lineFolded(win, lnum)
|
||||
* When "infop" is not NULL, fills *infop with the fold level info.
|
||||
*/
|
||||
long
|
||||
foldedCount(win, lnum, infop)
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
foldinfo_T *infop;
|
||||
foldedCount(win_T *win, linenr_T lnum, foldinfo_T *infop)
|
||||
{
|
||||
linenr_T last;
|
||||
|
||||
@@ -315,8 +303,7 @@ foldedCount(win, lnum, infop)
|
||||
* Return TRUE if 'foldmethod' is "manual"
|
||||
*/
|
||||
int
|
||||
foldmethodIsManual(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsManual(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[3] == 'u');
|
||||
}
|
||||
@@ -326,8 +313,7 @@ foldmethodIsManual(wp)
|
||||
* Return TRUE if 'foldmethod' is "indent"
|
||||
*/
|
||||
int
|
||||
foldmethodIsIndent(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsIndent(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[0] == 'i');
|
||||
}
|
||||
@@ -337,8 +323,7 @@ foldmethodIsIndent(wp)
|
||||
* Return TRUE if 'foldmethod' is "expr"
|
||||
*/
|
||||
int
|
||||
foldmethodIsExpr(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsExpr(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[1] == 'x');
|
||||
}
|
||||
@@ -348,8 +333,7 @@ foldmethodIsExpr(wp)
|
||||
* Return TRUE if 'foldmethod' is "marker"
|
||||
*/
|
||||
int
|
||||
foldmethodIsMarker(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsMarker(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[2] == 'r');
|
||||
}
|
||||
@@ -359,8 +343,7 @@ foldmethodIsMarker(wp)
|
||||
* Return TRUE if 'foldmethod' is "syntax"
|
||||
*/
|
||||
int
|
||||
foldmethodIsSyntax(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsSyntax(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[0] == 's');
|
||||
}
|
||||
@@ -370,8 +353,7 @@ foldmethodIsSyntax(wp)
|
||||
* Return TRUE if 'foldmethod' is "diff"
|
||||
*/
|
||||
int
|
||||
foldmethodIsDiff(wp)
|
||||
win_T *wp;
|
||||
foldmethodIsDiff(win_T *wp)
|
||||
{
|
||||
return (wp->w_p_fdm[0] == 'd');
|
||||
}
|
||||
@@ -382,9 +364,7 @@ foldmethodIsDiff(wp)
|
||||
* Repeat "count" times.
|
||||
*/
|
||||
void
|
||||
closeFold(lnum, count)
|
||||
linenr_T lnum;
|
||||
long count;
|
||||
closeFold(linenr_T lnum, long count)
|
||||
{
|
||||
setFoldRepeat(lnum, count, FALSE);
|
||||
}
|
||||
@@ -394,8 +374,7 @@ closeFold(lnum, count)
|
||||
* Close fold for current window at line "lnum" recursively.
|
||||
*/
|
||||
void
|
||||
closeFoldRecurse(lnum)
|
||||
linenr_T lnum;
|
||||
closeFoldRecurse(linenr_T lnum)
|
||||
{
|
||||
(void)setManualFold(lnum, FALSE, TRUE, NULL);
|
||||
}
|
||||
@@ -406,12 +385,12 @@ closeFoldRecurse(lnum)
|
||||
* Used for "zo", "zO", "zc" and "zC" in Visual mode.
|
||||
*/
|
||||
void
|
||||
opFoldRange(first, last, opening, recurse, had_visual)
|
||||
linenr_T first;
|
||||
linenr_T last;
|
||||
int opening; /* TRUE to open, FALSE to close */
|
||||
int recurse; /* TRUE to do it recursively */
|
||||
int had_visual; /* TRUE when Visual selection used */
|
||||
opFoldRange(
|
||||
linenr_T first,
|
||||
linenr_T last,
|
||||
int opening, /* TRUE to open, FALSE to close */
|
||||
int recurse, /* TRUE to do it recursively */
|
||||
int had_visual) /* TRUE when Visual selection used */
|
||||
{
|
||||
int done = DONE_NOTHING; /* avoid error messages */
|
||||
linenr_T lnum;
|
||||
@@ -443,9 +422,7 @@ opFoldRange(first, last, opening, recurse, had_visual)
|
||||
* Repeat "count" times.
|
||||
*/
|
||||
void
|
||||
openFold(lnum, count)
|
||||
linenr_T lnum;
|
||||
long count;
|
||||
openFold(linenr_T lnum, long count)
|
||||
{
|
||||
setFoldRepeat(lnum, count, TRUE);
|
||||
}
|
||||
@@ -455,8 +432,7 @@ openFold(lnum, count)
|
||||
* Open fold for current window at line "lnum" recursively.
|
||||
*/
|
||||
void
|
||||
openFoldRecurse(lnum)
|
||||
linenr_T lnum;
|
||||
openFoldRecurse(linenr_T lnum)
|
||||
{
|
||||
(void)setManualFold(lnum, TRUE, TRUE, NULL);
|
||||
}
|
||||
@@ -466,7 +442,7 @@ openFoldRecurse(lnum)
|
||||
* Open folds until the cursor line is not in a closed fold.
|
||||
*/
|
||||
void
|
||||
foldOpenCursor()
|
||||
foldOpenCursor(void)
|
||||
{
|
||||
int done;
|
||||
|
||||
@@ -486,7 +462,7 @@ foldOpenCursor()
|
||||
* Set new foldlevel for current window.
|
||||
*/
|
||||
void
|
||||
newFoldLevel()
|
||||
newFoldLevel(void)
|
||||
{
|
||||
newFoldLevelWin(curwin);
|
||||
|
||||
@@ -511,8 +487,7 @@ newFoldLevel()
|
||||
}
|
||||
|
||||
static void
|
||||
newFoldLevelWin(wp)
|
||||
win_T *wp;
|
||||
newFoldLevelWin(win_T *wp)
|
||||
{
|
||||
fold_T *fp;
|
||||
int i;
|
||||
@@ -536,7 +511,7 @@ newFoldLevelWin(wp)
|
||||
* Apply 'foldlevel' to all folds that don't contain the cursor.
|
||||
*/
|
||||
void
|
||||
foldCheckClose()
|
||||
foldCheckClose(void)
|
||||
{
|
||||
if (*p_fcl != NUL) /* can only be "all" right now */
|
||||
{
|
||||
@@ -549,10 +524,7 @@ foldCheckClose()
|
||||
|
||||
/* checkCloseRec() {{{2 */
|
||||
static int
|
||||
checkCloseRec(gap, lnum, level)
|
||||
garray_T *gap;
|
||||
linenr_T lnum;
|
||||
int level;
|
||||
checkCloseRec(garray_T *gap, linenr_T lnum, int level)
|
||||
{
|
||||
fold_T *fp;
|
||||
int retval = FALSE;
|
||||
@@ -584,8 +556,7 @@ checkCloseRec(gap, lnum, level)
|
||||
* Give an error message and return FALSE if not.
|
||||
*/
|
||||
int
|
||||
foldManualAllowed(create)
|
||||
int create;
|
||||
foldManualAllowed(int create)
|
||||
{
|
||||
if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
|
||||
return TRUE;
|
||||
@@ -602,9 +573,7 @@ foldManualAllowed(create)
|
||||
* window.
|
||||
*/
|
||||
void
|
||||
foldCreate(start, end)
|
||||
linenr_T start;
|
||||
linenr_T end;
|
||||
foldCreate(linenr_T start, linenr_T end)
|
||||
{
|
||||
fold_T *fp;
|
||||
garray_T *gap;
|
||||
@@ -729,11 +698,11 @@ foldCreate(start, end)
|
||||
* When "recursive" is TRUE delete recursively.
|
||||
*/
|
||||
void
|
||||
deleteFold(start, end, recursive, had_visual)
|
||||
linenr_T start;
|
||||
linenr_T end;
|
||||
int recursive;
|
||||
int had_visual; /* TRUE when Visual selection used */
|
||||
deleteFold(
|
||||
linenr_T start,
|
||||
linenr_T end,
|
||||
int recursive,
|
||||
int had_visual) /* TRUE when Visual selection used */
|
||||
{
|
||||
garray_T *gap;
|
||||
fold_T *fp;
|
||||
@@ -824,8 +793,7 @@ deleteFold(start, end, recursive, had_visual)
|
||||
* Remove all folding for window "win".
|
||||
*/
|
||||
void
|
||||
clearFolding(win)
|
||||
win_T *win;
|
||||
clearFolding(win_T *win)
|
||||
{
|
||||
deleteFoldRecurse(&win->w_folds);
|
||||
win->w_foldinvalid = FALSE;
|
||||
@@ -839,10 +807,7 @@ clearFolding(win)
|
||||
* The changes in lines from top to bot (inclusive).
|
||||
*/
|
||||
void
|
||||
foldUpdate(wp, top, bot)
|
||||
win_T *wp;
|
||||
linenr_T top;
|
||||
linenr_T bot;
|
||||
foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
|
||||
{
|
||||
fold_T *fp;
|
||||
|
||||
@@ -880,8 +845,7 @@ foldUpdate(wp, top, bot)
|
||||
* every time a setting is changed or a syntax item is added.
|
||||
*/
|
||||
void
|
||||
foldUpdateAll(win)
|
||||
win_T *win;
|
||||
foldUpdateAll(win_T *win)
|
||||
{
|
||||
win->w_foldinvalid = TRUE;
|
||||
redraw_win_later(win, NOT_VALID);
|
||||
@@ -894,10 +858,10 @@ foldUpdateAll(win)
|
||||
* If not moved return FAIL.
|
||||
*/
|
||||
int
|
||||
foldMoveTo(updown, dir, count)
|
||||
int updown;
|
||||
int dir; /* FORWARD or BACKWARD */
|
||||
long count;
|
||||
foldMoveTo(
|
||||
int updown,
|
||||
int dir, /* FORWARD or BACKWARD */
|
||||
long count)
|
||||
{
|
||||
long n;
|
||||
int retval = FAIL;
|
||||
@@ -1031,8 +995,7 @@ foldMoveTo(updown, dir, count)
|
||||
* Init the fold info in a new window.
|
||||
*/
|
||||
void
|
||||
foldInitWin(new_win)
|
||||
win_T *new_win;
|
||||
foldInitWin(win_T *new_win)
|
||||
{
|
||||
ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10);
|
||||
}
|
||||
@@ -1045,9 +1008,7 @@ foldInitWin(new_win)
|
||||
* Returns index of entry or -1 if not found.
|
||||
*/
|
||||
int
|
||||
find_wl_entry(win, lnum)
|
||||
win_T *win;
|
||||
linenr_T lnum;
|
||||
find_wl_entry(win_T *win, linenr_T lnum)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1067,7 +1028,7 @@ find_wl_entry(win, lnum)
|
||||
* Adjust the Visual area to include any fold at the start or end completely.
|
||||
*/
|
||||
void
|
||||
foldAdjustVisual()
|
||||
foldAdjustVisual(void)
|
||||
{
|
||||
pos_T *start, *end;
|
||||
char_u *ptr;
|
||||
@@ -1106,7 +1067,7 @@ foldAdjustVisual()
|
||||
* Move the cursor to the first line of a closed fold.
|
||||
*/
|
||||
void
|
||||
foldAdjustCursor()
|
||||
foldAdjustCursor(void)
|
||||
{
|
||||
(void)hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL);
|
||||
}
|
||||
@@ -1119,9 +1080,7 @@ foldAdjustCursor()
|
||||
* Return FAIL if the operation cannot be completed, otherwise OK.
|
||||
*/
|
||||
void
|
||||
cloneFoldGrowArray(from, to)
|
||||
garray_T *from;
|
||||
garray_T *to;
|
||||
cloneFoldGrowArray(garray_T *from, garray_T *to)
|
||||
{
|
||||
int i;
|
||||
fold_T *from_p;
|
||||
@@ -1155,10 +1114,7 @@ cloneFoldGrowArray(from, to)
|
||||
* Returns FALSE when there is no fold that contains "lnum".
|
||||
*/
|
||||
static int
|
||||
foldFind(gap, lnum, fpp)
|
||||
garray_T *gap;
|
||||
linenr_T lnum;
|
||||
fold_T **fpp;
|
||||
foldFind(garray_T *gap, linenr_T lnum, fold_T **fpp)
|
||||
{
|
||||
linenr_T low, high;
|
||||
fold_T *fp;
|
||||
@@ -1197,9 +1153,7 @@ foldFind(gap, lnum, fpp)
|
||||
* Return fold level at line number "lnum" in window "wp".
|
||||
*/
|
||||
static int
|
||||
foldLevelWin(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
foldLevelWin(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
fold_T *fp;
|
||||
linenr_T lnum_rel = lnum;
|
||||
@@ -1226,8 +1180,7 @@ foldLevelWin(wp, lnum)
|
||||
* Check if the folds in window "wp" are invalid and update them if needed.
|
||||
*/
|
||||
static void
|
||||
checkupdate(wp)
|
||||
win_T *wp;
|
||||
checkupdate(win_T *wp)
|
||||
{
|
||||
if (wp->w_foldinvalid)
|
||||
{
|
||||
@@ -1242,10 +1195,7 @@ checkupdate(wp)
|
||||
* Repeat "count" times.
|
||||
*/
|
||||
static void
|
||||
setFoldRepeat(lnum, count, do_open)
|
||||
linenr_T lnum;
|
||||
long count;
|
||||
int do_open;
|
||||
setFoldRepeat(linenr_T lnum, long count, int do_open)
|
||||
{
|
||||
int done;
|
||||
long n;
|
||||
@@ -1270,11 +1220,11 @@ setFoldRepeat(lnum, count, do_open)
|
||||
* Also does this for other windows in diff mode when needed.
|
||||
*/
|
||||
static linenr_T
|
||||
setManualFold(lnum, opening, recurse, donep)
|
||||
linenr_T lnum;
|
||||
int opening; /* TRUE when opening, FALSE when closing */
|
||||
int recurse; /* TRUE when closing/opening recursive */
|
||||
int *donep;
|
||||
setManualFold(
|
||||
linenr_T lnum,
|
||||
int opening, /* TRUE when opening, FALSE when closing */
|
||||
int recurse, /* TRUE when closing/opening recursive */
|
||||
int *donep)
|
||||
{
|
||||
#ifdef FEAT_DIFF
|
||||
if (foldmethodIsDiff(curwin) && curwin->w_p_scb)
|
||||
@@ -1312,12 +1262,12 @@ setManualFold(lnum, opening, recurse, donep)
|
||||
* It's only valid when "opening" is TRUE!
|
||||
*/
|
||||
static linenr_T
|
||||
setManualFoldWin(wp, lnum, opening, recurse, donep)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
int opening; /* TRUE when opening, FALSE when closing */
|
||||
int recurse; /* TRUE when closing/opening recursive */
|
||||
int *donep;
|
||||
setManualFoldWin(
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
int opening, /* TRUE when opening, FALSE when closing */
|
||||
int recurse, /* TRUE when closing/opening recursive */
|
||||
int *donep)
|
||||
{
|
||||
fold_T *fp;
|
||||
fold_T *fp2;
|
||||
@@ -1423,8 +1373,7 @@ setManualFoldWin(wp, lnum, opening, recurse, donep)
|
||||
* Open all nested folds in fold "fpr" recursively.
|
||||
*/
|
||||
static void
|
||||
foldOpenNested(fpr)
|
||||
fold_T *fpr;
|
||||
foldOpenNested(fold_T *fpr)
|
||||
{
|
||||
int i;
|
||||
fold_T *fp;
|
||||
@@ -1444,10 +1393,7 @@ foldOpenNested(fpr)
|
||||
* When "recursive" is FALSE contained folds are moved one level up.
|
||||
*/
|
||||
static void
|
||||
deleteFoldEntry(gap, idx, recursive)
|
||||
garray_T *gap;
|
||||
int idx;
|
||||
int recursive;
|
||||
deleteFoldEntry(garray_T *gap, int idx, int recursive)
|
||||
{
|
||||
fold_T *fp;
|
||||
int i;
|
||||
@@ -1501,8 +1447,7 @@ deleteFoldEntry(gap, idx, recursive)
|
||||
* Delete nested folds in a fold.
|
||||
*/
|
||||
void
|
||||
deleteFoldRecurse(gap)
|
||||
garray_T *gap;
|
||||
deleteFoldRecurse(garray_T *gap)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1516,12 +1461,12 @@ deleteFoldRecurse(gap)
|
||||
* Update line numbers of folds for inserted/deleted lines.
|
||||
*/
|
||||
void
|
||||
foldMarkAdjust(wp, line1, line2, amount, amount_after)
|
||||
win_T *wp;
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
foldMarkAdjust(
|
||||
win_T *wp,
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
/* If deleting marks from line1 to line2, but not deleting all those
|
||||
* lines, set line2 so that only deleted lines have their folds removed. */
|
||||
@@ -1536,12 +1481,12 @@ foldMarkAdjust(wp, line1, line2, amount, amount_after)
|
||||
|
||||
/* foldMarkAdjustRecurse() {{{2 */
|
||||
static void
|
||||
foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
|
||||
garray_T *gap;
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
foldMarkAdjustRecurse(
|
||||
garray_T *gap,
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
fold_T *fp;
|
||||
int i;
|
||||
@@ -1653,15 +1598,14 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
|
||||
* current window open.
|
||||
*/
|
||||
int
|
||||
getDeepestNesting()
|
||||
getDeepestNesting(void)
|
||||
{
|
||||
checkupdate(curwin);
|
||||
return getDeepestNestingRecurse(&curwin->w_folds);
|
||||
}
|
||||
|
||||
static int
|
||||
getDeepestNestingRecurse(gap)
|
||||
garray_T *gap;
|
||||
getDeepestNestingRecurse(garray_T *gap)
|
||||
{
|
||||
int i;
|
||||
int level;
|
||||
@@ -1684,13 +1628,13 @@ getDeepestNestingRecurse(gap)
|
||||
* Check if a fold is closed and update the info needed to check nested folds.
|
||||
*/
|
||||
static int
|
||||
check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off)
|
||||
win_T *win;
|
||||
fold_T *fp;
|
||||
int *use_levelp; /* TRUE: outer fold had FD_LEVEL */
|
||||
int level; /* folding depth */
|
||||
int *maybe_smallp; /* TRUE: outer this had fd_small == MAYBE */
|
||||
linenr_T lnum_off; /* line number offset for fp->fd_top */
|
||||
check_closed(
|
||||
win_T *win,
|
||||
fold_T *fp,
|
||||
int *use_levelp, /* TRUE: outer fold had FD_LEVEL */
|
||||
int level, /* folding depth */
|
||||
int *maybe_smallp, /* TRUE: outer this had fd_small == MAYBE */
|
||||
linenr_T lnum_off) /* line number offset for fp->fd_top */
|
||||
{
|
||||
int closed = FALSE;
|
||||
|
||||
@@ -1724,10 +1668,10 @@ check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off)
|
||||
* Update fd_small field of fold "fp".
|
||||
*/
|
||||
static void
|
||||
checkSmall(wp, fp, lnum_off)
|
||||
win_T *wp;
|
||||
fold_T *fp;
|
||||
linenr_T lnum_off; /* offset for fp->fd_top */
|
||||
checkSmall(
|
||||
win_T *wp,
|
||||
fold_T *fp,
|
||||
linenr_T lnum_off) /* offset for fp->fd_top */
|
||||
{
|
||||
int count;
|
||||
int n;
|
||||
@@ -1761,8 +1705,7 @@ checkSmall(wp, fp, lnum_off)
|
||||
* Set small flags in "gap" to MAYBE.
|
||||
*/
|
||||
static void
|
||||
setSmallMaybe(gap)
|
||||
garray_T *gap;
|
||||
setSmallMaybe(garray_T *gap)
|
||||
{
|
||||
int i;
|
||||
fold_T *fp;
|
||||
@@ -1778,9 +1721,7 @@ setSmallMaybe(gap)
|
||||
* window by adding markers.
|
||||
*/
|
||||
static void
|
||||
foldCreateMarkers(start, end)
|
||||
linenr_T start;
|
||||
linenr_T end;
|
||||
foldCreateMarkers(linenr_T start, linenr_T end)
|
||||
{
|
||||
if (!curbuf->b_p_ma)
|
||||
{
|
||||
@@ -1802,10 +1743,7 @@ foldCreateMarkers(start, end)
|
||||
* Add "marker[markerlen]" in 'commentstring' to line "lnum".
|
||||
*/
|
||||
static void
|
||||
foldAddMarker(lnum, marker, markerlen)
|
||||
linenr_T lnum;
|
||||
char_u *marker;
|
||||
int markerlen;
|
||||
foldAddMarker(linenr_T lnum, char_u *marker, int markerlen)
|
||||
{
|
||||
char_u *cms = curbuf->b_p_cms;
|
||||
char_u *line;
|
||||
@@ -1841,10 +1779,10 @@ foldAddMarker(lnum, marker, markerlen)
|
||||
* Delete the markers for a fold, causing it to be deleted.
|
||||
*/
|
||||
static void
|
||||
deleteFoldMarkers(fp, recursive, lnum_off)
|
||||
fold_T *fp;
|
||||
int recursive;
|
||||
linenr_T lnum_off; /* offset for fp->fd_top */
|
||||
deleteFoldMarkers(
|
||||
fold_T *fp,
|
||||
int recursive,
|
||||
linenr_T lnum_off) /* offset for fp->fd_top */
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1865,10 +1803,7 @@ deleteFoldMarkers(fp, recursive, lnum_off)
|
||||
* close-marker.
|
||||
*/
|
||||
static void
|
||||
foldDelMarker(lnum, marker, markerlen)
|
||||
linenr_T lnum;
|
||||
char_u *marker;
|
||||
int markerlen;
|
||||
foldDelMarker(linenr_T lnum, char_u *marker, int markerlen)
|
||||
{
|
||||
char_u *line;
|
||||
char_u *newline;
|
||||
@@ -1919,11 +1854,12 @@ foldDelMarker(lnum, marker, markerlen)
|
||||
* result is in allocated memory.
|
||||
*/
|
||||
char_u *
|
||||
get_foldtext(wp, lnum, lnume, foldinfo, buf)
|
||||
win_T *wp;
|
||||
linenr_T lnum, lnume;
|
||||
foldinfo_T *foldinfo;
|
||||
char_u *buf;
|
||||
get_foldtext(
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
linenr_T lnume,
|
||||
foldinfo_T *foldinfo,
|
||||
char_u *buf)
|
||||
{
|
||||
char_u *text = NULL;
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -2033,8 +1969,7 @@ get_foldtext(wp, lnum, lnume, foldinfo, buf)
|
||||
* Remove 'foldmarker' and 'commentstring' from "str" (in-place).
|
||||
*/
|
||||
void
|
||||
foldtext_cleanup(str)
|
||||
char_u *str;
|
||||
foldtext_cleanup(char_u *str)
|
||||
{
|
||||
char_u *cms_start; /* first part or the whole comment */
|
||||
int cms_slen = 0; /* length of cms_start */
|
||||
@@ -2161,10 +2096,7 @@ static void foldlevelSyntax(fline_T *flp);
|
||||
* Return TRUE if any folds did change.
|
||||
*/
|
||||
static void
|
||||
foldUpdateIEMS(wp, top, bot)
|
||||
win_T *wp;
|
||||
linenr_T top;
|
||||
linenr_T bot;
|
||||
foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot)
|
||||
{
|
||||
linenr_T start;
|
||||
linenr_T end;
|
||||
@@ -2417,14 +2349,14 @@ foldUpdateIEMS(wp, top, bot)
|
||||
* updated as a result of a detected change in the fold.
|
||||
*/
|
||||
static linenr_T
|
||||
foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
|
||||
garray_T *gap;
|
||||
int level;
|
||||
linenr_T startlnum;
|
||||
fline_T *flp;
|
||||
void (*getlevel)(fline_T *);
|
||||
linenr_T bot;
|
||||
int topflags; /* flags used by containing fold */
|
||||
foldUpdateIEMSRecurse(
|
||||
garray_T *gap,
|
||||
int level,
|
||||
linenr_T startlnum,
|
||||
fline_T *flp,
|
||||
void (*getlevel)(fline_T *),
|
||||
linenr_T bot,
|
||||
int topflags) /* flags used by containing fold */
|
||||
{
|
||||
linenr_T ll;
|
||||
fold_T *fp = NULL;
|
||||
@@ -2831,9 +2763,7 @@ foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
|
||||
* Returns OK for success, FAIL for failure.
|
||||
*/
|
||||
static int
|
||||
foldInsert(gap, i)
|
||||
garray_T *gap;
|
||||
int i;
|
||||
foldInsert(garray_T *gap, int i)
|
||||
{
|
||||
fold_T *fp;
|
||||
|
||||
@@ -2856,11 +2786,11 @@ foldInsert(gap, i)
|
||||
* "bot"!
|
||||
*/
|
||||
static void
|
||||
foldSplit(gap, i, top, bot)
|
||||
garray_T *gap;
|
||||
int i;
|
||||
linenr_T top;
|
||||
linenr_T bot;
|
||||
foldSplit(
|
||||
garray_T *gap,
|
||||
int i,
|
||||
linenr_T top,
|
||||
linenr_T bot)
|
||||
{
|
||||
fold_T *fp;
|
||||
fold_T *fp2;
|
||||
@@ -2920,10 +2850,7 @@ foldSplit(gap, i, top, bot)
|
||||
* 6: not changed
|
||||
*/
|
||||
static void
|
||||
foldRemove(gap, top, bot)
|
||||
garray_T *gap;
|
||||
linenr_T top;
|
||||
linenr_T bot;
|
||||
foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
|
||||
{
|
||||
fold_T *fp = NULL;
|
||||
|
||||
@@ -2986,10 +2913,7 @@ foldRemove(gap, top, bot)
|
||||
* Fold entry "fp2" in "gap" is deleted.
|
||||
*/
|
||||
static void
|
||||
foldMerge(fp1, gap, fp2)
|
||||
fold_T *fp1;
|
||||
garray_T *gap;
|
||||
fold_T *fp2;
|
||||
foldMerge(fold_T *fp1, garray_T *gap, fold_T *fp2)
|
||||
{
|
||||
fold_T *fp3;
|
||||
fold_T *fp4;
|
||||
@@ -3027,8 +2951,7 @@ foldMerge(fp1, gap, fp2)
|
||||
* Returns a level of -1 if the foldlevel depends on surrounding lines.
|
||||
*/
|
||||
static void
|
||||
foldlevelIndent(flp)
|
||||
fline_T *flp;
|
||||
foldlevelIndent(fline_T *flp)
|
||||
{
|
||||
char_u *s;
|
||||
buf_T *buf;
|
||||
@@ -3064,8 +2987,7 @@ foldlevelIndent(flp)
|
||||
* Doesn't use any caching.
|
||||
*/
|
||||
static void
|
||||
foldlevelDiff(flp)
|
||||
fline_T *flp;
|
||||
foldlevelDiff(fline_T *flp)
|
||||
{
|
||||
if (diff_infold(flp->wp, flp->lnum + flp->off))
|
||||
flp->lvl = 1;
|
||||
@@ -3081,8 +3003,7 @@ foldlevelDiff(flp)
|
||||
* Returns a level of -1 if the foldlevel depends on surrounding lines.
|
||||
*/
|
||||
static void
|
||||
foldlevelExpr(flp)
|
||||
fline_T *flp;
|
||||
foldlevelExpr(fline_T *flp)
|
||||
{
|
||||
#ifndef FEAT_EVAL
|
||||
flp->start = FALSE;
|
||||
@@ -3184,8 +3105,7 @@ foldlevelExpr(flp)
|
||||
* Relies on the option value to have been checked for correctness already.
|
||||
*/
|
||||
static void
|
||||
parseMarker(wp)
|
||||
win_T *wp;
|
||||
parseMarker(win_T *wp)
|
||||
{
|
||||
foldendmarker = vim_strchr(wp->w_p_fmr, ',');
|
||||
foldstartmarkerlen = (int)(foldendmarker++ - wp->w_p_fmr);
|
||||
@@ -3203,8 +3123,7 @@ parseMarker(wp)
|
||||
* Sets flp->start when a start marker was found.
|
||||
*/
|
||||
static void
|
||||
foldlevelMarker(flp)
|
||||
fline_T *flp;
|
||||
foldlevelMarker(fline_T *flp)
|
||||
{
|
||||
char_u *startmarker;
|
||||
int cstart;
|
||||
@@ -3286,8 +3205,7 @@ foldlevelMarker(flp)
|
||||
* Doesn't use any caching.
|
||||
*/
|
||||
static void
|
||||
foldlevelSyntax(flp)
|
||||
fline_T *flp;
|
||||
foldlevelSyntax(fline_T *flp)
|
||||
{
|
||||
#ifndef FEAT_SYN_HL
|
||||
flp->start = 0;
|
||||
@@ -3323,9 +3241,7 @@ static int put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off);
|
||||
* Return FAIL if writing fails.
|
||||
*/
|
||||
int
|
||||
put_folds(fd, wp)
|
||||
FILE *fd;
|
||||
win_T *wp;
|
||||
put_folds(FILE *fd, win_T *wp)
|
||||
{
|
||||
if (foldmethodIsManual(wp))
|
||||
{
|
||||
@@ -3347,10 +3263,7 @@ put_folds(fd, wp)
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_folds_recurse(fd, gap, off)
|
||||
FILE *fd;
|
||||
garray_T *gap;
|
||||
linenr_T off;
|
||||
put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off)
|
||||
{
|
||||
int i;
|
||||
fold_T *fp;
|
||||
@@ -3376,11 +3289,11 @@ put_folds_recurse(fd, gap, off)
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_foldopen_recurse(fd, wp, gap, off)
|
||||
FILE *fd;
|
||||
win_T *wp;
|
||||
garray_T *gap;
|
||||
linenr_T off;
|
||||
put_foldopen_recurse(
|
||||
FILE *fd,
|
||||
win_T *wp,
|
||||
garray_T *gap,
|
||||
linenr_T off)
|
||||
{
|
||||
int i;
|
||||
int level;
|
||||
@@ -3433,10 +3346,7 @@ put_foldopen_recurse(fd, wp, gap, off)
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_fold_open_close(fd, fp, off)
|
||||
FILE *fd;
|
||||
fold_T *fp;
|
||||
linenr_T off;
|
||||
put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off)
|
||||
{
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|
||||
+166
-223
@@ -137,8 +137,7 @@ static char_u *eval_map_expr(char_u *str, int c);
|
||||
* Free and clear a buffer.
|
||||
*/
|
||||
void
|
||||
free_buff(buf)
|
||||
buffheader_T *buf;
|
||||
free_buff(buffheader_T *buf)
|
||||
{
|
||||
buffblock_T *p, *np;
|
||||
|
||||
@@ -155,9 +154,9 @@ free_buff(buf)
|
||||
* K_SPECIAL and CSI in the returned string are escaped.
|
||||
*/
|
||||
static char_u *
|
||||
get_buffcont(buffer, dozero)
|
||||
buffheader_T *buffer;
|
||||
int dozero; /* count == zero is not an error */
|
||||
get_buffcont(
|
||||
buffheader_T *buffer,
|
||||
int dozero) /* count == zero is not an error */
|
||||
{
|
||||
long_u count = 0;
|
||||
char_u *p = NULL;
|
||||
@@ -186,7 +185,7 @@ get_buffcont(buffer, dozero)
|
||||
* K_SPECIAL and CSI in the returned string are escaped.
|
||||
*/
|
||||
char_u *
|
||||
get_recorded()
|
||||
get_recorded(void)
|
||||
{
|
||||
char_u *p;
|
||||
size_t len;
|
||||
@@ -220,7 +219,7 @@ get_recorded()
|
||||
* K_SPECIAL and CSI in the returned string are escaped.
|
||||
*/
|
||||
char_u *
|
||||
get_inserted()
|
||||
get_inserted(void)
|
||||
{
|
||||
return get_buffcont(&redobuff, FALSE);
|
||||
}
|
||||
@@ -230,10 +229,10 @@ get_inserted()
|
||||
* K_SPECIAL and CSI should have been escaped already.
|
||||
*/
|
||||
static void
|
||||
add_buff(buf, s, slen)
|
||||
buffheader_T *buf;
|
||||
char_u *s;
|
||||
long slen; /* length of "s" or -1 */
|
||||
add_buff(
|
||||
buffheader_T *buf,
|
||||
char_u *s,
|
||||
long slen) /* length of "s" or -1 */
|
||||
{
|
||||
buffblock_T *p;
|
||||
long_u len;
|
||||
@@ -289,9 +288,7 @@ add_buff(buf, s, slen)
|
||||
* Add number "n" to buffer "buf".
|
||||
*/
|
||||
static void
|
||||
add_num_buff(buf, n)
|
||||
buffheader_T *buf;
|
||||
long n;
|
||||
add_num_buff(buffheader_T *buf, long n)
|
||||
{
|
||||
char_u number[32];
|
||||
|
||||
@@ -304,9 +301,7 @@ add_num_buff(buf, n)
|
||||
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
|
||||
*/
|
||||
static void
|
||||
add_char_buff(buf, c)
|
||||
buffheader_T *buf;
|
||||
int c;
|
||||
add_char_buff(buffheader_T *buf, int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u bytes[MB_MAXBYTES + 1];
|
||||
@@ -368,8 +363,7 @@ static buffheader_T readbuf2 = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
* No translation is done K_SPECIAL and CSI are escaped.
|
||||
*/
|
||||
static int
|
||||
read_readbuffers(advance)
|
||||
int advance;
|
||||
read_readbuffers(int advance)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -380,9 +374,7 @@ read_readbuffers(advance)
|
||||
}
|
||||
|
||||
static int
|
||||
read_readbuf(buf, advance)
|
||||
buffheader_T *buf;
|
||||
int advance;
|
||||
read_readbuf(buffheader_T *buf, int advance)
|
||||
{
|
||||
char_u c;
|
||||
buffblock_T *curr;
|
||||
@@ -409,7 +401,7 @@ read_readbuf(buf, advance)
|
||||
* Prepare the read buffers for reading (if they contain something).
|
||||
*/
|
||||
static void
|
||||
start_stuff()
|
||||
start_stuff(void)
|
||||
{
|
||||
if (readbuf1.bh_first.b_next != NULL)
|
||||
{
|
||||
@@ -427,7 +419,7 @@ start_stuff()
|
||||
* Return TRUE if the stuff buffer is empty.
|
||||
*/
|
||||
int
|
||||
stuff_empty()
|
||||
stuff_empty(void)
|
||||
{
|
||||
return (readbuf1.bh_first.b_next == NULL
|
||||
&& readbuf2.bh_first.b_next == NULL);
|
||||
@@ -438,7 +430,7 @@ stuff_empty()
|
||||
* redbuf2.
|
||||
*/
|
||||
int
|
||||
readbuf1_empty()
|
||||
readbuf1_empty(void)
|
||||
{
|
||||
return (readbuf1.bh_first.b_next == NULL);
|
||||
}
|
||||
@@ -447,8 +439,7 @@ readbuf1_empty()
|
||||
* Set a typeahead character that won't be flushed.
|
||||
*/
|
||||
void
|
||||
typeahead_noflush(c)
|
||||
int c;
|
||||
typeahead_noflush(int c)
|
||||
{
|
||||
typeahead_char = c;
|
||||
}
|
||||
@@ -459,8 +450,7 @@ typeahead_noflush(c)
|
||||
* flush all typeahead characters (used when interrupted by a CTRL-C).
|
||||
*/
|
||||
void
|
||||
flush_buffers(flush_typeahead)
|
||||
int flush_typeahead;
|
||||
flush_buffers(int flush_typeahead)
|
||||
{
|
||||
init_typebuf();
|
||||
|
||||
@@ -497,7 +487,7 @@ flush_buffers(flush_typeahead)
|
||||
* This is used for the CTRL-O <.> command in insert mode.
|
||||
*/
|
||||
void
|
||||
ResetRedobuff()
|
||||
ResetRedobuff(void)
|
||||
{
|
||||
if (!block_redo)
|
||||
{
|
||||
@@ -512,7 +502,7 @@ ResetRedobuff()
|
||||
* buffer.
|
||||
*/
|
||||
void
|
||||
CancelRedo()
|
||||
CancelRedo(void)
|
||||
{
|
||||
if (!block_redo)
|
||||
{
|
||||
@@ -533,7 +523,7 @@ CancelRedo()
|
||||
static int save_level = 0;
|
||||
|
||||
void
|
||||
saveRedobuff()
|
||||
saveRedobuff(void)
|
||||
{
|
||||
char_u *s;
|
||||
|
||||
@@ -559,7 +549,7 @@ saveRedobuff()
|
||||
* Used after executing autocommands and user functions.
|
||||
*/
|
||||
void
|
||||
restoreRedobuff()
|
||||
restoreRedobuff(void)
|
||||
{
|
||||
if (--save_level == 0)
|
||||
{
|
||||
@@ -576,8 +566,7 @@ restoreRedobuff()
|
||||
* K_SPECIAL and CSI should already have been escaped.
|
||||
*/
|
||||
void
|
||||
AppendToRedobuff(s)
|
||||
char_u *s;
|
||||
AppendToRedobuff(char_u *s)
|
||||
{
|
||||
if (!block_redo)
|
||||
add_buff(&redobuff, s, -1L);
|
||||
@@ -588,9 +577,9 @@ AppendToRedobuff(s)
|
||||
* K_SPECIAL and CSI are escaped as well.
|
||||
*/
|
||||
void
|
||||
AppendToRedobuffLit(str, len)
|
||||
char_u *str;
|
||||
int len; /* length of "str" or -1 for up to the NUL */
|
||||
AppendToRedobuffLit(
|
||||
char_u *str,
|
||||
int len) /* length of "str" or -1 for up to the NUL */
|
||||
{
|
||||
char_u *s = str;
|
||||
int c;
|
||||
@@ -649,8 +638,7 @@ AppendToRedobuffLit(str, len)
|
||||
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
|
||||
*/
|
||||
void
|
||||
AppendCharToRedobuff(c)
|
||||
int c;
|
||||
AppendCharToRedobuff(int c)
|
||||
{
|
||||
if (!block_redo)
|
||||
add_char_buff(&redobuff, c);
|
||||
@@ -660,8 +648,7 @@ AppendCharToRedobuff(c)
|
||||
* Append a number to the redo buffer.
|
||||
*/
|
||||
void
|
||||
AppendNumberToRedobuff(n)
|
||||
long n;
|
||||
AppendNumberToRedobuff(long n)
|
||||
{
|
||||
if (!block_redo)
|
||||
add_num_buff(&redobuff, n);
|
||||
@@ -672,8 +659,7 @@ AppendNumberToRedobuff(n)
|
||||
* CSI and K_SPECIAL must already have been escaped.
|
||||
*/
|
||||
void
|
||||
stuffReadbuff(s)
|
||||
char_u *s;
|
||||
stuffReadbuff(char_u *s)
|
||||
{
|
||||
add_buff(&readbuf1, s, -1L);
|
||||
}
|
||||
@@ -683,16 +669,13 @@ stuffReadbuff(s)
|
||||
* CSI and K_SPECIAL must already have been escaped.
|
||||
*/
|
||||
void
|
||||
stuffRedoReadbuff(s)
|
||||
char_u *s;
|
||||
stuffRedoReadbuff(char_u *s)
|
||||
{
|
||||
add_buff(&readbuf2, s, -1L);
|
||||
}
|
||||
|
||||
void
|
||||
stuffReadbuffLen(s, len)
|
||||
char_u *s;
|
||||
long len;
|
||||
stuffReadbuffLen(char_u *s, long len)
|
||||
{
|
||||
add_buff(&readbuf1, s, len);
|
||||
}
|
||||
@@ -704,8 +687,7 @@ stuffReadbuffLen(s, len)
|
||||
* Change CR, LF and ESC into a space.
|
||||
*/
|
||||
void
|
||||
stuffReadbuffSpec(s)
|
||||
char_u *s;
|
||||
stuffReadbuffSpec(char_u *s)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -737,8 +719,7 @@ stuffReadbuffSpec(s)
|
||||
* Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
|
||||
*/
|
||||
void
|
||||
stuffcharReadbuff(c)
|
||||
int c;
|
||||
stuffcharReadbuff(int c)
|
||||
{
|
||||
add_char_buff(&readbuf1, c);
|
||||
}
|
||||
@@ -747,8 +728,7 @@ stuffcharReadbuff(c)
|
||||
* Append a number to the stuff buffer.
|
||||
*/
|
||||
void
|
||||
stuffnumReadbuff(n)
|
||||
long n;
|
||||
stuffnumReadbuff(long n)
|
||||
{
|
||||
add_num_buff(&readbuf1, n);
|
||||
}
|
||||
@@ -762,9 +742,7 @@ stuffnumReadbuff(n)
|
||||
* If old is TRUE, use old_redobuff instead of redobuff.
|
||||
*/
|
||||
static int
|
||||
read_redo(init, old_redo)
|
||||
int init;
|
||||
int old_redo;
|
||||
read_redo(int init, int old_redo)
|
||||
{
|
||||
static buffblock_T *bp;
|
||||
static char_u *p;
|
||||
@@ -837,8 +815,7 @@ read_redo(init, old_redo)
|
||||
* The escaped K_SPECIAL and CSI are copied without translation.
|
||||
*/
|
||||
static void
|
||||
copy_redo(old_redo)
|
||||
int old_redo;
|
||||
copy_redo(int old_redo)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -856,9 +833,7 @@ copy_redo(old_redo)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
start_redo(count, old_redo)
|
||||
long count;
|
||||
int old_redo;
|
||||
start_redo(long count, int old_redo)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -911,7 +886,7 @@ start_redo(count, old_redo)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
start_redo_ins()
|
||||
start_redo_ins(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -937,7 +912,7 @@ start_redo_ins()
|
||||
}
|
||||
|
||||
void
|
||||
stop_redo_ins()
|
||||
stop_redo_ins(void)
|
||||
{
|
||||
block_redo = FALSE;
|
||||
}
|
||||
@@ -948,7 +923,7 @@ stop_redo_ins()
|
||||
* be impossible to type anything.
|
||||
*/
|
||||
static void
|
||||
init_typebuf()
|
||||
init_typebuf(void)
|
||||
{
|
||||
if (typebuf.tb_buf == NULL)
|
||||
{
|
||||
@@ -981,12 +956,12 @@ init_typebuf()
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
ins_typebuf(str, noremap, offset, nottyped, silent)
|
||||
char_u *str;
|
||||
int noremap;
|
||||
int offset;
|
||||
int nottyped;
|
||||
int silent;
|
||||
ins_typebuf(
|
||||
char_u *str,
|
||||
int noremap,
|
||||
int offset,
|
||||
int nottyped,
|
||||
int silent)
|
||||
{
|
||||
char_u *s1, *s2;
|
||||
int newlen;
|
||||
@@ -1114,8 +1089,7 @@ ins_typebuf(str, noremap, offset, nottyped, silent)
|
||||
* the char.
|
||||
*/
|
||||
void
|
||||
ins_char_typebuf(c)
|
||||
int c;
|
||||
ins_char_typebuf(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
@@ -1151,8 +1125,8 @@ ins_char_typebuf(c)
|
||||
* that was just added.
|
||||
*/
|
||||
int
|
||||
typebuf_changed(tb_change_cnt)
|
||||
int tb_change_cnt; /* old value of typebuf.tb_change_cnt */
|
||||
typebuf_changed(
|
||||
int tb_change_cnt) /* old value of typebuf.tb_change_cnt */
|
||||
{
|
||||
return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt
|
||||
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
|
||||
@@ -1166,7 +1140,7 @@ typebuf_changed(tb_change_cnt)
|
||||
* not been typed (result from a mapping or come from ":normal").
|
||||
*/
|
||||
int
|
||||
typebuf_typed()
|
||||
typebuf_typed(void)
|
||||
{
|
||||
return typebuf.tb_maplen == 0;
|
||||
}
|
||||
@@ -1175,7 +1149,7 @@ typebuf_typed()
|
||||
* Return the number of characters that are mapped (or not typed).
|
||||
*/
|
||||
int
|
||||
typebuf_maplen()
|
||||
typebuf_maplen(void)
|
||||
{
|
||||
return typebuf.tb_maplen;
|
||||
}
|
||||
@@ -1184,9 +1158,7 @@ typebuf_maplen()
|
||||
* remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset]
|
||||
*/
|
||||
void
|
||||
del_typebuf(len, offset)
|
||||
int len;
|
||||
int offset;
|
||||
del_typebuf(int len, int offset)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1264,9 +1236,7 @@ del_typebuf(len, offset)
|
||||
* If recording is on put the character in the recordbuffer.
|
||||
*/
|
||||
static void
|
||||
gotchars(chars, len)
|
||||
char_u *chars;
|
||||
int len;
|
||||
gotchars(char_u *chars, int len)
|
||||
{
|
||||
char_u *s = chars;
|
||||
int c;
|
||||
@@ -1311,7 +1281,7 @@ gotchars(chars, len)
|
||||
* - When no_u_sync is non-zero.
|
||||
*/
|
||||
static void
|
||||
may_sync_undo()
|
||||
may_sync_undo(void)
|
||||
{
|
||||
if ((!(State & (INSERT + CMDLINE)) || arrow_used)
|
||||
&& scriptin[curscript] == NULL)
|
||||
@@ -1323,7 +1293,7 @@ may_sync_undo()
|
||||
* Returns FAIL when out of memory.
|
||||
*/
|
||||
int
|
||||
alloc_typebuf()
|
||||
alloc_typebuf(void)
|
||||
{
|
||||
typebuf.tb_buf = alloc(TYPELEN_INIT);
|
||||
typebuf.tb_noremap = alloc(TYPELEN_INIT);
|
||||
@@ -1347,7 +1317,7 @@ alloc_typebuf()
|
||||
* Free the buffers of "typebuf".
|
||||
*/
|
||||
void
|
||||
free_typebuf()
|
||||
free_typebuf(void)
|
||||
{
|
||||
if (typebuf.tb_buf == typebuf_init)
|
||||
EMSG2(_(e_intern2), "Free typebuf 1");
|
||||
@@ -1366,7 +1336,7 @@ free_typebuf()
|
||||
static typebuf_T saved_typebuf[NSCRIPT];
|
||||
|
||||
int
|
||||
save_typebuf()
|
||||
save_typebuf(void)
|
||||
{
|
||||
init_typebuf();
|
||||
saved_typebuf[curscript] = typebuf;
|
||||
@@ -1386,14 +1356,11 @@ static int old_mouse_row; /* mouse_row related to old_char */
|
||||
static int old_mouse_col; /* mouse_col related to old_char */
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Save all three kinds of typeahead, so that the user must type at a prompt.
|
||||
*/
|
||||
void
|
||||
save_typeahead(tp)
|
||||
tasave_T *tp;
|
||||
save_typeahead(tasave_T *tp)
|
||||
{
|
||||
tp->save_typebuf = typebuf;
|
||||
tp->typebuf_valid = (alloc_typebuf() == OK);
|
||||
@@ -1418,8 +1385,7 @@ save_typeahead(tp)
|
||||
* The allocated memory is freed, can only be called once!
|
||||
*/
|
||||
void
|
||||
restore_typeahead(tp)
|
||||
tasave_T *tp;
|
||||
restore_typeahead(tasave_T *tp)
|
||||
{
|
||||
if (tp->typebuf_valid)
|
||||
{
|
||||
@@ -1438,15 +1404,14 @@ restore_typeahead(tp)
|
||||
set_input_buf(tp->save_inputbuf);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Open a new script file for the ":source!" command.
|
||||
*/
|
||||
void
|
||||
openscript(name, directly)
|
||||
char_u *name;
|
||||
int directly; /* when TRUE execute directly */
|
||||
openscript(
|
||||
char_u *name,
|
||||
int directly) /* when TRUE execute directly */
|
||||
{
|
||||
if (curscript + 1 == NSCRIPT)
|
||||
{
|
||||
@@ -1517,7 +1482,7 @@ openscript(name, directly)
|
||||
* Close the currently active input script.
|
||||
*/
|
||||
static void
|
||||
closescript()
|
||||
closescript(void)
|
||||
{
|
||||
free_typebuf();
|
||||
typebuf = saved_typebuf[curscript];
|
||||
@@ -1530,7 +1495,7 @@ closescript()
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
close_all_scripts()
|
||||
close_all_scripts(void)
|
||||
{
|
||||
while (scriptin[0] != NULL)
|
||||
closescript();
|
||||
@@ -1542,7 +1507,7 @@ close_all_scripts()
|
||||
* Return TRUE when reading keys from a script file.
|
||||
*/
|
||||
int
|
||||
using_script()
|
||||
using_script(void)
|
||||
{
|
||||
return scriptin[curscript] != NULL;
|
||||
}
|
||||
@@ -1553,7 +1518,7 @@ using_script()
|
||||
* waiting 'updatetime' for a character to arrive.
|
||||
*/
|
||||
void
|
||||
before_blocking()
|
||||
before_blocking(void)
|
||||
{
|
||||
updatescript(0);
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -1570,8 +1535,7 @@ before_blocking()
|
||||
* characters reaches 'updatecount' and 'updatecount' is non-zero.
|
||||
*/
|
||||
void
|
||||
updatescript(c)
|
||||
int c;
|
||||
updatescript(int c)
|
||||
{
|
||||
static int count = 0;
|
||||
|
||||
@@ -1594,7 +1558,7 @@ updatescript(c)
|
||||
* Returns the modifiers in the global "mod_mask".
|
||||
*/
|
||||
int
|
||||
vgetc()
|
||||
vgetc(void)
|
||||
{
|
||||
int c, c2;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -1839,7 +1803,7 @@ vgetc()
|
||||
* directly from the user (ignoring typeahead).
|
||||
*/
|
||||
int
|
||||
safe_vgetc()
|
||||
safe_vgetc(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -1854,7 +1818,7 @@ safe_vgetc()
|
||||
* Also ignore scrollbar events.
|
||||
*/
|
||||
int
|
||||
plain_vgetc()
|
||||
plain_vgetc(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -1871,7 +1835,7 @@ plain_vgetc()
|
||||
* character is not valid!.
|
||||
*/
|
||||
int
|
||||
vpeekc()
|
||||
vpeekc(void)
|
||||
{
|
||||
if (old_char != -1)
|
||||
return old_char;
|
||||
@@ -1884,7 +1848,7 @@ vpeekc()
|
||||
* codes.
|
||||
*/
|
||||
int
|
||||
vpeekc_nomap()
|
||||
vpeekc_nomap(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -1904,7 +1868,7 @@ vpeekc_nomap()
|
||||
* buffer, it must be an ESC that is recognized as the start of a key code.
|
||||
*/
|
||||
int
|
||||
vpeekc_any()
|
||||
vpeekc_any(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -1920,19 +1884,27 @@ vpeekc_any()
|
||||
* Return TRUE if a character is available, FALSE otherwise.
|
||||
*/
|
||||
int
|
||||
char_avail()
|
||||
char_avail(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
/* When disable_char_avail_for_testing(1) was called pretend there is no
|
||||
* typeahead. */
|
||||
if (disable_char_avail_for_testing)
|
||||
return FALSE;
|
||||
#endif
|
||||
++no_mapping;
|
||||
retval = vpeekc();
|
||||
--no_mapping;
|
||||
return (retval != NUL);
|
||||
}
|
||||
|
||||
/*
|
||||
* unget one character (can only be done once!)
|
||||
*/
|
||||
void
|
||||
vungetc(c) /* unget one character (can only be done once!) */
|
||||
int c;
|
||||
vungetc(int c)
|
||||
{
|
||||
old_char = c;
|
||||
old_mod_mask = mod_mask;
|
||||
@@ -1966,8 +1938,7 @@ vungetc(c) /* unget one character (can only be done once!) */
|
||||
* K_SPECIAL and CSI may be escaped, need to get two more bytes then.
|
||||
*/
|
||||
static int
|
||||
vgetorpeek(advance)
|
||||
int advance;
|
||||
vgetorpeek(int advance)
|
||||
{
|
||||
int c, c1;
|
||||
int keylen;
|
||||
@@ -2013,11 +1984,7 @@ vgetorpeek(advance)
|
||||
* Using ":normal" can also do this, but it saves the typeahead buffer,
|
||||
* thus it should be OK. But don't get a key from the user then.
|
||||
*/
|
||||
if (vgetc_busy > 0
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
&& ex_normal_busy == 0
|
||||
#endif
|
||||
)
|
||||
if (vgetc_busy > 0 && ex_normal_busy == 0)
|
||||
return NUL;
|
||||
|
||||
local_State = get_real_state();
|
||||
@@ -2637,9 +2604,7 @@ vgetorpeek(advance)
|
||||
&& typebuf.tb_len == 1
|
||||
&& typebuf.tb_buf[typebuf.tb_off] == ESC
|
||||
&& !no_mapping
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
&& ex_normal_busy == 0
|
||||
#endif
|
||||
&& typebuf.tb_maplen == 0
|
||||
&& (State & INSERT)
|
||||
&& (p_timeout
|
||||
@@ -2761,12 +2726,11 @@ vgetorpeek(advance)
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
if (ex_normal_busy > 0)
|
||||
{
|
||||
# ifdef FEAT_CMDWIN
|
||||
#ifdef FEAT_CMDWIN
|
||||
static int tc = 0;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* No typeahead left and inside ":normal". Must return
|
||||
* something to avoid getting stuck. When an incomplete
|
||||
@@ -2785,19 +2749,18 @@ vgetorpeek(advance)
|
||||
if (p_im && (State & INSERT))
|
||||
c = Ctrl_L;
|
||||
else if ((State & CMDLINE)
|
||||
# ifdef FEAT_CMDWIN
|
||||
#ifdef FEAT_CMDWIN
|
||||
|| (cmdwin_type > 0 && tc == ESC)
|
||||
# endif
|
||||
#endif
|
||||
)
|
||||
c = Ctrl_C;
|
||||
else
|
||||
c = ESC;
|
||||
# ifdef FEAT_CMDWIN
|
||||
#ifdef FEAT_CMDWIN
|
||||
tc = c;
|
||||
# endif
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* get a character: 3. from the user - update display
|
||||
@@ -2988,11 +2951,11 @@ vgetorpeek(advance)
|
||||
* Return -1 when end of input script reached.
|
||||
*/
|
||||
int
|
||||
inchar(buf, maxlen, wait_time, tb_change_cnt)
|
||||
char_u *buf;
|
||||
int maxlen;
|
||||
long wait_time; /* milli seconds */
|
||||
int tb_change_cnt;
|
||||
inchar(
|
||||
char_u *buf,
|
||||
int maxlen,
|
||||
long wait_time, /* milli seconds */
|
||||
int tb_change_cnt)
|
||||
{
|
||||
int len = 0; /* init for GCC */
|
||||
int retesc = FALSE; /* return ESC with gotint */
|
||||
@@ -3114,10 +3077,10 @@ inchar(buf, maxlen, wait_time, tb_change_cnt)
|
||||
* Returns the new length.
|
||||
*/
|
||||
int
|
||||
fix_input_buffer(buf, len, script)
|
||||
char_u *buf;
|
||||
int len;
|
||||
int script; /* TRUE when reading from a script */
|
||||
fix_input_buffer(
|
||||
char_u *buf,
|
||||
int len,
|
||||
int script) /* TRUE when reading from a script */
|
||||
{
|
||||
int i;
|
||||
char_u *p = buf;
|
||||
@@ -3182,7 +3145,7 @@ fix_input_buffer(buf, len, script)
|
||||
* waiting for input to arrive.
|
||||
*/
|
||||
int
|
||||
input_available()
|
||||
input_available(void)
|
||||
{
|
||||
return (!vim_is_input_buf_empty()
|
||||
# if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
|
||||
@@ -3231,11 +3194,11 @@ input_available()
|
||||
* 5 for entry not unique
|
||||
*/
|
||||
int
|
||||
do_map(maptype, arg, mode, abbrev)
|
||||
int maptype;
|
||||
char_u *arg;
|
||||
int mode;
|
||||
int abbrev; /* not a mapping but an abbreviation */
|
||||
do_map(
|
||||
int maptype,
|
||||
char_u *arg,
|
||||
int mode,
|
||||
int abbrev) /* not a mapping but an abbreviation */
|
||||
{
|
||||
char_u *keys;
|
||||
mapblock_T *mp, **mpp;
|
||||
@@ -3810,8 +3773,7 @@ theend:
|
||||
* "mpp" is a pointer to the m_next field of the PREVIOUS entry!
|
||||
*/
|
||||
static void
|
||||
map_free(mpp)
|
||||
mapblock_T **mpp;
|
||||
map_free(mapblock_T **mpp)
|
||||
{
|
||||
mapblock_T *mp;
|
||||
|
||||
@@ -3827,7 +3789,7 @@ map_free(mpp)
|
||||
* Initialize maphash[] for first use.
|
||||
*/
|
||||
static void
|
||||
validate_maphash()
|
||||
validate_maphash(void)
|
||||
{
|
||||
if (!maphash_valid)
|
||||
{
|
||||
@@ -3840,9 +3802,7 @@ validate_maphash()
|
||||
* Get the mapping mode from the command name.
|
||||
*/
|
||||
int
|
||||
get_map_mode(cmdp, forceit)
|
||||
char_u **cmdp;
|
||||
int forceit;
|
||||
get_map_mode(char_u **cmdp, int forceit)
|
||||
{
|
||||
char_u *p;
|
||||
int modec;
|
||||
@@ -3884,11 +3844,11 @@ get_map_mode(cmdp, forceit)
|
||||
* 'abbr' should be FALSE for mappings, TRUE for abbreviations.
|
||||
*/
|
||||
void
|
||||
map_clear(cmdp, arg, forceit, abbr)
|
||||
char_u *cmdp;
|
||||
char_u *arg UNUSED;
|
||||
int forceit;
|
||||
int abbr;
|
||||
map_clear(
|
||||
char_u *cmdp,
|
||||
char_u *arg UNUSED,
|
||||
int forceit,
|
||||
int abbr)
|
||||
{
|
||||
int mode;
|
||||
#ifdef FEAT_LOCALMAP
|
||||
@@ -3916,11 +3876,11 @@ map_clear(cmdp, arg, forceit, abbr)
|
||||
* Clear all mappings in "mode".
|
||||
*/
|
||||
void
|
||||
map_clear_int(buf, mode, local, abbr)
|
||||
buf_T *buf UNUSED; /* buffer for local mappings */
|
||||
int mode; /* mode in which to delete */
|
||||
int local UNUSED; /* TRUE for buffer-local mappings */
|
||||
int abbr; /* TRUE for abbreviations */
|
||||
map_clear_int(
|
||||
buf_T *buf UNUSED, /* buffer for local mappings */
|
||||
int mode, /* mode in which to delete */
|
||||
int local UNUSED, /* TRUE for buffer-local mappings */
|
||||
int abbr) /* TRUE for abbreviations */
|
||||
{
|
||||
mapblock_T *mp, **mpp;
|
||||
int hash;
|
||||
@@ -3993,8 +3953,7 @@ map_clear_int(buf, mode, local, abbr)
|
||||
* Returns NULL when out of memory.
|
||||
*/
|
||||
char_u *
|
||||
map_mode_to_chars(mode)
|
||||
int mode;
|
||||
map_mode_to_chars(int mode)
|
||||
{
|
||||
garray_T mapmode;
|
||||
|
||||
@@ -4033,9 +3992,9 @@ map_mode_to_chars(mode)
|
||||
}
|
||||
|
||||
static void
|
||||
showmap(mp, local)
|
||||
mapblock_T *mp;
|
||||
int local; /* TRUE for buffer-local map */
|
||||
showmap(
|
||||
mapblock_T *mp,
|
||||
int local) /* TRUE for buffer-local map */
|
||||
{
|
||||
int len = 1;
|
||||
char_u *mapchars;
|
||||
@@ -4108,10 +4067,7 @@ showmap(mp, local)
|
||||
* Also checks mappings local to the current buffer.
|
||||
*/
|
||||
int
|
||||
map_to_exists(str, modechars, abbr)
|
||||
char_u *str;
|
||||
char_u *modechars;
|
||||
int abbr;
|
||||
map_to_exists(char_u *str, char_u *modechars, int abbr)
|
||||
{
|
||||
int mode = 0;
|
||||
char_u *rhs;
|
||||
@@ -4149,10 +4105,7 @@ map_to_exists(str, modechars, abbr)
|
||||
* Also checks mappings local to the current buffer.
|
||||
*/
|
||||
int
|
||||
map_to_exists_mode(rhs, mode, abbr)
|
||||
char_u *rhs;
|
||||
int mode;
|
||||
int abbr;
|
||||
map_to_exists_mode(char_u *rhs, int mode, int abbr)
|
||||
{
|
||||
mapblock_T *mp;
|
||||
int hash;
|
||||
@@ -4216,14 +4169,14 @@ static int expand_buffer = FALSE;
|
||||
* or abbreviation names.
|
||||
*/
|
||||
char_u *
|
||||
set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx)
|
||||
expand_T *xp;
|
||||
char_u *cmd;
|
||||
char_u *arg;
|
||||
int forceit; /* TRUE if '!' given */
|
||||
int isabbrev; /* TRUE if abbreviation */
|
||||
int isunmap; /* TRUE if unmap/unabbrev command */
|
||||
cmdidx_T cmdidx;
|
||||
set_context_in_map_cmd(
|
||||
expand_T *xp,
|
||||
char_u *cmd,
|
||||
char_u *arg,
|
||||
int forceit, /* TRUE if '!' given */
|
||||
int isabbrev, /* TRUE if abbreviation */
|
||||
int isunmap, /* TRUE if unmap/unabbrev command */
|
||||
cmdidx_T cmdidx)
|
||||
{
|
||||
if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap)
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
@@ -4293,10 +4246,10 @@ set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx)
|
||||
* Return OK if matches found, FAIL otherwise.
|
||||
*/
|
||||
int
|
||||
ExpandMappings(regmatch, num_file, file)
|
||||
regmatch_T *regmatch;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
ExpandMappings(
|
||||
regmatch_T *regmatch,
|
||||
int *num_file,
|
||||
char_u ***file)
|
||||
{
|
||||
mapblock_T *mp;
|
||||
int hash;
|
||||
@@ -4441,11 +4394,11 @@ ExpandMappings(regmatch, num_file, file)
|
||||
* return TRUE if there is an abbreviation, FALSE if not
|
||||
*/
|
||||
int
|
||||
check_abbr(c, ptr, col, mincol)
|
||||
int c;
|
||||
char_u *ptr;
|
||||
int col;
|
||||
int mincol;
|
||||
check_abbr(
|
||||
int c,
|
||||
char_u *ptr,
|
||||
int col,
|
||||
int mincol)
|
||||
{
|
||||
int len;
|
||||
int scol; /* starting column of the abbr. */
|
||||
@@ -4651,9 +4604,9 @@ check_abbr(c, ptr, col, mincol)
|
||||
* special characters.
|
||||
*/
|
||||
static char_u *
|
||||
eval_map_expr(str, c)
|
||||
char_u *str;
|
||||
int c; /* NUL or typed character for abbreviation */
|
||||
eval_map_expr(
|
||||
char_u *str,
|
||||
int c) /* NUL or typed character for abbreviation */
|
||||
{
|
||||
char_u *res;
|
||||
char_u *p;
|
||||
@@ -4680,18 +4633,14 @@ eval_map_expr(str, c)
|
||||
/* Forbid changing text or using ":normal" to avoid most of the bad side
|
||||
* effects. Also restore the cursor position. */
|
||||
++textlock;
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
++ex_normal_lock;
|
||||
#endif
|
||||
set_vim_var_char(c); /* set v:char to the typed character */
|
||||
save_cursor = curwin->w_cursor;
|
||||
save_msg_col = msg_col;
|
||||
save_msg_row = msg_row;
|
||||
p = eval_to_string(expr, NULL, FALSE);
|
||||
--textlock;
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
--ex_normal_lock;
|
||||
#endif
|
||||
curwin->w_cursor = save_cursor;
|
||||
msg_col = save_msg_col;
|
||||
msg_row = save_msg_row;
|
||||
@@ -4715,8 +4664,8 @@ eval_map_expr(str, c)
|
||||
* Returns NULL when out of memory.
|
||||
*/
|
||||
char_u *
|
||||
vim_strsave_escape_csi(p)
|
||||
char_u *p;
|
||||
vim_strsave_escape_csi(
|
||||
char_u *p)
|
||||
{
|
||||
char_u *res;
|
||||
char_u *s, *d;
|
||||
@@ -4765,8 +4714,7 @@ vim_strsave_escape_csi(p)
|
||||
* vim_strsave_escape_csi(). Works in-place.
|
||||
*/
|
||||
void
|
||||
vim_unescape_csi(p)
|
||||
char_u *p;
|
||||
vim_unescape_csi(char_u *p)
|
||||
{
|
||||
char_u *s = p, *d = p;
|
||||
|
||||
@@ -4794,9 +4742,9 @@ vim_unescape_csi(p)
|
||||
* Return FAIL on error, OK otherwise.
|
||||
*/
|
||||
int
|
||||
makemap(fd, buf)
|
||||
FILE *fd;
|
||||
buf_T *buf; /* buffer for local mappings or NULL */
|
||||
makemap(
|
||||
FILE *fd,
|
||||
buf_T *buf) /* buffer for local mappings or NULL */
|
||||
{
|
||||
mapblock_T *mp;
|
||||
char_u c1, c2, c3;
|
||||
@@ -5007,10 +4955,7 @@ makemap(fd, buf)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
int
|
||||
put_escstr(fd, strstart, what)
|
||||
FILE *fd;
|
||||
char_u *strstart;
|
||||
int what;
|
||||
put_escstr(FILE *fd, char_u *strstart, int what)
|
||||
{
|
||||
char_u *str = strstart;
|
||||
int c;
|
||||
@@ -5123,7 +5068,7 @@ put_escstr(fd, strstart, what)
|
||||
* Used after ":set term=xxx".
|
||||
*/
|
||||
void
|
||||
check_map_keycodes()
|
||||
check_map_keycodes(void)
|
||||
{
|
||||
mapblock_T *mp;
|
||||
char_u *p;
|
||||
@@ -5215,14 +5160,14 @@ check_map_keycodes()
|
||||
* NULL when no mapping found.
|
||||
*/
|
||||
char_u *
|
||||
check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr)
|
||||
char_u *keys;
|
||||
int mode;
|
||||
int exact; /* require exact match */
|
||||
int ign_mod; /* ignore preceding modifier */
|
||||
int abbr; /* do abbreviations */
|
||||
mapblock_T **mp_ptr; /* return: pointer to mapblock or NULL */
|
||||
int *local_ptr; /* return: buffer-local mapping or NULL */
|
||||
check_map(
|
||||
char_u *keys,
|
||||
int mode,
|
||||
int exact, /* require exact match */
|
||||
int ign_mod, /* ignore preceding modifier */
|
||||
int abbr, /* do abbreviations */
|
||||
mapblock_T **mp_ptr, /* return: pointer to mapblock or NULL */
|
||||
int *local_ptr) /* return: buffer-local mapping or NULL */
|
||||
{
|
||||
int hash;
|
||||
int len, minlen;
|
||||
@@ -5381,12 +5326,12 @@ static struct initmap
|
||||
* Set up default mappings.
|
||||
*/
|
||||
void
|
||||
init_mappings()
|
||||
init_mappings(void)
|
||||
{
|
||||
#if defined(MSDOS) || defined(MSWIN) ||defined(MACOS)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(initmappings) / sizeof(struct initmap); ++i)
|
||||
for (i = 0; i < (int)(sizeof(initmappings) / sizeof(struct initmap)); ++i)
|
||||
add_map(initmappings[i].arg, initmappings[i].mode);
|
||||
#endif
|
||||
}
|
||||
@@ -5398,9 +5343,7 @@ init_mappings()
|
||||
* Need to put string in allocated memory, because do_map() will modify it.
|
||||
*/
|
||||
void
|
||||
add_map(map, mode)
|
||||
char_u *map;
|
||||
int mode;
|
||||
add_map(char_u *map, int mode)
|
||||
{
|
||||
char_u *s;
|
||||
char_u *cpo_save = p_cpo;
|
||||
|
||||
+2
-4
@@ -997,10 +997,8 @@ EXTERN typebuf_T typebuf /* typeahead buffer */
|
||||
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
|
||||
#endif
|
||||
;
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */
|
||||
EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN int ignore_script INIT(= FALSE); /* ignore script input */
|
||||
#endif
|
||||
@@ -1577,9 +1575,7 @@ EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxm
|
||||
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
|
||||
EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist"));
|
||||
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter"));
|
||||
#endif
|
||||
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
|
||||
#if defined(FEAT_SYN_HL) || \
|
||||
(defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))
|
||||
@@ -1629,6 +1625,8 @@ EXTERN alloc_id_T alloc_fail_id INIT(= aid_none);
|
||||
EXTERN int alloc_fail_countdown INIT(= -1);
|
||||
/* set by alloc_fail(), number of times alloc() returns NULL */
|
||||
EXTERN int alloc_fail_repeat INIT(= 0);
|
||||
|
||||
EXTERN int disable_char_avail_for_testing INIT(= 0);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -73,7 +73,7 @@ static int can_update_cursor = TRUE; /* can display the cursor */
|
||||
* recursive call.
|
||||
*/
|
||||
void
|
||||
gui_start()
|
||||
gui_start(void)
|
||||
{
|
||||
char_u *old_term;
|
||||
static int recursive = 0;
|
||||
@@ -152,7 +152,7 @@ gui_start()
|
||||
* full_screen will be set to TRUE again by a successful termcapinit().
|
||||
*/
|
||||
static void
|
||||
gui_attempt_start()
|
||||
gui_attempt_start(void)
|
||||
{
|
||||
static int recursive = 0;
|
||||
|
||||
@@ -204,7 +204,7 @@ gui_attempt_start()
|
||||
* and the child will return.
|
||||
*/
|
||||
static void
|
||||
gui_do_fork()
|
||||
gui_do_fork(void)
|
||||
{
|
||||
int pipefd[2]; /* pipe between parent and child */
|
||||
int pipe_error;
|
||||
@@ -345,9 +345,7 @@ gui_read_child_pipe(int fd)
|
||||
* Call this when vim starts up, whether or not the GUI is started
|
||||
*/
|
||||
void
|
||||
gui_prepare(argc, argv)
|
||||
int *argc;
|
||||
char **argv;
|
||||
gui_prepare(int *argc, char **argv)
|
||||
{
|
||||
gui.in_use = FALSE; /* No GUI yet (maybe later) */
|
||||
gui.starting = FALSE; /* No GUI yet (maybe later) */
|
||||
@@ -361,7 +359,7 @@ gui_prepare(argc, argv)
|
||||
* Returns FAIL or OK.
|
||||
*/
|
||||
int
|
||||
gui_init_check()
|
||||
gui_init_check(void)
|
||||
{
|
||||
static int result = MAYBE;
|
||||
|
||||
@@ -461,7 +459,7 @@ gui_init_check()
|
||||
* This is the call which starts the GUI.
|
||||
*/
|
||||
void
|
||||
gui_init()
|
||||
gui_init(void)
|
||||
{
|
||||
win_T *wp;
|
||||
static int recursive = 0;
|
||||
@@ -792,8 +790,7 @@ error:
|
||||
|
||||
|
||||
void
|
||||
gui_exit(rc)
|
||||
int rc;
|
||||
gui_exit(int rc)
|
||||
{
|
||||
/* don't free the fonts, it leads to a BUS error
|
||||
* richard@whitequeen.com Jul 99 */
|
||||
@@ -813,7 +810,7 @@ gui_exit(rc)
|
||||
* When this function returns, Vim should NOT exit!
|
||||
*/
|
||||
void
|
||||
gui_shell_closed()
|
||||
gui_shell_closed(void)
|
||||
{
|
||||
cmdmod_T save_cmdmod;
|
||||
|
||||
@@ -847,9 +844,7 @@ gui_shell_closed()
|
||||
* the fonts are unchanged.
|
||||
*/
|
||||
int
|
||||
gui_init_font(font_list, fontset)
|
||||
char_u *font_list;
|
||||
int fontset UNUSED;
|
||||
gui_init_font(char_u *font_list, int fontset UNUSED)
|
||||
{
|
||||
#define FONTLEN 320
|
||||
char_u font_name[FONTLEN];
|
||||
@@ -941,8 +936,7 @@ gui_init_font(font_list, fontset)
|
||||
* Try setting 'guifontwide' to a font twice as wide as "name".
|
||||
*/
|
||||
static void
|
||||
set_guifontwide(name)
|
||||
char_u *name;
|
||||
set_guifontwide(char_u *name)
|
||||
{
|
||||
int i = 0;
|
||||
char_u wide_name[FONTLEN + 10]; /* room for 2 * width and '*' */
|
||||
@@ -991,7 +985,7 @@ set_guifontwide(name)
|
||||
* Return FAIL for an invalid font name.
|
||||
*/
|
||||
int
|
||||
gui_get_wide_font()
|
||||
gui_get_wide_font(void)
|
||||
{
|
||||
GuiFont font = NOFONT;
|
||||
char_u font_name[FONTLEN];
|
||||
@@ -1039,9 +1033,7 @@ gui_get_wide_font()
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_set_cursor(row, col)
|
||||
int row;
|
||||
int col;
|
||||
gui_set_cursor(int row, int col)
|
||||
{
|
||||
gui.row = row;
|
||||
gui.col = col;
|
||||
@@ -1051,7 +1043,7 @@ gui_set_cursor(row, col)
|
||||
* gui_check_pos - check if the cursor is on the screen.
|
||||
*/
|
||||
static void
|
||||
gui_check_pos()
|
||||
gui_check_pos(void)
|
||||
{
|
||||
if (gui.row >= screen_Rows)
|
||||
gui.row = screen_Rows - 1;
|
||||
@@ -1067,9 +1059,9 @@ gui_check_pos()
|
||||
* otherwise this goes wrong. May need to call out_flush() first.
|
||||
*/
|
||||
void
|
||||
gui_update_cursor(force, clear_selection)
|
||||
int force; /* when TRUE, update even when not moved */
|
||||
int clear_selection;/* clear selection under cursor */
|
||||
gui_update_cursor(
|
||||
int force, /* when TRUE, update even when not moved */
|
||||
int clear_selection)/* clear selection under cursor */
|
||||
{
|
||||
int cur_width = 0;
|
||||
int cur_height = 0;
|
||||
@@ -1316,7 +1308,7 @@ gui_update_cursor(force, clear_selection)
|
||||
|
||||
#if defined(FEAT_MENU) || defined(PROTO)
|
||||
void
|
||||
gui_position_menu()
|
||||
gui_position_menu(void)
|
||||
{
|
||||
# if !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
|
||||
|| defined(FEAT_GUI_MACVIM))
|
||||
@@ -1331,8 +1323,7 @@ gui_position_menu()
|
||||
* scrollbars are NOT handled here. See gui_update_scrollbars().
|
||||
*/
|
||||
static void
|
||||
gui_position_components(total_width)
|
||||
int total_width UNUSED;
|
||||
gui_position_components(int total_width UNUSED)
|
||||
{
|
||||
int text_area_x;
|
||||
int text_area_y;
|
||||
@@ -1405,7 +1396,7 @@ gui_position_components(total_width)
|
||||
* Get the width of the widgets and decorations to the side of the text area.
|
||||
*/
|
||||
int
|
||||
gui_get_base_width()
|
||||
gui_get_base_width(void)
|
||||
{
|
||||
int base_width;
|
||||
|
||||
@@ -1421,7 +1412,7 @@ gui_get_base_width()
|
||||
* Get the height of the widgets and decorations above and below the text area.
|
||||
*/
|
||||
int
|
||||
gui_get_base_height()
|
||||
gui_get_base_height(void)
|
||||
{
|
||||
int base_height;
|
||||
|
||||
@@ -1466,9 +1457,7 @@ gui_get_base_height()
|
||||
* the new width and height of the shell in pixels.
|
||||
*/
|
||||
void
|
||||
gui_resize_shell(pixel_width, pixel_height)
|
||||
int pixel_width;
|
||||
int pixel_height;
|
||||
gui_resize_shell(int pixel_width, int pixel_height)
|
||||
{
|
||||
static int busy = FALSE;
|
||||
|
||||
@@ -1537,7 +1526,7 @@ again:
|
||||
* Check if gui_resize_shell() must be called.
|
||||
*/
|
||||
void
|
||||
gui_may_resize_shell()
|
||||
gui_may_resize_shell(void)
|
||||
{
|
||||
int h, w;
|
||||
|
||||
@@ -1554,7 +1543,7 @@ gui_may_resize_shell()
|
||||
}
|
||||
|
||||
int
|
||||
gui_get_shellsize()
|
||||
gui_get_shellsize(void)
|
||||
{
|
||||
Rows = gui.num_rows;
|
||||
Columns = gui.num_cols;
|
||||
@@ -1567,10 +1556,10 @@ gui_get_shellsize()
|
||||
* on the screen.
|
||||
*/
|
||||
void
|
||||
gui_set_shellsize(mustset, fit_to_display, direction)
|
||||
int mustset UNUSED; /* set by the user */
|
||||
int fit_to_display;
|
||||
int direction; /* RESIZE_HOR, RESIZE_VER */
|
||||
gui_set_shellsize(
|
||||
int mustset UNUSED, /* set by the user */
|
||||
int fit_to_display,
|
||||
int direction) /* RESIZE_HOR, RESIZE_VER */
|
||||
{
|
||||
int base_width;
|
||||
int base_height;
|
||||
@@ -1693,7 +1682,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
|
||||
* Called when Rows and/or Columns has changed.
|
||||
*/
|
||||
void
|
||||
gui_new_shellsize()
|
||||
gui_new_shellsize(void)
|
||||
{
|
||||
gui_reset_scroll_region();
|
||||
}
|
||||
@@ -1702,7 +1691,7 @@ gui_new_shellsize()
|
||||
* Make scroll region cover whole screen.
|
||||
*/
|
||||
void
|
||||
gui_reset_scroll_region()
|
||||
gui_reset_scroll_region(void)
|
||||
{
|
||||
gui.scroll_region_top = 0;
|
||||
gui.scroll_region_bot = gui.num_rows - 1;
|
||||
@@ -1711,8 +1700,7 @@ gui_reset_scroll_region()
|
||||
}
|
||||
|
||||
void
|
||||
gui_start_highlight(mask)
|
||||
int mask;
|
||||
gui_start_highlight(int mask)
|
||||
{
|
||||
if (mask > HL_ALL) /* highlight code */
|
||||
gui.highlight_mask = mask;
|
||||
@@ -1721,8 +1709,7 @@ gui_start_highlight(mask)
|
||||
}
|
||||
|
||||
void
|
||||
gui_stop_highlight(mask)
|
||||
int mask;
|
||||
gui_stop_highlight(int mask)
|
||||
{
|
||||
if (mask > HL_ALL) /* highlight code */
|
||||
gui.highlight_mask = HL_NORMAL;
|
||||
@@ -1735,11 +1722,11 @@ gui_stop_highlight(mask)
|
||||
* (row2, col2) inclusive.
|
||||
*/
|
||||
void
|
||||
gui_clear_block(row1, col1, row2, col2)
|
||||
int row1;
|
||||
int col1;
|
||||
int row2;
|
||||
int col2;
|
||||
gui_clear_block(
|
||||
int row1,
|
||||
int col1,
|
||||
int row2,
|
||||
int col2)
|
||||
{
|
||||
/* Clear the selection if we are about to write over it */
|
||||
clip_may_clear_selection(row1, row2);
|
||||
@@ -1757,15 +1744,15 @@ gui_clear_block(row1, col1, row2, col2)
|
||||
* output buffer before calling gui_update_cursor().
|
||||
*/
|
||||
void
|
||||
gui_update_cursor_later()
|
||||
gui_update_cursor_later(void)
|
||||
{
|
||||
OUT_STR(IF_EB("\033|s", ESC_STR "|s"));
|
||||
OUT_STR(IF_EB("\033|s", ESC_STR "|s"));
|
||||
}
|
||||
|
||||
void
|
||||
gui_write(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
gui_write(
|
||||
char_u *s,
|
||||
int len)
|
||||
{
|
||||
char_u *p;
|
||||
int arg1 = 0, arg2 = 0;
|
||||
@@ -1994,7 +1981,7 @@ gui_write(s, len)
|
||||
* gui_can_update_cursor() afterwards.
|
||||
*/
|
||||
void
|
||||
gui_dont_update_cursor()
|
||||
gui_dont_update_cursor(void)
|
||||
{
|
||||
if (gui.in_use)
|
||||
{
|
||||
@@ -2005,7 +1992,7 @@ gui_dont_update_cursor()
|
||||
}
|
||||
|
||||
void
|
||||
gui_can_update_cursor()
|
||||
gui_can_update_cursor(void)
|
||||
{
|
||||
can_update_cursor = TRUE;
|
||||
/* No need to update the cursor right now, there is always more output
|
||||
@@ -2013,9 +2000,7 @@ gui_can_update_cursor()
|
||||
}
|
||||
|
||||
static void
|
||||
gui_outstr(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
gui_outstr(char_u *s, int len)
|
||||
{
|
||||
int this_len;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -2077,11 +2062,12 @@ gui_outstr(s, len)
|
||||
* Returns FAIL or OK, just like gui_outstr_nowrap().
|
||||
*/
|
||||
static int
|
||||
gui_screenchar(off, flags, fg, bg, back)
|
||||
int off; /* Offset from start of screen */
|
||||
int flags;
|
||||
guicolor_T fg, bg; /* colors for cursor */
|
||||
int back; /* backup this many chars when using bold trick */
|
||||
gui_screenchar(
|
||||
int off, /* Offset from start of screen */
|
||||
int flags,
|
||||
guicolor_T fg, /* colors for cursor */
|
||||
guicolor_T bg, /* colors for cursor */
|
||||
int back) /* backup this many chars when using bold trick */
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
@@ -2118,12 +2104,13 @@ gui_screenchar(off, flags, fg, bg, back)
|
||||
* as possible to work nicely. It's a lot faster as well.
|
||||
*/
|
||||
static int
|
||||
gui_screenstr(off, len, flags, fg, bg, back)
|
||||
int off; /* Offset from start of screen */
|
||||
int len; /* string length in screen cells */
|
||||
int flags;
|
||||
guicolor_T fg, bg; /* colors for cursor */
|
||||
int back; /* backup this many chars when using bold trick */
|
||||
gui_screenstr(
|
||||
int off, /* Offset from start of screen */
|
||||
int len, /* string length in screen cells */
|
||||
int flags,
|
||||
guicolor_T fg, /* colors for cursor */
|
||||
guicolor_T bg, /* colors for cursor */
|
||||
int back) /* backup this many chars when using bold trick */
|
||||
{
|
||||
char_u *buf;
|
||||
int outlen = 0;
|
||||
@@ -2201,12 +2188,13 @@ gui_screenstr(off, len, flags, fg, bg, back)
|
||||
* FAIL (the caller should start drawing "back" chars back).
|
||||
*/
|
||||
int
|
||||
gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
char_u *s;
|
||||
int len;
|
||||
int flags;
|
||||
guicolor_T fg, bg; /* colors for cursor */
|
||||
int back; /* backup this many chars when using bold trick */
|
||||
gui_outstr_nowrap(
|
||||
char_u *s,
|
||||
int len,
|
||||
int flags,
|
||||
guicolor_T fg, /* colors for cursor */
|
||||
guicolor_T bg, /* colors for cursor */
|
||||
int back) /* backup this many chars when using bold trick */
|
||||
{
|
||||
long_u highlight_mask;
|
||||
long_u hl_mask_todo;
|
||||
@@ -2619,7 +2607,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
||||
* position. The character just before it too, for when it was in bold.
|
||||
*/
|
||||
void
|
||||
gui_undraw_cursor()
|
||||
gui_undraw_cursor(void)
|
||||
{
|
||||
if (gui.cursor_is_valid)
|
||||
{
|
||||
@@ -2660,11 +2648,11 @@ gui_undraw_cursor()
|
||||
}
|
||||
|
||||
void
|
||||
gui_redraw(x, y, w, h)
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_redraw(
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
int row1, col1, row2, col2;
|
||||
|
||||
@@ -2693,12 +2681,12 @@ gui_redraw(x, y, w, h)
|
||||
* different attributes (may have to be redrawn too).
|
||||
*/
|
||||
int
|
||||
gui_redraw_block(row1, col1, row2, col2, flags)
|
||||
int row1;
|
||||
int col1;
|
||||
int row2;
|
||||
int col2;
|
||||
int flags; /* flags for gui_outstr_nowrap() */
|
||||
gui_redraw_block(
|
||||
int row1,
|
||||
int col1,
|
||||
int row2,
|
||||
int col2,
|
||||
int flags) /* flags for gui_outstr_nowrap() */
|
||||
{
|
||||
int old_row, old_col;
|
||||
long_u old_hl_mask;
|
||||
@@ -2857,9 +2845,7 @@ gui_redraw_block(row1, col1, row2, col2, flags)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_delete_lines(row, count)
|
||||
int row;
|
||||
int count;
|
||||
gui_delete_lines(int row, int count)
|
||||
{
|
||||
if (count <= 0)
|
||||
return;
|
||||
@@ -2887,9 +2873,7 @@ gui_delete_lines(row, count)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_insert_lines(row, count)
|
||||
int row;
|
||||
int count;
|
||||
gui_insert_lines(int row, int count)
|
||||
{
|
||||
if (count <= 0)
|
||||
return;
|
||||
@@ -2923,8 +2907,7 @@ gui_insert_lines(row, count)
|
||||
* or FAIL otherwise.
|
||||
*/
|
||||
int
|
||||
gui_wait_for_chars(wtime)
|
||||
long wtime;
|
||||
gui_wait_for_chars(long wtime)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -2999,10 +2982,7 @@ gui_wait_for_chars(wtime)
|
||||
* Fill p[4] with mouse coordinates encoded for check_termcode().
|
||||
*/
|
||||
static void
|
||||
fill_mouse_coord(p, col, row)
|
||||
char_u *p;
|
||||
int col;
|
||||
int row;
|
||||
fill_mouse_coord(char_u *p, int col, int row)
|
||||
{
|
||||
p[0] = (char_u)(col / 128 + ' ' + 1);
|
||||
p[1] = (char_u)(col % 128 + ' ' + 1);
|
||||
@@ -3027,12 +3007,12 @@ fill_mouse_coord(p, col, row)
|
||||
* character.
|
||||
*/
|
||||
void
|
||||
gui_send_mouse_event(button, x, y, repeated_click, modifiers)
|
||||
int button;
|
||||
int x;
|
||||
int y;
|
||||
int repeated_click;
|
||||
int_u modifiers;
|
||||
gui_send_mouse_event(
|
||||
int button,
|
||||
int x,
|
||||
int y,
|
||||
int repeated_click,
|
||||
int_u modifiers)
|
||||
{
|
||||
static int prev_row = 0, prev_col = 0;
|
||||
static int prev_button = -1;
|
||||
@@ -3342,10 +3322,7 @@ button_set:
|
||||
* returns column in "*colp" and row as return value;
|
||||
*/
|
||||
int
|
||||
gui_xy2colrow(x, y, colp)
|
||||
int x;
|
||||
int y;
|
||||
int *colp;
|
||||
gui_xy2colrow(int x, int y, int *colp)
|
||||
{
|
||||
int col = check_col(X_2_COL(x));
|
||||
int row = check_row(Y_2_ROW(y));
|
||||
@@ -3363,8 +3340,7 @@ gui_xy2colrow(x, y, colp)
|
||||
* Callback function for when a menu entry has been selected.
|
||||
*/
|
||||
void
|
||||
gui_menu_cb(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_menu_cb(vimmenu_T *menu)
|
||||
{
|
||||
char_u bytes[sizeof(long_u)];
|
||||
|
||||
@@ -3389,8 +3365,7 @@ static int prev_which_scrollbars[3];
|
||||
* in p_go.
|
||||
*/
|
||||
void
|
||||
gui_init_which_components(oldval)
|
||||
char_u *oldval UNUSED;
|
||||
gui_init_which_components(char_u *oldval UNUSED)
|
||||
{
|
||||
#ifdef FEAT_MENU
|
||||
static int prev_menu_is_active = -1;
|
||||
@@ -3642,7 +3617,7 @@ gui_init_which_components(oldval)
|
||||
* It may still be hidden if 'showtabline' is zero.
|
||||
*/
|
||||
int
|
||||
gui_use_tabline()
|
||||
gui_use_tabline(void)
|
||||
{
|
||||
return gui.in_use && vim_strchr(p_go, GO_TABLINE) != NULL;
|
||||
}
|
||||
@@ -3652,7 +3627,7 @@ gui_use_tabline()
|
||||
* This uses 'showtabline'.
|
||||
*/
|
||||
static int
|
||||
gui_has_tabline()
|
||||
gui_has_tabline(void)
|
||||
{
|
||||
if (!gui_use_tabline()
|
||||
|| p_stal == 0
|
||||
@@ -3666,7 +3641,7 @@ gui_has_tabline()
|
||||
* This may display/undisplay the tabline and update the labels.
|
||||
*/
|
||||
void
|
||||
gui_update_tabline()
|
||||
gui_update_tabline(void)
|
||||
{
|
||||
int showit = gui_has_tabline();
|
||||
int shown = gui_mch_showing_tabline();
|
||||
@@ -3694,9 +3669,9 @@ gui_update_tabline()
|
||||
* Get the label or tooltip for tab page "tp" into NameBuff[].
|
||||
*/
|
||||
void
|
||||
get_tabline_label(tp, tooltip)
|
||||
tabpage_T *tp;
|
||||
int tooltip; /* TRUE: get tooltip */
|
||||
get_tabline_label(
|
||||
tabpage_T *tp,
|
||||
int tooltip) /* TRUE: get tooltip */
|
||||
{
|
||||
int modified = FALSE;
|
||||
char_u buf[40];
|
||||
@@ -3787,8 +3762,7 @@ get_tabline_label(tp, tooltip)
|
||||
* that tab page or the cmdline window is open.
|
||||
*/
|
||||
int
|
||||
send_tabline_event(nr)
|
||||
int nr;
|
||||
send_tabline_event(int nr)
|
||||
{
|
||||
char_u string[3];
|
||||
|
||||
@@ -3820,9 +3794,7 @@ send_tabline_event(nr)
|
||||
* Send a tabline menu event
|
||||
*/
|
||||
void
|
||||
send_tabline_menu_event(tabidx, event)
|
||||
int tabidx;
|
||||
int event;
|
||||
send_tabline_menu_event(int tabidx, int event)
|
||||
{
|
||||
char_u string[3];
|
||||
|
||||
@@ -3850,7 +3822,7 @@ send_tabline_menu_event(tabidx, event)
|
||||
* Remove all scrollbars. Used before switching to another tab page.
|
||||
*/
|
||||
void
|
||||
gui_remove_scrollbars()
|
||||
gui_remove_scrollbars(void)
|
||||
{
|
||||
int i;
|
||||
win_T *wp;
|
||||
@@ -3872,10 +3844,7 @@ gui_remove_scrollbars()
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_create_scrollbar(sb, type, wp)
|
||||
scrollbar_T *sb;
|
||||
int type;
|
||||
win_T *wp;
|
||||
gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
|
||||
{
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
/* This is passed over to another process, make sure it fits in 32 bit */
|
||||
@@ -3906,8 +3875,7 @@ gui_create_scrollbar(sb, type, wp)
|
||||
* Find the scrollbar with the given index.
|
||||
*/
|
||||
scrollbar_T *
|
||||
gui_find_scrollbar(ident)
|
||||
long ident;
|
||||
gui_find_scrollbar(long ident)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
@@ -3939,10 +3907,7 @@ gui_find_scrollbar(ident)
|
||||
* are still characters to be processed.
|
||||
*/
|
||||
void
|
||||
gui_drag_scrollbar(sb, value, still_dragging)
|
||||
scrollbar_T *sb;
|
||||
long value;
|
||||
int still_dragging;
|
||||
gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
@@ -4160,7 +4125,7 @@ gui_drag_scrollbar(sb, value, still_dragging)
|
||||
* Called when something in the window layout has changed.
|
||||
*/
|
||||
void
|
||||
gui_may_update_scrollbars()
|
||||
gui_may_update_scrollbars(void)
|
||||
{
|
||||
if (gui.in_use && starting == 0)
|
||||
{
|
||||
@@ -4173,8 +4138,8 @@ gui_may_update_scrollbars()
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_update_scrollbars(force)
|
||||
int force; /* Force all scrollbars to get updated */
|
||||
gui_update_scrollbars(
|
||||
int force) /* Force all scrollbars to get updated */
|
||||
{
|
||||
win_T *wp;
|
||||
scrollbar_T *sb;
|
||||
@@ -4389,10 +4354,10 @@ gui_update_scrollbars(force)
|
||||
* sometimes.
|
||||
*/
|
||||
static void
|
||||
gui_do_scrollbar(wp, which, enable)
|
||||
win_T *wp;
|
||||
int which; /* SBAR_LEFT or SBAR_RIGHT */
|
||||
int enable; /* TRUE to enable scrollbar */
|
||||
gui_do_scrollbar(
|
||||
win_T *wp,
|
||||
int which, /* SBAR_LEFT or SBAR_RIGHT */
|
||||
int enable) /* TRUE to enable scrollbar */
|
||||
{
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
int midcol = curwin->w_wincol + curwin->w_width / 2;
|
||||
@@ -4435,7 +4400,7 @@ gui_do_scrollbar(wp, which, enable)
|
||||
* or FALSE otherwise.
|
||||
*/
|
||||
int
|
||||
gui_do_scroll()
|
||||
gui_do_scroll(void)
|
||||
{
|
||||
win_T *wp, *save_wp;
|
||||
int i;
|
||||
@@ -4547,8 +4512,7 @@ gui_do_scroll()
|
||||
* Return length of line "lnum" for horizontal scrolling.
|
||||
*/
|
||||
static colnr_T
|
||||
scroll_line_len(lnum)
|
||||
linenr_T lnum;
|
||||
scroll_line_len(linenr_T lnum)
|
||||
{
|
||||
char_u *p;
|
||||
colnr_T col;
|
||||
@@ -4577,7 +4541,7 @@ static linenr_T longest_lnum = 0;
|
||||
* by setting 'h' in "guioptions") then the current line number is returned.
|
||||
*/
|
||||
static linenr_T
|
||||
gui_find_longest_lnum()
|
||||
gui_find_longest_lnum(void)
|
||||
{
|
||||
linenr_T ret = 0;
|
||||
|
||||
@@ -4618,8 +4582,7 @@ gui_find_longest_lnum()
|
||||
}
|
||||
|
||||
static void
|
||||
gui_update_horiz_scrollbar(force)
|
||||
int force;
|
||||
gui_update_horiz_scrollbar(int force)
|
||||
{
|
||||
long value, size, max; /* need 32 bit ints here */
|
||||
|
||||
@@ -4711,9 +4674,7 @@ gui_update_horiz_scrollbar(force)
|
||||
* Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise.
|
||||
*/
|
||||
int
|
||||
gui_do_horiz_scroll(leftcol, compute_longest_lnum)
|
||||
long_u leftcol;
|
||||
int compute_longest_lnum;
|
||||
gui_do_horiz_scroll(long_u leftcol, int compute_longest_lnum)
|
||||
{
|
||||
/* no wrapping, no scrolling */
|
||||
if (curwin->w_p_wrap)
|
||||
@@ -4751,7 +4712,7 @@ gui_do_horiz_scroll(leftcol, compute_longest_lnum)
|
||||
* Check that none of the colors are the same as the background color
|
||||
*/
|
||||
void
|
||||
gui_check_colors()
|
||||
gui_check_colors(void)
|
||||
{
|
||||
if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
|
||||
{
|
||||
@@ -4762,16 +4723,14 @@ gui_check_colors()
|
||||
}
|
||||
|
||||
static void
|
||||
gui_set_fg_color(name)
|
||||
char_u *name;
|
||||
gui_set_fg_color(char_u *name)
|
||||
{
|
||||
gui.norm_pixel = gui_get_color(name);
|
||||
hl_set_fg_color_name(vim_strsave(name));
|
||||
}
|
||||
|
||||
static void
|
||||
gui_set_bg_color(name)
|
||||
char_u *name;
|
||||
gui_set_bg_color(char_u *name)
|
||||
{
|
||||
gui.back_pixel = gui_get_color(name);
|
||||
hl_set_bg_color_name(vim_strsave(name));
|
||||
@@ -4782,8 +4741,7 @@ gui_set_bg_color(name)
|
||||
* Returns INVALCOLOR and gives an error message when failed.
|
||||
*/
|
||||
guicolor_T
|
||||
gui_get_color(name)
|
||||
char_u *name;
|
||||
gui_get_color(char_u *name)
|
||||
{
|
||||
guicolor_T t;
|
||||
|
||||
@@ -4804,8 +4762,7 @@ gui_get_color(name)
|
||||
* Return the grey value of a color (range 0-255).
|
||||
*/
|
||||
int
|
||||
gui_get_lightness(pixel)
|
||||
guicolor_T pixel;
|
||||
gui_get_lightness(guicolor_T pixel)
|
||||
{
|
||||
long_u rgb = gui_mch_get_rgb(pixel);
|
||||
|
||||
@@ -4816,7 +4773,7 @@ gui_get_lightness(pixel)
|
||||
|
||||
#if defined(FEAT_GUI_X11) || defined(PROTO)
|
||||
void
|
||||
gui_new_scrollbar_colors()
|
||||
gui_new_scrollbar_colors(void)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
@@ -4837,8 +4794,7 @@ gui_new_scrollbar_colors()
|
||||
* Call this when focus has changed.
|
||||
*/
|
||||
void
|
||||
gui_focus_change(in_focus)
|
||||
int in_focus;
|
||||
gui_focus_change(int in_focus)
|
||||
{
|
||||
/*
|
||||
* Skip this code to avoid drawing the cursor when debugging and switching
|
||||
@@ -4872,9 +4828,7 @@ gui_focus_change(in_focus)
|
||||
* Called when the mouse moved (but not when dragging).
|
||||
*/
|
||||
void
|
||||
gui_mouse_moved(x, y)
|
||||
int x;
|
||||
int y;
|
||||
gui_mouse_moved(int x, int y)
|
||||
{
|
||||
win_T *wp;
|
||||
char_u st[8];
|
||||
@@ -4951,7 +4905,7 @@ gui_mouse_moved(x, y)
|
||||
* Called when mouse should be moved to window with focus.
|
||||
*/
|
||||
void
|
||||
gui_mouse_correct()
|
||||
gui_mouse_correct(void)
|
||||
{
|
||||
int x, y;
|
||||
win_T *wp = NULL;
|
||||
@@ -4984,9 +4938,7 @@ gui_mouse_correct()
|
||||
* Find window where the mouse pointer "y" coordinate is in.
|
||||
*/
|
||||
static win_T *
|
||||
xy2win(x, y)
|
||||
int x UNUSED;
|
||||
int y UNUSED;
|
||||
xy2win(int x UNUSED, int y UNUSED)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int row;
|
||||
@@ -5039,8 +4991,7 @@ xy2win(x, y)
|
||||
* File names may be given to redefine the args list.
|
||||
*/
|
||||
void
|
||||
ex_gui(eap)
|
||||
exarg_T *eap;
|
||||
ex_gui(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
|
||||
@@ -5084,9 +5035,7 @@ static void gfp_setname(char_u *fname, void *cookie);
|
||||
* Callback function for do_in_runtimepath().
|
||||
*/
|
||||
static void
|
||||
gfp_setname(fname, cookie)
|
||||
char_u *fname;
|
||||
void *cookie;
|
||||
gfp_setname(char_u *fname, void *cookie)
|
||||
{
|
||||
char_u *gfp_buffer = cookie;
|
||||
|
||||
@@ -5101,10 +5050,7 @@ gfp_setname(fname, cookie)
|
||||
* Return FAIL for failure and OK if buffer[MAXPATHL] contains the result.
|
||||
*/
|
||||
int
|
||||
gui_find_bitmap(name, buffer, ext)
|
||||
char_u *name;
|
||||
char_u *buffer;
|
||||
char *ext;
|
||||
gui_find_bitmap(char_u *name, char_u *buffer, char *ext)
|
||||
{
|
||||
if (STRLEN(name) > MAXPATHL - 14)
|
||||
return FAIL;
|
||||
@@ -5124,10 +5070,7 @@ gui_find_bitmap(name, buffer, ext)
|
||||
* contains "name".
|
||||
*/
|
||||
void
|
||||
gui_find_iconfile(name, buffer, ext)
|
||||
char_u *name;
|
||||
char_u *buffer;
|
||||
char *ext;
|
||||
gui_find_iconfile(char_u *name, char_u *buffer, char *ext)
|
||||
{
|
||||
char_u buf[MAXPATHL + 1];
|
||||
|
||||
@@ -5140,7 +5083,7 @@ gui_find_iconfile(name, buffer, ext)
|
||||
|
||||
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(PROTO)
|
||||
void
|
||||
display_errors()
|
||||
display_errors(void)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -5172,7 +5115,7 @@ display_errors()
|
||||
* allow typing on stdin.
|
||||
*/
|
||||
int
|
||||
no_console_input()
|
||||
no_console_input(void)
|
||||
{
|
||||
return ((!gui.in_use || gui.starting)
|
||||
# ifndef NO_CONSOLE
|
||||
@@ -5189,7 +5132,7 @@ no_console_input()
|
||||
* Update the current window and the screen.
|
||||
*/
|
||||
void
|
||||
gui_update_screen()
|
||||
gui_update_screen(void)
|
||||
{
|
||||
#ifdef FEAT_CONCEAL
|
||||
linenr_T conceal_old_cursor_line = 0;
|
||||
@@ -5260,10 +5203,10 @@ static void concat_esc(garray_T *gap, char_u *text, int what);
|
||||
* Returns an allocated string.
|
||||
*/
|
||||
char_u *
|
||||
get_find_dialog_text(arg, wwordp, mcasep)
|
||||
char_u *arg;
|
||||
int *wwordp; /* return: TRUE if \< \> found */
|
||||
int *mcasep; /* return: TRUE if \C found */
|
||||
get_find_dialog_text(
|
||||
char_u *arg,
|
||||
int *wwordp, /* return: TRUE if \< \> found */
|
||||
int *mcasep) /* return: TRUE if \C found */
|
||||
{
|
||||
char_u *text;
|
||||
|
||||
@@ -5321,10 +5264,7 @@ get_find_dialog_text(arg, wwordp, mcasep)
|
||||
* Concatenate "text" to grow array "gap", escaping "what" with a backslash.
|
||||
*/
|
||||
static void
|
||||
concat_esc(gap, text, what)
|
||||
garray_T *gap;
|
||||
char_u *text;
|
||||
int what;
|
||||
concat_esc(garray_T *gap, char_u *text, int what)
|
||||
{
|
||||
while (*text != NUL)
|
||||
{
|
||||
@@ -5350,11 +5290,11 @@ concat_esc(gap, text, what)
|
||||
* Return TRUE when something was added to the input buffer.
|
||||
*/
|
||||
int
|
||||
gui_do_findrepl(flags, find_text, repl_text, down)
|
||||
int flags; /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */
|
||||
char_u *find_text;
|
||||
char_u *repl_text;
|
||||
int down; /* Search downwards. */
|
||||
gui_do_findrepl(
|
||||
int flags, /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */
|
||||
char_u *find_text,
|
||||
char_u *repl_text,
|
||||
int down) /* Search downwards. */
|
||||
{
|
||||
garray_T ga;
|
||||
int i;
|
||||
@@ -5484,9 +5424,7 @@ static void gui_wingoto_xy(int x, int y);
|
||||
* Jump to the window at specified point (x, y).
|
||||
*/
|
||||
static void
|
||||
gui_wingoto_xy(x, y)
|
||||
int x;
|
||||
int y;
|
||||
gui_wingoto_xy(int x, int y)
|
||||
{
|
||||
int row = Y_2_ROW(y);
|
||||
int col = X_2_COL(x);
|
||||
@@ -5508,12 +5446,12 @@ gui_wingoto_xy(x, y)
|
||||
* fnames after call this function.
|
||||
*/
|
||||
void
|
||||
gui_handle_drop(x, y, modifiers, fnames, count)
|
||||
int x UNUSED;
|
||||
int y UNUSED;
|
||||
int_u modifiers;
|
||||
char_u **fnames;
|
||||
int count;
|
||||
gui_handle_drop(
|
||||
int x UNUSED,
|
||||
int y UNUSED,
|
||||
int_u modifiers,
|
||||
char_u **fnames,
|
||||
int count)
|
||||
{
|
||||
int i;
|
||||
char_u *p;
|
||||
|
||||
+108
-171
@@ -240,8 +240,7 @@ static int SFtwiddle = 0;
|
||||
static int SFchdir(char *path);
|
||||
|
||||
static int
|
||||
SFchdir(path)
|
||||
char *path;
|
||||
SFchdir(char *path)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -260,8 +259,7 @@ SFchdir(path)
|
||||
static void SFfree(int i);
|
||||
|
||||
static void
|
||||
SFfree(i)
|
||||
int i;
|
||||
SFfree(int i)
|
||||
{
|
||||
SFDir *dir;
|
||||
int j;
|
||||
@@ -284,9 +282,7 @@ SFfree(i)
|
||||
static void SFstrdup(char **s1, char *s2);
|
||||
|
||||
static void
|
||||
SFstrdup(s1, s2)
|
||||
char **s1;
|
||||
char *s2;
|
||||
SFstrdup(char **s1, char *s2)
|
||||
{
|
||||
*s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2);
|
||||
}
|
||||
@@ -294,8 +290,7 @@ SFstrdup(s1, s2)
|
||||
static void SFunreadableDir(SFDir *dir);
|
||||
|
||||
static void
|
||||
SFunreadableDir(dir)
|
||||
SFDir *dir;
|
||||
SFunreadableDir(SFDir *dir)
|
||||
{
|
||||
char *cannotOpen = _("<cannot open> ");
|
||||
|
||||
@@ -310,9 +305,7 @@ SFunreadableDir(dir)
|
||||
static void SFreplaceText(SFDir *dir, char *str);
|
||||
|
||||
static void
|
||||
SFreplaceText(dir, str)
|
||||
SFDir *dir;
|
||||
char *str;
|
||||
SFreplaceText(SFDir *dir, char *str)
|
||||
{
|
||||
int len;
|
||||
|
||||
@@ -333,8 +326,7 @@ SFreplaceText(dir, str)
|
||||
static void SFexpand(char *str);
|
||||
|
||||
static void
|
||||
SFexpand(str)
|
||||
char *str;
|
||||
SFexpand(char *str)
|
||||
{
|
||||
int len;
|
||||
int cmp;
|
||||
@@ -390,9 +382,7 @@ SFexpand(str)
|
||||
static int SFfindFile(SFDir *dir, char *str);
|
||||
|
||||
static int
|
||||
SFfindFile(dir, str)
|
||||
SFDir *dir;
|
||||
char *str;
|
||||
SFfindFile(SFDir *dir, char *str)
|
||||
{
|
||||
int i, last, max;
|
||||
char *name, save;
|
||||
@@ -491,7 +481,7 @@ SFfindFile(dir, str)
|
||||
static void SFunselect(void);
|
||||
|
||||
static void
|
||||
SFunselect()
|
||||
SFunselect(void)
|
||||
{
|
||||
SFDir *dir;
|
||||
|
||||
@@ -505,8 +495,7 @@ SFunselect()
|
||||
static int SFcompareLogins(const void *p, const void *q);
|
||||
|
||||
static int
|
||||
SFcompareLogins(p, q)
|
||||
const void *p, *q;
|
||||
SFcompareLogins(const void *p, const void *q)
|
||||
{
|
||||
return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name);
|
||||
}
|
||||
@@ -514,7 +503,7 @@ SFcompareLogins(p, q)
|
||||
static void SFgetHomeDirs(void);
|
||||
|
||||
static void
|
||||
SFgetHomeDirs()
|
||||
SFgetHomeDirs(void)
|
||||
{
|
||||
struct passwd *pw;
|
||||
int Alloc;
|
||||
@@ -582,8 +571,7 @@ SFgetHomeDirs()
|
||||
static int SFfindHomeDir(char *begin, char *end);
|
||||
|
||||
static int
|
||||
SFfindHomeDir(begin, end)
|
||||
char *begin, *end;
|
||||
SFfindHomeDir(char *begin, char *end)
|
||||
{
|
||||
char save;
|
||||
char *theRest;
|
||||
@@ -613,7 +601,7 @@ SFfindHomeDir(begin, end)
|
||||
}
|
||||
|
||||
static void
|
||||
SFupdatePath()
|
||||
SFupdatePath(void)
|
||||
{
|
||||
static int Alloc;
|
||||
static int wasTwiddle = 0;
|
||||
@@ -807,8 +795,7 @@ SFupdatePath()
|
||||
|
||||
#ifdef XtNinternational
|
||||
static int
|
||||
WcsLen(p)
|
||||
wchar_t *p;
|
||||
WcsLen(wchar_t *p)
|
||||
{
|
||||
int i = 0;
|
||||
while (*p++ != 0)
|
||||
@@ -818,8 +805,7 @@ WcsLen(p)
|
||||
#endif
|
||||
|
||||
static void
|
||||
SFsetText(path)
|
||||
char *path;
|
||||
SFsetText(char *path)
|
||||
{
|
||||
XawTextBlock text;
|
||||
|
||||
@@ -852,19 +838,19 @@ SFsetText(path)
|
||||
}
|
||||
|
||||
static void
|
||||
SFbuttonPressList(w, n, event)
|
||||
Widget w UNUSED;
|
||||
int n UNUSED;
|
||||
XButtonPressedEvent *event UNUSED;
|
||||
SFbuttonPressList(
|
||||
Widget w UNUSED,
|
||||
int n UNUSED,
|
||||
XButtonPressedEvent *event UNUSED)
|
||||
{
|
||||
SFbuttonPressed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
SFbuttonReleaseList(w, n, event)
|
||||
Widget w;
|
||||
int n;
|
||||
XButtonReleasedEvent *event;
|
||||
SFbuttonReleaseList(
|
||||
Widget w,
|
||||
int n,
|
||||
XButtonReleasedEvent *event)
|
||||
{
|
||||
SFDir *dir;
|
||||
|
||||
@@ -885,9 +871,7 @@ SFbuttonReleaseList(w, n, event)
|
||||
static int SFcheckDir(int n, SFDir *dir);
|
||||
|
||||
static int
|
||||
SFcheckDir(n, dir)
|
||||
int n;
|
||||
SFDir *dir;
|
||||
SFcheckDir(int n, SFDir *dir)
|
||||
{
|
||||
struct stat statBuf;
|
||||
int i;
|
||||
@@ -951,8 +935,7 @@ SFcheckDir(n, dir)
|
||||
static int SFcheckFiles(SFDir *dir);
|
||||
|
||||
static int
|
||||
SFcheckFiles(dir)
|
||||
SFDir *dir;
|
||||
SFcheckFiles(SFDir *dir)
|
||||
{
|
||||
int from, to;
|
||||
int result;
|
||||
@@ -988,9 +971,7 @@ SFcheckFiles(dir)
|
||||
}
|
||||
|
||||
static void
|
||||
SFdirModTimer(cl, id)
|
||||
XtPointer cl UNUSED;
|
||||
XtIntervalId *id UNUSED;
|
||||
SFdirModTimer(XtPointer cl UNUSED, XtIntervalId *id UNUSED)
|
||||
{
|
||||
static int n = -1;
|
||||
static int f = 0;
|
||||
@@ -1036,8 +1017,7 @@ SFdirModTimer(cl, id)
|
||||
/* Return a single character describing what kind of file STATBUF is. */
|
||||
|
||||
static char
|
||||
SFstatChar(statBuf)
|
||||
struct stat *statBuf;
|
||||
SFstatChar(struct stat *statBuf)
|
||||
{
|
||||
if (S_ISDIR (statBuf->st_mode))
|
||||
return '/';
|
||||
@@ -1100,7 +1080,7 @@ static XtIntervalId SFscrollTimerId;
|
||||
static void SFinitFont(void);
|
||||
|
||||
static void
|
||||
SFinitFont()
|
||||
SFinitFont(void)
|
||||
{
|
||||
TextData *data;
|
||||
#ifdef FEAT_XFONTSET
|
||||
@@ -1151,7 +1131,7 @@ SFinitFont()
|
||||
static void SFcreateGC(void);
|
||||
|
||||
static void
|
||||
SFcreateGC()
|
||||
SFcreateGC(void)
|
||||
{
|
||||
XGCValues gcValues;
|
||||
XRectangle rectangles[1];
|
||||
@@ -1209,9 +1189,7 @@ SFcreateGC()
|
||||
}
|
||||
|
||||
static void
|
||||
SFclearList(n, doScroll)
|
||||
int n;
|
||||
int doScroll;
|
||||
SFclearList(int n, int doScroll)
|
||||
{
|
||||
SFDir *dir;
|
||||
|
||||
@@ -1286,9 +1264,7 @@ SFclearList(n, doScroll)
|
||||
static void SFdeleteEntry(SFDir *dir, SFEntry *entry);
|
||||
|
||||
static void
|
||||
SFdeleteEntry(dir, entry)
|
||||
SFDir *dir;
|
||||
SFEntry *entry;
|
||||
SFdeleteEntry(SFDir *dir, SFEntry *entry)
|
||||
{
|
||||
SFEntry *e;
|
||||
SFEntry *end;
|
||||
@@ -1340,10 +1316,10 @@ SFdeleteEntry(dir, entry)
|
||||
static void SFwriteStatChar(char *name, int last, struct stat *statBuf);
|
||||
|
||||
static void
|
||||
SFwriteStatChar(name, last, statBuf)
|
||||
char *name;
|
||||
int last;
|
||||
struct stat *statBuf;
|
||||
SFwriteStatChar(
|
||||
char *name,
|
||||
int last,
|
||||
struct stat *statBuf)
|
||||
{
|
||||
name[last] = SFstatChar(statBuf);
|
||||
}
|
||||
@@ -1351,9 +1327,7 @@ SFwriteStatChar(name, last, statBuf)
|
||||
static int SFstatAndCheck(SFDir *dir, SFEntry *entry);
|
||||
|
||||
static int
|
||||
SFstatAndCheck(dir, entry)
|
||||
SFDir *dir;
|
||||
SFEntry *entry;
|
||||
SFstatAndCheck(SFDir *dir, SFEntry *entry)
|
||||
{
|
||||
struct stat statBuf;
|
||||
char save;
|
||||
@@ -1414,11 +1388,11 @@ SFstatAndCheck(dir, entry)
|
||||
|
||||
|
||||
static void
|
||||
SFdrawStrings(w, dir, from, to)
|
||||
Window w;
|
||||
SFDir *dir;
|
||||
int from;
|
||||
int to;
|
||||
SFdrawStrings(
|
||||
Window w,
|
||||
SFDir *dir,
|
||||
int from,
|
||||
int to)
|
||||
{
|
||||
int i;
|
||||
SFEntry *entry;
|
||||
@@ -1501,9 +1475,7 @@ SFdrawStrings(w, dir, from, to)
|
||||
}
|
||||
|
||||
static void
|
||||
SFdrawList(n, doScroll)
|
||||
int n;
|
||||
int doScroll;
|
||||
SFdrawList(int n, int doScroll)
|
||||
{
|
||||
SFDir *dir;
|
||||
Window w;
|
||||
@@ -1539,8 +1511,7 @@ SFdrawList(n, doScroll)
|
||||
}
|
||||
|
||||
static void
|
||||
SFdrawLists(doScroll)
|
||||
int doScroll;
|
||||
SFdrawLists(int doScroll)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1549,8 +1520,7 @@ SFdrawLists(doScroll)
|
||||
}
|
||||
|
||||
static void
|
||||
SFinvertEntry(n)
|
||||
int n;
|
||||
SFinvertEntry(int n)
|
||||
{
|
||||
XFillRectangle(
|
||||
SFdisplay,
|
||||
@@ -1565,7 +1535,7 @@ SFinvertEntry(n)
|
||||
static unsigned long SFscrollTimerInterval(void);
|
||||
|
||||
static unsigned long
|
||||
SFscrollTimerInterval()
|
||||
SFscrollTimerInterval(void)
|
||||
{
|
||||
static int maxVal = 200;
|
||||
static int varyDist = 50;
|
||||
@@ -1594,9 +1564,7 @@ SFscrollTimerInterval()
|
||||
static void SFscrollTimer(XtPointer p, XtIntervalId *id);
|
||||
|
||||
static void
|
||||
SFscrollTimer(p, id)
|
||||
XtPointer p;
|
||||
XtIntervalId *id UNUSED;
|
||||
SFscrollTimer(XtPointer p, XtIntervalId *id UNUSED)
|
||||
{
|
||||
SFDir *dir;
|
||||
int save;
|
||||
@@ -1646,9 +1614,7 @@ SFscrollTimer(p, id)
|
||||
}
|
||||
|
||||
static int
|
||||
SFnewInvertEntry(n, event)
|
||||
int n;
|
||||
XMotionEvent *event;
|
||||
SFnewInvertEntry(int n, XMotionEvent *event)
|
||||
{
|
||||
int x, y;
|
||||
int nw;
|
||||
@@ -1693,10 +1659,7 @@ SFnewInvertEntry(n, event)
|
||||
}
|
||||
|
||||
static void
|
||||
SFenterList(w, n, event)
|
||||
Widget w UNUSED;
|
||||
int n;
|
||||
XEnterWindowEvent *event;
|
||||
SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
|
||||
{
|
||||
int nw;
|
||||
|
||||
@@ -1716,10 +1679,7 @@ SFenterList(w, n, event)
|
||||
}
|
||||
|
||||
static void
|
||||
SFleaveList(w, n, event)
|
||||
Widget w UNUSED;
|
||||
int n;
|
||||
XEvent *event UNUSED;
|
||||
SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED)
|
||||
{
|
||||
if (SFcurrentInvert[n] != -1)
|
||||
{
|
||||
@@ -1729,10 +1689,7 @@ SFleaveList(w, n, event)
|
||||
}
|
||||
|
||||
static void
|
||||
SFmotionList(w, n, event)
|
||||
Widget w UNUSED;
|
||||
int n;
|
||||
XMotionEvent *event;
|
||||
SFmotionList(Widget w UNUSED, int n, XMotionEvent *event)
|
||||
{
|
||||
int nw;
|
||||
|
||||
@@ -1749,10 +1706,7 @@ SFmotionList(w, n, event)
|
||||
}
|
||||
|
||||
static void
|
||||
SFvFloatSliderMovedCallback(w, n, fnew)
|
||||
Widget w;
|
||||
XtPointer n;
|
||||
XtPointer fnew;
|
||||
SFvFloatSliderMovedCallback(Widget w, XtPointer n, XtPointer fnew)
|
||||
{
|
||||
int nw;
|
||||
|
||||
@@ -1761,10 +1715,7 @@ SFvFloatSliderMovedCallback(w, n, fnew)
|
||||
}
|
||||
|
||||
static void
|
||||
SFvSliderMovedCallback(w, n, nw)
|
||||
Widget w UNUSED;
|
||||
int n;
|
||||
int nw;
|
||||
SFvSliderMovedCallback(Widget w UNUSED, int n, int nw)
|
||||
{
|
||||
int old;
|
||||
Window win;
|
||||
@@ -1846,10 +1797,7 @@ SFvSliderMovedCallback(w, n, nw)
|
||||
}
|
||||
|
||||
static void
|
||||
SFvAreaSelectedCallback(w, n, pnew)
|
||||
Widget w;
|
||||
XtPointer n;
|
||||
XtPointer pnew;
|
||||
SFvAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
|
||||
{
|
||||
SFDir *dir;
|
||||
int nw = (int)(long)pnew;
|
||||
@@ -1906,10 +1854,7 @@ SFvAreaSelectedCallback(w, n, pnew)
|
||||
}
|
||||
|
||||
static void
|
||||
SFhSliderMovedCallback(w, n, nw)
|
||||
Widget w UNUSED;
|
||||
XtPointer n;
|
||||
XtPointer nw;
|
||||
SFhSliderMovedCallback(Widget w UNUSED, XtPointer n, XtPointer nw)
|
||||
{
|
||||
SFDir *dir;
|
||||
int save;
|
||||
@@ -1924,10 +1869,7 @@ SFhSliderMovedCallback(w, n, nw)
|
||||
}
|
||||
|
||||
static void
|
||||
SFhAreaSelectedCallback(w, n, pnew)
|
||||
Widget w;
|
||||
XtPointer n;
|
||||
XtPointer pnew;
|
||||
SFhAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
|
||||
{
|
||||
SFDir *dir;
|
||||
int nw = (int)(long)pnew;
|
||||
@@ -1984,10 +1926,10 @@ SFhAreaSelectedCallback(w, n, pnew)
|
||||
}
|
||||
|
||||
static void
|
||||
SFpathSliderMovedCallback(w, client_data, nw)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XtPointer nw;
|
||||
SFpathSliderMovedCallback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XtPointer nw)
|
||||
{
|
||||
SFDir *dir;
|
||||
int n;
|
||||
@@ -2020,10 +1962,10 @@ SFpathSliderMovedCallback(w, client_data, nw)
|
||||
}
|
||||
|
||||
static void
|
||||
SFpathAreaSelectedCallback(w, client_data, pnew)
|
||||
Widget w;
|
||||
XtPointer client_data UNUSED;
|
||||
XtPointer pnew;
|
||||
SFpathAreaSelectedCallback(
|
||||
Widget w,
|
||||
XtPointer client_data UNUSED,
|
||||
XtPointer pnew)
|
||||
{
|
||||
int nw = (int)(long)pnew;
|
||||
float f;
|
||||
@@ -2071,7 +2013,7 @@ SFpathAreaSelectedCallback(w, client_data, pnew)
|
||||
}
|
||||
|
||||
static Boolean
|
||||
SFworkProc()
|
||||
SFworkProc(void)
|
||||
{
|
||||
SFDir *dir;
|
||||
SFEntry *entry;
|
||||
@@ -2100,16 +2042,14 @@ SFworkProc()
|
||||
/***************** Dir.c */
|
||||
|
||||
static int
|
||||
SFcompareEntries(p, q)
|
||||
const void *p;
|
||||
const void *q;
|
||||
SFcompareEntries(const void *p, const void *q)
|
||||
{
|
||||
return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
|
||||
return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
|
||||
}
|
||||
|
||||
static int
|
||||
SFgetDir(dir)
|
||||
SFDir *dir;
|
||||
SFgetDir(
|
||||
SFDir *dir)
|
||||
{
|
||||
SFEntry *result = NULL;
|
||||
int Alloc = 0;
|
||||
@@ -2194,11 +2134,11 @@ static char *oneLineTextEditTranslations = "\
|
||||
static void SFexposeList(Widget w, XtPointer n, XEvent *event, Boolean *cont);
|
||||
|
||||
static void
|
||||
SFexposeList(w, n, event, cont)
|
||||
Widget w UNUSED;
|
||||
XtPointer n;
|
||||
XEvent *event;
|
||||
Boolean *cont UNUSED;
|
||||
SFexposeList(
|
||||
Widget w UNUSED,
|
||||
XtPointer n,
|
||||
XEvent *event,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
if ((event->type == NoExpose) || event->xexpose.count)
|
||||
return;
|
||||
@@ -2209,11 +2149,11 @@ SFexposeList(w, n, event, cont)
|
||||
static void SFmodVerifyCallback(Widget w, XtPointer client_data, XEvent *event, Boolean *cont);
|
||||
|
||||
static void
|
||||
SFmodVerifyCallback(w, client_data, event, cont)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *cont UNUSED;
|
||||
SFmodVerifyCallback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
char buf[2];
|
||||
|
||||
@@ -2227,10 +2167,7 @@ SFmodVerifyCallback(w, client_data, event, cont)
|
||||
static void SFokCallback(Widget w, XtPointer cl, XtPointer cd);
|
||||
|
||||
static void
|
||||
SFokCallback(w, cl, cd)
|
||||
Widget w UNUSED;
|
||||
XtPointer cl UNUSED;
|
||||
XtPointer cd UNUSED;
|
||||
SFokCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
|
||||
{
|
||||
SFstatus = SEL_FILE_OK;
|
||||
}
|
||||
@@ -2244,10 +2181,7 @@ static XtCallbackRec SFokSelect[] =
|
||||
static void SFcancelCallback(Widget w, XtPointer cl, XtPointer cd);
|
||||
|
||||
static void
|
||||
SFcancelCallback(w, cl, cd)
|
||||
Widget w UNUSED;
|
||||
XtPointer cl UNUSED;
|
||||
XtPointer cd UNUSED;
|
||||
SFcancelCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
|
||||
{
|
||||
SFstatus = SEL_FILE_CANCEL;
|
||||
}
|
||||
@@ -2261,11 +2195,11 @@ static XtCallbackRec SFcancelSelect[] =
|
||||
static void SFdismissAction(Widget w, XEvent *event, String *params, Cardinal *num_params);
|
||||
|
||||
static void
|
||||
SFdismissAction(w, event, params, num_params)
|
||||
Widget w UNUSED;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
SFdismissAction(
|
||||
Widget w UNUSED,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
if (event->type == ClientMessage
|
||||
&& (Atom)event->xclient.data.l[0] != SFwmDeleteWindow)
|
||||
@@ -2284,11 +2218,11 @@ static XtActionsRec actions[] =
|
||||
};
|
||||
|
||||
static void
|
||||
SFsetColors(bg, fg, scroll_bg, scroll_fg)
|
||||
guicolor_T bg;
|
||||
guicolor_T fg;
|
||||
guicolor_T scroll_bg;
|
||||
guicolor_T scroll_fg;
|
||||
SFsetColors(
|
||||
guicolor_T bg,
|
||||
guicolor_T fg,
|
||||
guicolor_T scroll_bg,
|
||||
guicolor_T scroll_fg)
|
||||
{
|
||||
if (selFileForm)
|
||||
{
|
||||
@@ -2366,11 +2300,11 @@ SFsetColors(bg, fg, scroll_bg, scroll_fg)
|
||||
}
|
||||
|
||||
static void
|
||||
SFcreateWidgets(toplevel, prompt, ok, cancel)
|
||||
Widget toplevel;
|
||||
char *prompt;
|
||||
char *ok;
|
||||
char *cancel;
|
||||
SFcreateWidgets(
|
||||
Widget toplevel,
|
||||
char *prompt,
|
||||
char *ok,
|
||||
char *cancel)
|
||||
{
|
||||
Cardinal n;
|
||||
int listWidth, listHeight;
|
||||
@@ -2686,7 +2620,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel)
|
||||
}
|
||||
|
||||
static void
|
||||
SFtextChanged()
|
||||
SFtextChanged(void)
|
||||
{
|
||||
#if defined(FEAT_XFONTSET) && defined(XtNinternational)
|
||||
if ((unsigned long)_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
|
||||
@@ -2730,7 +2664,7 @@ SFtextChanged()
|
||||
}
|
||||
|
||||
static char *
|
||||
SFgetText()
|
||||
SFgetText(void)
|
||||
{
|
||||
#if defined(FEAT_XFONTSET) && defined(XtNinternational)
|
||||
char *buf;
|
||||
@@ -2756,7 +2690,7 @@ SFgetText()
|
||||
}
|
||||
|
||||
static void
|
||||
SFprepareToReturn()
|
||||
SFprepareToReturn(void)
|
||||
{
|
||||
SFstatus = SEL_FILE_NULL;
|
||||
XtRemoveGrab(selFile);
|
||||
@@ -2770,14 +2704,17 @@ SFprepareToReturn()
|
||||
}
|
||||
|
||||
char *
|
||||
vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, scroll_bg)
|
||||
Widget toplevel;
|
||||
char *prompt;
|
||||
char *init_path;
|
||||
int (*show_entry)();
|
||||
int x, y;
|
||||
guicolor_T fg, bg;
|
||||
guicolor_T scroll_fg, scroll_bg; /* The "Scrollbar" group colors */
|
||||
vim_SelFile(
|
||||
Widget toplevel,
|
||||
char *prompt,
|
||||
char *init_path,
|
||||
int (*show_entry)(),
|
||||
int x,
|
||||
int y,
|
||||
guicolor_T fg,
|
||||
guicolor_T bg,
|
||||
guicolor_T scroll_fg,
|
||||
guicolor_T scroll_bg) /* The "Scrollbar" group colors */
|
||||
{
|
||||
static int firstTime = 1;
|
||||
XEvent event;
|
||||
|
||||
+97
-119
@@ -222,7 +222,7 @@ WidgetClass vim_scrollbarWidgetClass = (WidgetClass)&vim_scrollbarClassRec;
|
||||
#define PAGE_REPEAT 250
|
||||
|
||||
static void
|
||||
ClassInitialize()
|
||||
ClassInitialize(void)
|
||||
{
|
||||
XawInitializeWidgetSet();
|
||||
XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation,
|
||||
@@ -232,11 +232,12 @@ ClassInitialize()
|
||||
#define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width
|
||||
|
||||
static void
|
||||
FillArea(sbw, top, bottom, fill, draw_shadow)
|
||||
ScrollbarWidget sbw;
|
||||
Position top, bottom;
|
||||
int fill;
|
||||
int draw_shadow;
|
||||
FillArea(
|
||||
ScrollbarWidget sbw,
|
||||
Position top,
|
||||
Position bottom,
|
||||
int fill,
|
||||
int draw_shadow)
|
||||
{
|
||||
int tlen = bottom - top; /* length of thumb in pixels */
|
||||
int sw, margin, floor;
|
||||
@@ -340,8 +341,7 @@ FillArea(sbw, top, bottom, fill, draw_shadow)
|
||||
*/
|
||||
|
||||
static void
|
||||
PaintThumb(sbw)
|
||||
ScrollbarWidget sbw;
|
||||
PaintThumb(ScrollbarWidget sbw)
|
||||
{
|
||||
Position oldtop, oldbot, newtop, newbot;
|
||||
Dimension margin, tzl;
|
||||
@@ -374,8 +374,7 @@ PaintThumb(sbw)
|
||||
}
|
||||
|
||||
static void
|
||||
PaintArrows(sbw)
|
||||
ScrollbarWidget sbw;
|
||||
PaintArrows(ScrollbarWidget sbw)
|
||||
{
|
||||
XPoint point[6];
|
||||
Dimension thickness = sbw->scrollbar.thickness - 1;
|
||||
@@ -454,8 +453,7 @@ PaintArrows(sbw)
|
||||
}
|
||||
|
||||
static void
|
||||
Destroy(w)
|
||||
Widget w;
|
||||
Destroy(Widget w)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
if (sbw->scrollbar.timer_id != (XtIntervalId) 0)
|
||||
@@ -466,8 +464,7 @@ Destroy(w)
|
||||
}
|
||||
|
||||
static void
|
||||
CreateGC(w)
|
||||
Widget w;
|
||||
CreateGC(Widget w)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
XGCValues gcValues;
|
||||
@@ -505,8 +502,7 @@ CreateGC(w)
|
||||
}
|
||||
|
||||
static void
|
||||
SetDimensions(sbw)
|
||||
ScrollbarWidget sbw;
|
||||
SetDimensions(ScrollbarWidget sbw)
|
||||
{
|
||||
if (sbw->scrollbar.orientation == XtorientVertical)
|
||||
{
|
||||
@@ -521,11 +517,11 @@ SetDimensions(sbw)
|
||||
}
|
||||
|
||||
static void
|
||||
Initialize(request, new, args, num_args)
|
||||
Widget request UNUSED; /* what the client asked for */
|
||||
Widget new; /* what we're going to give him */
|
||||
ArgList args UNUSED;
|
||||
Cardinal *num_args UNUSED;
|
||||
Initialize(
|
||||
Widget request UNUSED, /* what the client asked for */
|
||||
Widget new, /* what we're going to give him */
|
||||
ArgList args UNUSED,
|
||||
Cardinal *num_args UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) new;
|
||||
|
||||
@@ -549,10 +545,10 @@ Initialize(request, new, args, num_args)
|
||||
}
|
||||
|
||||
static void
|
||||
Realize(w, valueMask, attributes)
|
||||
Widget w;
|
||||
Mask *valueMask;
|
||||
XSetWindowAttributes *attributes;
|
||||
Realize(
|
||||
Widget w,
|
||||
Mask *valueMask,
|
||||
XSetWindowAttributes *attributes)
|
||||
{
|
||||
/* The Simple widget actually stuffs the value in the valuemask. */
|
||||
(*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize)
|
||||
@@ -560,12 +556,12 @@ Realize(w, valueMask, attributes)
|
||||
}
|
||||
|
||||
static Boolean
|
||||
SetValues(current, request, desired, args, num_args)
|
||||
Widget current; /* what I am */
|
||||
Widget request UNUSED; /* what he wants me to be */
|
||||
Widget desired; /* what I will become */
|
||||
ArgList args UNUSED;
|
||||
Cardinal *num_args UNUSED;
|
||||
SetValues(
|
||||
Widget current, /* what I am */
|
||||
Widget request UNUSED, /* what he wants me to be */
|
||||
Widget desired, /* what I will become */
|
||||
ArgList args UNUSED,
|
||||
Cardinal *num_args UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) current;
|
||||
ScrollbarWidget dsbw = (ScrollbarWidget) desired;
|
||||
@@ -601,8 +597,7 @@ SetValues(current, request, desired, args, num_args)
|
||||
}
|
||||
|
||||
static void
|
||||
Resize(w)
|
||||
Widget w;
|
||||
Resize(Widget w)
|
||||
{
|
||||
/* ForgetGravity has taken care of background, but thumb may
|
||||
* have to move as a result of the new size. */
|
||||
@@ -612,10 +607,7 @@ Resize(w)
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(w, event, region)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
Region region;
|
||||
Redisplay(Widget w, XEvent *event, Region region)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
int x, y;
|
||||
@@ -650,8 +642,7 @@ Redisplay(w, event, region)
|
||||
|
||||
|
||||
static Boolean
|
||||
CompareEvents(oldEvent, newEvent)
|
||||
XEvent *oldEvent, *newEvent;
|
||||
CompareEvents(XEvent *oldEvent, XEvent *newEvent)
|
||||
{
|
||||
#define Check(field) if (newEvent->field != oldEvent->field) return False;
|
||||
|
||||
@@ -693,10 +684,7 @@ struct EventData
|
||||
};
|
||||
|
||||
static Bool
|
||||
PeekNotifyEvent(dpy, event, args)
|
||||
Display *dpy;
|
||||
XEvent *event;
|
||||
char *args;
|
||||
PeekNotifyEvent(Display *dpy, XEvent *event, char *args)
|
||||
{
|
||||
struct EventData *eventData = (struct EventData*)args;
|
||||
|
||||
@@ -706,9 +694,7 @@ PeekNotifyEvent(dpy, event, args)
|
||||
|
||||
|
||||
static Boolean
|
||||
LookAhead(w, event)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
LookAhead(Widget w, XEvent *event)
|
||||
{
|
||||
XEvent newEvent;
|
||||
struct EventData eventData;
|
||||
@@ -726,10 +712,11 @@ LookAhead(w, event)
|
||||
|
||||
|
||||
static void
|
||||
ExtractPosition(event, x, y, state)
|
||||
XEvent *event;
|
||||
Position *x, *y; /* RETURN */
|
||||
unsigned int *state; /* RETURN */
|
||||
ExtractPosition(
|
||||
XEvent *event,
|
||||
Position *x, /* RETURN */
|
||||
Position *y, /* RETURN */
|
||||
unsigned int *state) /* RETURN */
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
@@ -768,11 +755,11 @@ ExtractPosition(event, x, y, state)
|
||||
}
|
||||
|
||||
static void
|
||||
HandleThumb(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params;
|
||||
Cardinal *num_params;
|
||||
HandleThumb(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Position x, y, loc;
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
@@ -791,9 +778,7 @@ HandleThumb(w, event, params, num_params)
|
||||
}
|
||||
|
||||
static void
|
||||
RepeatNotify(client_data, idp)
|
||||
XtPointer client_data;
|
||||
XtIntervalId *idp UNUSED;
|
||||
RepeatNotify(XtPointer client_data, XtIntervalId *idp UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) client_data;
|
||||
int call_data;
|
||||
@@ -833,57 +818,56 @@ RepeatNotify(client_data, idp)
|
||||
* Same as above, but for floating numbers.
|
||||
*/
|
||||
static float
|
||||
FloatInRange(num, small, big)
|
||||
float num, small, big;
|
||||
FloatInRange(float num, float small, float big)
|
||||
{
|
||||
return (num < small) ? small : ((num > big) ? big : num);
|
||||
}
|
||||
|
||||
static void
|
||||
ScrollOneLineUp(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
ScrollOneLineUp(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollSome(w, event, -ONE_LINE_DATA);
|
||||
}
|
||||
|
||||
static void
|
||||
ScrollOneLineDown(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
ScrollOneLineDown(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollSome(w, event, ONE_LINE_DATA);
|
||||
}
|
||||
|
||||
static void
|
||||
ScrollPageDown(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
ScrollPageDown(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollSome(w, event, ONE_PAGE_DATA);
|
||||
}
|
||||
|
||||
static void
|
||||
ScrollPageUp(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
ScrollPageUp(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollSome(w, event, -ONE_PAGE_DATA);
|
||||
}
|
||||
|
||||
static void
|
||||
ScrollSome(w, event, call_data)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
int call_data;
|
||||
ScrollSome(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
int call_data)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
@@ -898,11 +882,11 @@ ScrollSome(w, event, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
NotifyScroll(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
NotifyScroll(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
Position x, y, loc;
|
||||
@@ -987,11 +971,11 @@ NotifyScroll(w, event, params, num_params)
|
||||
}
|
||||
|
||||
static void
|
||||
EndScroll(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event UNUSED;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
EndScroll(
|
||||
Widget w,
|
||||
XEvent *event UNUSED,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
@@ -1002,9 +986,7 @@ EndScroll(w, event, params, num_params)
|
||||
}
|
||||
|
||||
static float
|
||||
FractionLoc(sbw, x, y)
|
||||
ScrollbarWidget sbw;
|
||||
int x, y;
|
||||
FractionLoc(ScrollbarWidget sbw, int x, int y)
|
||||
{
|
||||
int margin;
|
||||
float height, width;
|
||||
@@ -1018,11 +1000,11 @@ FractionLoc(sbw, x, y)
|
||||
}
|
||||
|
||||
static void
|
||||
MoveThumb(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
MoveThumb(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget)w;
|
||||
Position x, y;
|
||||
@@ -1063,11 +1045,11 @@ MoveThumb(w, event, params, num_params)
|
||||
|
||||
|
||||
static void
|
||||
NotifyThumb(w, event, params, num_params)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *params UNUSED;
|
||||
Cardinal *num_params UNUSED;
|
||||
NotifyThumb(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *params UNUSED,
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget)w;
|
||||
/* Use a union to avoid a warning for the weird conversion from float to
|
||||
@@ -1089,8 +1071,7 @@ NotifyThumb(w, event, params, num_params)
|
||||
}
|
||||
|
||||
static void
|
||||
AllocTopShadowGC(w)
|
||||
Widget w;
|
||||
AllocTopShadowGC(Widget w)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
XtGCMask valuemask;
|
||||
@@ -1102,8 +1083,7 @@ AllocTopShadowGC(w)
|
||||
}
|
||||
|
||||
static void
|
||||
AllocBotShadowGC(w)
|
||||
Widget w;
|
||||
AllocBotShadowGC(Widget w)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
XtGCMask valuemask;
|
||||
@@ -1115,11 +1095,11 @@ AllocBotShadowGC(w)
|
||||
}
|
||||
|
||||
static void
|
||||
_Xaw3dDrawShadows(gw, event, region, out)
|
||||
Widget gw;
|
||||
XEvent *event UNUSED;
|
||||
Region region;
|
||||
int out;
|
||||
_Xaw3dDrawShadows(
|
||||
Widget gw,
|
||||
XEvent *event UNUSED,
|
||||
Region region,
|
||||
int out)
|
||||
{
|
||||
XPoint pt[6];
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) gw;
|
||||
@@ -1187,9 +1167,7 @@ _Xaw3dDrawShadows(gw, event, region, out)
|
||||
* Set the scroll bar to the given location.
|
||||
*/
|
||||
void
|
||||
vim_XawScrollbarSetThumb(w, top, shown, max)
|
||||
Widget w;
|
||||
double top, shown, max;
|
||||
vim_XawScrollbarSetThumb(Widget w, double top, double shown, double max)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
|
||||
+124
-150
@@ -87,9 +87,10 @@ static int puller_width = 0;
|
||||
* left or middle mouse button.
|
||||
*/
|
||||
static void
|
||||
gui_athena_scroll_cb_jump(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data, call_data;
|
||||
gui_athena_scroll_cb_jump(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data)
|
||||
{
|
||||
scrollbar_T *sb, *sb_info;
|
||||
long value;
|
||||
@@ -122,9 +123,10 @@ gui_athena_scroll_cb_jump(w, client_data, call_data)
|
||||
* right mouse buttons.
|
||||
*/
|
||||
static void
|
||||
gui_athena_scroll_cb_scroll(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data, call_data;
|
||||
gui_athena_scroll_cb_scroll(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data)
|
||||
{
|
||||
scrollbar_T *sb, *sb_info;
|
||||
long value;
|
||||
@@ -228,7 +230,7 @@ gui_athena_scroll_cb_scroll(w, client_data, call_data)
|
||||
* Create all the Athena widgets necessary.
|
||||
*/
|
||||
void
|
||||
gui_x11_create_widgets()
|
||||
gui_x11_create_widgets(void)
|
||||
{
|
||||
/*
|
||||
* We don't have any borders handled internally by the textArea to worry
|
||||
@@ -325,8 +327,7 @@ gui_x11_create_widgets()
|
||||
* Calculates the Pixmap based on the size of the current menu font.
|
||||
*/
|
||||
static Pixmap
|
||||
gui_athena_create_pullright_pixmap(w)
|
||||
Widget w;
|
||||
gui_athena_create_pullright_pixmap(Widget w)
|
||||
{
|
||||
Pixmap retval;
|
||||
#ifdef FONTSET_ALWAYS
|
||||
@@ -425,7 +426,7 @@ gui_athena_create_pullright_pixmap(w)
|
||||
* Called when the GUI is not going to start after all.
|
||||
*/
|
||||
void
|
||||
gui_x11_destroy_widgets()
|
||||
gui_x11_destroy_widgets(void)
|
||||
{
|
||||
textArea = NULL;
|
||||
#ifdef FEAT_MENU
|
||||
@@ -450,9 +451,7 @@ static void get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen);
|
||||
* Return in "sen".
|
||||
*/
|
||||
static void
|
||||
get_toolbar_pixmap(menu, sen)
|
||||
vimmenu_T *menu;
|
||||
Pixmap *sen;
|
||||
get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen)
|
||||
{
|
||||
char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
|
||||
char **xpm = NULL; /* xpm array */
|
||||
@@ -492,10 +491,7 @@ get_toolbar_pixmap(menu, sen)
|
||||
* insensitive Pixmap too.
|
||||
*/
|
||||
static void
|
||||
createXpmImages(path, xpm, sen)
|
||||
char_u *path;
|
||||
char **xpm;
|
||||
Pixmap *sen;
|
||||
createXpmImages(char_u *path, char **xpm, Pixmap *sen)
|
||||
{
|
||||
Window rootWindow;
|
||||
XpmAttributes attrs;
|
||||
@@ -566,11 +562,11 @@ createXpmImages(path, xpm, sen)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_toolbar_pos(x, y, w, h)
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_mch_set_toolbar_pos(
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
Dimension border;
|
||||
int height;
|
||||
@@ -595,11 +591,11 @@ gui_mch_set_toolbar_pos(x, y, w, h)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_set_text_area_pos(x, y, w, h)
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_mch_set_text_area_pos(
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
XtUnmanageChild(textArea);
|
||||
XtVaSetValues(textArea,
|
||||
@@ -622,7 +618,7 @@ gui_mch_set_text_area_pos(x, y, w, h)
|
||||
* input go to the editor window, not the button
|
||||
*/
|
||||
static void
|
||||
gui_mch_reset_focus()
|
||||
gui_mch_reset_focus(void)
|
||||
{
|
||||
XtSetKeyboardFocus(vimForm, textArea);
|
||||
}
|
||||
@@ -630,7 +626,7 @@ gui_mch_reset_focus()
|
||||
|
||||
|
||||
void
|
||||
gui_x11_set_back_color()
|
||||
gui_x11_set_back_color(void)
|
||||
{
|
||||
if (textArea != NULL)
|
||||
XtVaSetValues(textArea,
|
||||
@@ -652,8 +648,7 @@ static void gui_athena_menu_font(Widget id);
|
||||
static Boolean gui_athena_menu_has_submenus(Widget, Widget);
|
||||
|
||||
void
|
||||
gui_mch_enable_menu(flag)
|
||||
int flag;
|
||||
gui_mch_enable_menu(int flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
@@ -685,11 +680,11 @@ gui_mch_enable_menu(flag)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_menu_pos(x, y, w, h)
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_mch_set_menu_pos(
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
Dimension border;
|
||||
int height;
|
||||
@@ -717,8 +712,7 @@ gui_mch_set_menu_pos(x, y, w, h)
|
||||
* numChildren (end of children).
|
||||
*/
|
||||
static Cardinal
|
||||
athena_calculate_ins_pos(widget)
|
||||
Widget widget;
|
||||
athena_calculate_ins_pos(Widget widget)
|
||||
{
|
||||
/* Assume that if the parent of the vimmenu_T is NULL, then we can get
|
||||
* to this menu by traversing "next", starting at "root_menu".
|
||||
@@ -764,9 +758,7 @@ athena_calculate_ins_pos(widget)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_add_menu(menu, idx)
|
||||
vimmenu_T *menu;
|
||||
int idx UNUSED;
|
||||
gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED)
|
||||
{
|
||||
char_u *pullright_name;
|
||||
Dimension height, space, border;
|
||||
@@ -884,9 +876,7 @@ gui_mch_add_menu(menu, idx)
|
||||
* Ignore widget "ignore" in the pane.
|
||||
*/
|
||||
static Boolean
|
||||
gui_athena_menu_has_submenus(id, ignore)
|
||||
Widget id;
|
||||
Widget ignore;
|
||||
gui_athena_menu_has_submenus(Widget id, Widget ignore)
|
||||
{
|
||||
WidgetList children;
|
||||
Cardinal num_children;
|
||||
@@ -906,8 +896,7 @@ gui_athena_menu_has_submenus(id, ignore)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_athena_menu_font(id)
|
||||
Widget id;
|
||||
gui_athena_menu_font(Widget id)
|
||||
{
|
||||
#ifdef FONTSET_ALWAYS
|
||||
if (gui.menu_fontset != NOFONTSET)
|
||||
@@ -954,7 +943,7 @@ gui_athena_menu_font(id)
|
||||
|
||||
|
||||
void
|
||||
gui_mch_new_menu_font()
|
||||
gui_mch_new_menu_font(void)
|
||||
{
|
||||
Pixmap oldpuller = None;
|
||||
|
||||
@@ -1031,7 +1020,7 @@ gui_mch_new_menu_font()
|
||||
|
||||
#if defined(FEAT_BEVAL) || defined(PROTO)
|
||||
void
|
||||
gui_mch_new_tooltip_font()
|
||||
gui_mch_new_tooltip_font(void)
|
||||
{
|
||||
# ifdef FEAT_TOOLBAR
|
||||
vimmenu_T *menu;
|
||||
@@ -1046,7 +1035,7 @@ gui_mch_new_tooltip_font()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_new_tooltip_colors()
|
||||
gui_mch_new_tooltip_colors(void)
|
||||
{
|
||||
# ifdef FEAT_TOOLBAR
|
||||
vimmenu_T *menu;
|
||||
@@ -1062,9 +1051,9 @@ gui_mch_new_tooltip_colors()
|
||||
#endif
|
||||
|
||||
static void
|
||||
gui_mch_submenu_change(menu, colors)
|
||||
vimmenu_T *menu;
|
||||
int colors; /* TRUE for colors, FALSE for font */
|
||||
gui_mch_submenu_change(
|
||||
vimmenu_T *menu,
|
||||
int colors) /* TRUE for colors, FALSE for font */
|
||||
{
|
||||
vimmenu_T *mp;
|
||||
|
||||
@@ -1141,8 +1130,7 @@ gui_mch_submenu_change(menu, colors)
|
||||
* Replace '.' by '_', can't include '.' in the submenu name.
|
||||
*/
|
||||
static char_u *
|
||||
make_pull_name(name)
|
||||
char_u * name;
|
||||
make_pull_name(char_u * name)
|
||||
{
|
||||
char_u *pname;
|
||||
char_u *p;
|
||||
@@ -1158,9 +1146,7 @@ make_pull_name(name)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_add_menu_item(menu, idx)
|
||||
vimmenu_T *menu;
|
||||
int idx UNUSED;
|
||||
gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
|
||||
{
|
||||
vimmenu_T *parent = menu->parent;
|
||||
|
||||
@@ -1404,7 +1390,7 @@ gui_mch_show_toolbar(int showit)
|
||||
|
||||
|
||||
int
|
||||
gui_mch_compute_toolbar_height()
|
||||
gui_mch_compute_toolbar_height(void)
|
||||
{
|
||||
Dimension height; /* total Toolbar height */
|
||||
Dimension whgt; /* height of each widget */
|
||||
@@ -1439,12 +1425,12 @@ gui_mch_compute_toolbar_height()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
|
||||
Pixel *bgp;
|
||||
Pixel *fgp;
|
||||
Pixel *bsp;
|
||||
Pixel *tsp;
|
||||
Pixel *hsp;
|
||||
gui_mch_get_toolbar_colors(
|
||||
Pixel *bgp,
|
||||
Pixel *fgp,
|
||||
Pixel *bsp,
|
||||
Pixel *tsp,
|
||||
Pixel *hsp)
|
||||
{
|
||||
XtVaGetValues(toolBar, XtNbackground, bgp, XtNborderColor, fgp, NULL);
|
||||
*bsp = *bgp;
|
||||
@@ -1455,14 +1441,13 @@ gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
|
||||
|
||||
|
||||
void
|
||||
gui_mch_toggle_tearoffs(enable)
|
||||
int enable UNUSED;
|
||||
gui_mch_toggle_tearoffs(int enable UNUSED)
|
||||
{
|
||||
/* no tearoff menus */
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_new_menu_colors()
|
||||
gui_mch_new_menu_colors(void)
|
||||
{
|
||||
if (menuBar == (Widget)0)
|
||||
return;
|
||||
@@ -1480,8 +1465,7 @@ gui_mch_new_menu_colors()
|
||||
* Destroy the machine specific menu widget.
|
||||
*/
|
||||
void
|
||||
gui_mch_destroy_menu(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
{
|
||||
Widget parent;
|
||||
|
||||
@@ -1626,9 +1610,9 @@ gui_mch_destroy_menu(menu)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_athena_menu_timeout(client_data, id)
|
||||
XtPointer client_data;
|
||||
XtIntervalId *id UNUSED;
|
||||
gui_athena_menu_timeout(
|
||||
XtPointer client_data,
|
||||
XtIntervalId *id UNUSED)
|
||||
{
|
||||
Widget w = (Widget)client_data;
|
||||
Widget popup;
|
||||
@@ -1658,10 +1642,10 @@ gui_athena_menu_timeout(client_data, id)
|
||||
* This is called when XtPopup() is called.
|
||||
*/
|
||||
static void
|
||||
gui_athena_popup_callback(w, client_data, call_data)
|
||||
Widget w;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
gui_athena_popup_callback(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
/* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */
|
||||
vimmenu_T *menu = (vimmenu_T *)client_data;
|
||||
@@ -1690,11 +1674,11 @@ gui_athena_popup_callback(w, client_data, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_athena_popdown_submenus_action(w, event, args, nargs)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *args;
|
||||
Cardinal *nargs;
|
||||
gui_athena_popdown_submenus_action(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *args,
|
||||
Cardinal *nargs)
|
||||
{
|
||||
WidgetList children;
|
||||
Cardinal num_children;
|
||||
@@ -1719,8 +1703,7 @@ gui_athena_popdown_submenus_action(w, event, args, nargs)
|
||||
|
||||
/* Used to determine if the given widget has a submenu that can be popped up. */
|
||||
static Boolean
|
||||
has_submenu(widget)
|
||||
Widget widget;
|
||||
has_submenu(Widget widget)
|
||||
{
|
||||
if ((widget != NULL) && XtIsSubclass(widget,smeBSBObjectClass))
|
||||
{
|
||||
@@ -1734,11 +1717,11 @@ has_submenu(widget)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_athena_delayed_arm_action(w, event, args, nargs)
|
||||
Widget w;
|
||||
XEvent *event;
|
||||
String *args;
|
||||
Cardinal *nargs;
|
||||
gui_athena_delayed_arm_action(
|
||||
Widget w,
|
||||
XEvent *event,
|
||||
String *args,
|
||||
Cardinal *nargs)
|
||||
{
|
||||
Dimension width, height;
|
||||
|
||||
@@ -1778,8 +1761,7 @@ gui_athena_delayed_arm_action(w, event, args, nargs)
|
||||
}
|
||||
|
||||
static Widget
|
||||
get_popup_entry(w)
|
||||
Widget w;
|
||||
get_popup_entry(Widget w)
|
||||
{
|
||||
Widget menuw;
|
||||
|
||||
@@ -1794,8 +1776,7 @@ get_popup_entry(w)
|
||||
* that is to be popped up.
|
||||
*/
|
||||
static Widget
|
||||
submenu_widget(widget)
|
||||
Widget widget;
|
||||
submenu_widget(Widget widget)
|
||||
{
|
||||
/* Precondition: has_submenu(widget) == True
|
||||
* XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True
|
||||
@@ -1814,8 +1795,7 @@ submenu_widget(widget)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_show_popupmenu(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_show_popupmenu(vimmenu_T *menu)
|
||||
{
|
||||
int rootx, rooty, winx, winy;
|
||||
Window root, child;
|
||||
@@ -1850,7 +1830,7 @@ gui_mch_show_popupmenu(menu)
|
||||
* Set the menu and scrollbar colors to their default values.
|
||||
*/
|
||||
void
|
||||
gui_mch_def_colors()
|
||||
gui_mch_def_colors(void)
|
||||
{
|
||||
/*
|
||||
* Get the colors ourselves. Using the automatic conversion doesn't
|
||||
@@ -1875,11 +1855,11 @@ gui_mch_def_colors()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_thumb(sb, val, size, max)
|
||||
scrollbar_T *sb;
|
||||
long val;
|
||||
long size;
|
||||
long max;
|
||||
gui_mch_set_scrollbar_thumb(
|
||||
scrollbar_T *sb,
|
||||
long val,
|
||||
long size,
|
||||
long max)
|
||||
{
|
||||
double v, s;
|
||||
|
||||
@@ -1911,12 +1891,12 @@ gui_mch_set_scrollbar_thumb(sb, val, size, max)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_pos(sb, x, y, w, h)
|
||||
scrollbar_T *sb;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_mch_set_scrollbar_pos(
|
||||
scrollbar_T *sb,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
if (sb->id == (Widget)0)
|
||||
return;
|
||||
@@ -1932,9 +1912,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_enable_scrollbar(sb, flag)
|
||||
scrollbar_T *sb;
|
||||
int flag;
|
||||
gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
{
|
||||
@@ -1946,9 +1924,9 @@ gui_mch_enable_scrollbar(sb, flag)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_create_scrollbar(sb, orient)
|
||||
scrollbar_T *sb;
|
||||
int orient; /* SBAR_VERT or SBAR_HORIZ */
|
||||
gui_mch_create_scrollbar(
|
||||
scrollbar_T *sb,
|
||||
int orient) /* SBAR_VERT or SBAR_HORIZ */
|
||||
{
|
||||
sb->id = XtVaCreateWidget("scrollBar",
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
@@ -1984,8 +1962,7 @@ gui_mch_create_scrollbar(sb, orient)
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(sb)
|
||||
scrollbar_T *sb;
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtDestroyWidget(sb->id);
|
||||
@@ -1993,8 +1970,7 @@ gui_mch_destroy_scrollbar(sb)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_colors(sb)
|
||||
scrollbar_T *sb;
|
||||
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtVaSetValues(sb->id,
|
||||
@@ -2011,7 +1987,7 @@ gui_mch_set_scrollbar_colors(sb)
|
||||
* Miscellaneous stuff:
|
||||
*/
|
||||
Window
|
||||
gui_x11_get_wid()
|
||||
gui_x11_get_wid(void)
|
||||
{
|
||||
return XtWindow(textArea);
|
||||
}
|
||||
@@ -2022,13 +1998,13 @@ gui_x11_get_wid()
|
||||
* Returns the selected name in allocated memory, or NULL for Cancel.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_browse(saving, title, dflt, ext, initdir, filter)
|
||||
int saving UNUSED; /* select file to write */
|
||||
char_u *title; /* title for the window */
|
||||
char_u *dflt; /* default name */
|
||||
char_u *ext UNUSED; /* extension added */
|
||||
char_u *initdir; /* initial directory, NULL for current dir */
|
||||
char_u *filter UNUSED; /* file name filter */
|
||||
gui_mch_browse(
|
||||
int saving UNUSED, /* select file to write */
|
||||
char_u *title, /* title for the window */
|
||||
char_u *dflt, /* default name */
|
||||
char_u *ext UNUSED, /* extension added */
|
||||
char_u *initdir, /* initial directory, NULL for current dir */
|
||||
char_u *filter UNUSED) /* file name filter */
|
||||
{
|
||||
Position x, y;
|
||||
char_u dirbuf[MAXPATHL];
|
||||
@@ -2075,11 +2051,11 @@ static void dialog_wm_handler(Widget w, XtPointer client_data, XEvent *event, Bo
|
||||
* hitting the "OK" button, ESC like "Cancel".
|
||||
*/
|
||||
static void
|
||||
keyhit_callback(w, client_data, event, cont)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *cont UNUSED;
|
||||
keyhit_callback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
char buf[2];
|
||||
|
||||
@@ -2093,10 +2069,10 @@ keyhit_callback(w, client_data, event, cont)
|
||||
}
|
||||
|
||||
static void
|
||||
butproc(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
butproc(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
dialogStatus = (int)(long)client_data + 1;
|
||||
}
|
||||
@@ -2105,11 +2081,11 @@ butproc(w, client_data, call_data)
|
||||
* Function called when dialog window closed.
|
||||
*/
|
||||
static void
|
||||
dialog_wm_handler(w, client_data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
dialog_wm_handler(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
if (event->type == ClientMessage
|
||||
&& (Atom)((XClientMessageEvent *)event)->data.l[0] == dialogatom)
|
||||
@@ -2117,14 +2093,14 @@ dialog_wm_handler(w, client_data, event, dum)
|
||||
}
|
||||
|
||||
int
|
||||
gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd)
|
||||
int type UNUSED;
|
||||
char_u *title;
|
||||
char_u *message;
|
||||
char_u *buttons;
|
||||
int dfltbutton UNUSED;
|
||||
char_u *textfield;
|
||||
int ex_cmd UNUSED;
|
||||
gui_mch_dialog(
|
||||
int type UNUSED,
|
||||
char_u *title,
|
||||
char_u *message,
|
||||
char_u *buttons,
|
||||
int dfltbutton UNUSED,
|
||||
char_u *textfield,
|
||||
int ex_cmd UNUSED)
|
||||
{
|
||||
char_u *buts;
|
||||
char_u *p, *next;
|
||||
@@ -2305,8 +2281,7 @@ error:
|
||||
* Set the colors of Widget "id" to the menu colors.
|
||||
*/
|
||||
static void
|
||||
gui_athena_menu_colors(id)
|
||||
Widget id;
|
||||
gui_athena_menu_colors(Widget id)
|
||||
{
|
||||
if (gui.menu_bg_pixel != INVALCOLOR)
|
||||
XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL);
|
||||
@@ -2319,8 +2294,7 @@ gui_athena_menu_colors(id)
|
||||
* Set the colors of Widget "id" to the scroll colors.
|
||||
*/
|
||||
static void
|
||||
gui_athena_scroll_colors(id)
|
||||
Widget id;
|
||||
gui_athena_scroll_colors(Widget id)
|
||||
{
|
||||
if (gui.scroll_bg_pixel != INVALCOLOR)
|
||||
XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL);
|
||||
|
||||
+33
-53
@@ -16,9 +16,7 @@
|
||||
* Common code, invoked when the mouse is resting for a moment.
|
||||
*/
|
||||
void
|
||||
general_beval_cb(beval, state)
|
||||
BalloonEval *beval;
|
||||
int state UNUSED;
|
||||
general_beval_cb(BalloonEval *beval, int state UNUSED)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
win_T *wp;
|
||||
@@ -192,11 +190,11 @@ static void createBalloonEvalWindow(BalloonEval *);
|
||||
* Returns a pointer to the resulting object (NULL when out of memory).
|
||||
*/
|
||||
BalloonEval *
|
||||
gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
|
||||
void *target;
|
||||
char_u *mesg;
|
||||
void (*mesgCB)(BalloonEval *, int);
|
||||
void *clientData;
|
||||
gui_mch_create_beval_area(
|
||||
void *target,
|
||||
char_u *mesg,
|
||||
void (*mesgCB)(BalloonEval *, int),
|
||||
void *clientData)
|
||||
{
|
||||
#ifndef FEAT_GUI_GTK
|
||||
char *display_name; /* get from gui.dpy */
|
||||
@@ -262,8 +260,7 @@ gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
|
||||
* Destroy a balloon-eval and free its associated memory.
|
||||
*/
|
||||
void
|
||||
gui_mch_destroy_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_destroy_beval_area(BalloonEval *beval)
|
||||
{
|
||||
cancelBalloon(beval);
|
||||
removeEventHandler(beval);
|
||||
@@ -278,16 +275,14 @@ gui_mch_destroy_beval_area(beval)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_enable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_enable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
if (beval != NULL)
|
||||
addEventHandler(beval->target, beval);
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_disable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_disable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
if (beval != NULL)
|
||||
removeEventHandler(beval);
|
||||
@@ -301,7 +296,7 @@ gui_mch_disable_beval_area(beval)
|
||||
* Assumption: Only one tooltip can be shown at a time.
|
||||
*/
|
||||
BalloonEval *
|
||||
gui_mch_currently_showing_beval()
|
||||
gui_mch_currently_showing_beval(void)
|
||||
{
|
||||
return current_beval;
|
||||
}
|
||||
@@ -317,13 +312,13 @@ gui_mch_currently_showing_beval()
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
int
|
||||
get_beval_info(beval, getword, winp, lnump, textp, colp)
|
||||
BalloonEval *beval;
|
||||
int getword;
|
||||
win_T **winp;
|
||||
linenr_T *lnump;
|
||||
char_u **textp;
|
||||
int *colp;
|
||||
get_beval_info(
|
||||
BalloonEval *beval,
|
||||
int getword,
|
||||
win_T **winp,
|
||||
linenr_T *lnump,
|
||||
char_u **textp,
|
||||
int *colp)
|
||||
{
|
||||
win_T *wp;
|
||||
int row, col;
|
||||
@@ -427,9 +422,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
|
||||
* Show a balloon with "mesg".
|
||||
*/
|
||||
void
|
||||
gui_mch_post_balloon(beval, mesg)
|
||||
BalloonEval *beval;
|
||||
char_u *mesg;
|
||||
gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
|
||||
{
|
||||
beval->msg = mesg;
|
||||
if (mesg != NULL)
|
||||
@@ -446,8 +439,7 @@ gui_mch_post_balloon(beval, mesg)
|
||||
* Hide the given balloon.
|
||||
*/
|
||||
void
|
||||
gui_mch_unpost_balloon(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_unpost_balloon(BalloonEval *beval)
|
||||
{
|
||||
undrawBalloon(beval);
|
||||
}
|
||||
@@ -687,9 +679,7 @@ balloon_expose_event_cb(GtkWidget *widget,
|
||||
#else /* !FEAT_GUI_GTK */
|
||||
|
||||
static void
|
||||
addEventHandler(target, beval)
|
||||
Widget target;
|
||||
BalloonEval *beval;
|
||||
addEventHandler(Widget target, BalloonEval *beval)
|
||||
{
|
||||
XtAddEventHandler(target,
|
||||
PointerMotionMask | EnterWindowMask |
|
||||
@@ -700,8 +690,7 @@ addEventHandler(target, beval)
|
||||
}
|
||||
|
||||
static void
|
||||
removeEventHandler(beval)
|
||||
BalloonEval *beval;
|
||||
removeEventHandler(BalloonEval *beval)
|
||||
{
|
||||
XtRemoveEventHandler(beval->target,
|
||||
PointerMotionMask | EnterWindowMask |
|
||||
@@ -716,11 +705,11 @@ removeEventHandler(beval)
|
||||
* The X event handler. All it does is call the real event handler.
|
||||
*/
|
||||
static void
|
||||
pointerEventEH(w, client_data, event, unused)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XEvent *event;
|
||||
Boolean *unused UNUSED;
|
||||
pointerEventEH(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XEvent *event,
|
||||
Boolean *unused UNUSED)
|
||||
{
|
||||
BalloonEval *beval = (BalloonEval *)client_data;
|
||||
pointerEvent(beval, event);
|
||||
@@ -733,9 +722,7 @@ pointerEventEH(w, client_data, event, unused)
|
||||
*/
|
||||
|
||||
static void
|
||||
pointerEvent(beval, event)
|
||||
BalloonEval *beval;
|
||||
XEvent *event;
|
||||
pointerEvent(BalloonEval *beval, XEvent *event)
|
||||
{
|
||||
Position distance; /* a measure of how much the pointer moved */
|
||||
Position delta; /* used to compute distance */
|
||||
@@ -866,9 +853,7 @@ pointerEvent(beval, event)
|
||||
}
|
||||
|
||||
static void
|
||||
timerRoutine(dx, id)
|
||||
XtPointer dx;
|
||||
XtIntervalId *id UNUSED;
|
||||
timerRoutine(XtPointer dx, XtIntervalId *id UNUSED)
|
||||
{
|
||||
BalloonEval *beval = (BalloonEval *)dx;
|
||||
|
||||
@@ -885,8 +870,7 @@ timerRoutine(dx, id)
|
||||
#endif /* !FEAT_GUI_GTK */
|
||||
|
||||
static void
|
||||
requestBalloon(beval)
|
||||
BalloonEval *beval;
|
||||
requestBalloon(BalloonEval *beval)
|
||||
{
|
||||
if (beval->showState != ShS_PENDING)
|
||||
{
|
||||
@@ -1177,8 +1161,7 @@ createBalloonEvalWindow(BalloonEval *beval)
|
||||
* Draw a balloon.
|
||||
*/
|
||||
static void
|
||||
drawBalloon(beval)
|
||||
BalloonEval *beval;
|
||||
drawBalloon(BalloonEval *beval)
|
||||
{
|
||||
Dimension w;
|
||||
Dimension h;
|
||||
@@ -1281,8 +1264,7 @@ drawBalloon(beval)
|
||||
* Undraw a balloon.
|
||||
*/
|
||||
static void
|
||||
undrawBalloon(beval)
|
||||
BalloonEval *beval;
|
||||
undrawBalloon(BalloonEval *beval)
|
||||
{
|
||||
if (beval->balloonShell != (Widget)0)
|
||||
XtPopdown(beval->balloonShell);
|
||||
@@ -1292,8 +1274,7 @@ undrawBalloon(beval)
|
||||
}
|
||||
|
||||
static void
|
||||
cancelBalloon(beval)
|
||||
BalloonEval *beval;
|
||||
cancelBalloon(BalloonEval *beval)
|
||||
{
|
||||
if (beval->showState == ShS_SHOWING
|
||||
|| beval->showState == ShS_UPDATE_PENDING)
|
||||
@@ -1309,8 +1290,7 @@ cancelBalloon(beval)
|
||||
|
||||
|
||||
static void
|
||||
createBalloonEvalWindow(beval)
|
||||
BalloonEval *beval;
|
||||
createBalloonEvalWindow(BalloonEval *beval)
|
||||
{
|
||||
Arg args[12];
|
||||
int n;
|
||||
|
||||
+1
-2
@@ -1988,8 +1988,7 @@ entry_changed_cb(GtkWidget * entry, GtkWidget * dialog)
|
||||
* ":helpfind"
|
||||
*/
|
||||
void
|
||||
ex_helpfind(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_helpfind(exarg_T *eap UNUSED)
|
||||
{
|
||||
/* This will fail when menus are not loaded. Well, it's only for
|
||||
* backwards compatibility anyway. */
|
||||
|
||||
+12
-13
@@ -571,7 +571,7 @@ gui_mch_prepare(int *argc, char **argv)
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
gui_mch_free_all()
|
||||
gui_mch_free_all(void)
|
||||
{
|
||||
vim_free(gui_argv);
|
||||
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
|
||||
@@ -2224,10 +2224,10 @@ setup_save_yourself(void)
|
||||
* GTK tells us that XSMP needs attention
|
||||
*/
|
||||
static gboolean
|
||||
local_xsmp_handle_requests(source, condition, data)
|
||||
GIOChannel *source UNUSED;
|
||||
GIOCondition condition;
|
||||
gpointer data;
|
||||
local_xsmp_handle_requests(
|
||||
GIOChannel *source UNUSED,
|
||||
GIOCondition condition,
|
||||
gpointer data)
|
||||
{
|
||||
if (condition == G_IO_IN)
|
||||
{
|
||||
@@ -3070,8 +3070,7 @@ gui_mch_update_tabline(void)
|
||||
* Set the current tab to "nr". First tab is 1.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_curtab(nr)
|
||||
int nr;
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
if (gui.tabline == NULL)
|
||||
return;
|
||||
@@ -3944,7 +3943,7 @@ force_shell_resize_idle(gpointer data)
|
||||
* Return TRUE if the main window is maximized.
|
||||
*/
|
||||
int
|
||||
gui_mch_maximized()
|
||||
gui_mch_maximized(void)
|
||||
{
|
||||
return (gui.mainwin != NULL && gui.mainwin->window != NULL
|
||||
&& (gdk_window_get_state(gui.mainwin->window)
|
||||
@@ -3955,7 +3954,7 @@ gui_mch_maximized()
|
||||
* Unmaximize the main window
|
||||
*/
|
||||
void
|
||||
gui_mch_unmaximize()
|
||||
gui_mch_unmaximize(void)
|
||||
{
|
||||
if (gui.mainwin != NULL)
|
||||
gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
|
||||
@@ -3966,7 +3965,7 @@ gui_mch_unmaximize()
|
||||
* new Rows and Columns. This is like resizing the window.
|
||||
*/
|
||||
void
|
||||
gui_mch_newfont()
|
||||
gui_mch_newfont(void)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
@@ -5422,9 +5421,9 @@ input_timer_cb(gpointer data)
|
||||
*/
|
||||
static void
|
||||
sniff_request_cb(
|
||||
gpointer data,
|
||||
gint source_fd,
|
||||
GdkInputCondition condition)
|
||||
gpointer data UNUSED,
|
||||
gint source_fd UNUSED,
|
||||
GdkInputCondition condition UNUSED)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
|
||||
|
||||
|
||||
+3
-6
@@ -2607,8 +2607,7 @@ gui_mch_mousehide(int hide)
|
||||
* the menu that we should display
|
||||
*/
|
||||
void
|
||||
gui_mac_handle_contextual_menu(event)
|
||||
EventRecord *event;
|
||||
gui_mac_handle_contextual_menu(EventRecord *event)
|
||||
{
|
||||
/*
|
||||
* Clone PopUp to use menu
|
||||
@@ -3697,8 +3696,7 @@ gui_mch_set_font(GuiFont font)
|
||||
* If a font is not going to be used, free its structure.
|
||||
*/
|
||||
void
|
||||
gui_mch_free_font(font)
|
||||
GuiFont font;
|
||||
gui_mch_free_font(GuiFont font)
|
||||
{
|
||||
/*
|
||||
* Free font when "font" is not 0.
|
||||
@@ -6897,8 +6895,7 @@ gui_mch_update_tabline(void)
|
||||
* Set the current tab to "nr". First tab is 1.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_curtab(nr)
|
||||
int nr;
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
DataBrowserItemID item = nr;
|
||||
SetDataBrowserSelectedItems(dataBrowser, 1, &item, kDataBrowserItemsAssign);
|
||||
|
||||
+170
-222
@@ -118,9 +118,7 @@ static void gui_motif_scroll_colors(Widget id);
|
||||
*/
|
||||
|
||||
static void
|
||||
scroll_cb(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data, call_data;
|
||||
scroll_cb(Widget w UNUSED, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
scrollbar_T *sb;
|
||||
long value;
|
||||
@@ -136,10 +134,10 @@ scroll_cb(w, client_data, call_data)
|
||||
|
||||
#ifdef FEAT_GUI_TABLINE
|
||||
static void
|
||||
tabline_cb(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XtPointer call_data;
|
||||
tabline_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XtPointer call_data)
|
||||
{
|
||||
XmNotebookCallbackStruct *nptr;
|
||||
|
||||
@@ -149,10 +147,10 @@ tabline_cb(w, client_data, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
tabline_button_cb(w, client_data, call_data)
|
||||
Widget w;
|
||||
XtPointer client_data UNUSED;
|
||||
XtPointer call_data UNUSED;
|
||||
tabline_button_cb(
|
||||
Widget w,
|
||||
XtPointer client_data UNUSED,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
int cmd, tab_idx;
|
||||
|
||||
@@ -166,9 +164,9 @@ tabline_button_cb(w, client_data, call_data)
|
||||
* Tabline single mouse click timeout handler
|
||||
*/
|
||||
static void
|
||||
motif_tabline_timer_cb (timed_out, interval_id)
|
||||
XtPointer timed_out;
|
||||
XtIntervalId *interval_id UNUSED;
|
||||
motif_tabline_timer_cb (
|
||||
XtPointer timed_out,
|
||||
XtIntervalId *interval_id UNUSED)
|
||||
{
|
||||
*((int *)timed_out) = TRUE;
|
||||
}
|
||||
@@ -177,9 +175,9 @@ motif_tabline_timer_cb (timed_out, interval_id)
|
||||
* check if the tabline tab scroller is clicked
|
||||
*/
|
||||
static int
|
||||
tabline_scroller_clicked(scroller_name, event)
|
||||
char *scroller_name;
|
||||
XButtonPressedEvent *event;
|
||||
tabline_scroller_clicked(
|
||||
char *scroller_name,
|
||||
XButtonPressedEvent *event)
|
||||
{
|
||||
Widget tab_scroll_w;
|
||||
Position pos_x, pos_y;
|
||||
@@ -202,11 +200,11 @@ tabline_scroller_clicked(scroller_name, event)
|
||||
}
|
||||
|
||||
static void
|
||||
tabline_menu_cb(w, closure, e, continue_dispatch)
|
||||
Widget w;
|
||||
XtPointer closure UNUSED;
|
||||
XEvent *e;
|
||||
Boolean *continue_dispatch UNUSED;
|
||||
tabline_menu_cb(
|
||||
Widget w,
|
||||
XtPointer closure UNUSED,
|
||||
XEvent *e,
|
||||
Boolean *continue_dispatch UNUSED)
|
||||
{
|
||||
Widget tab_w;
|
||||
XButtonPressedEvent *event;
|
||||
@@ -275,9 +273,7 @@ tabline_menu_cb(w, closure, e, continue_dispatch)
|
||||
}
|
||||
|
||||
static void
|
||||
tabline_balloon_cb(beval, state)
|
||||
BalloonEval *beval;
|
||||
int state UNUSED;
|
||||
tabline_balloon_cb(BalloonEval *beval, int state UNUSED)
|
||||
{
|
||||
int nr;
|
||||
tabpage_T *tp;
|
||||
@@ -313,10 +309,7 @@ static XtExposeProc old_label_expose = NULL;
|
||||
static void label_expose(Widget _w, XEvent *_event, Region _region);
|
||||
|
||||
static void
|
||||
label_expose(_w, _event, _region)
|
||||
Widget _w;
|
||||
XEvent *_event;
|
||||
Region _region;
|
||||
label_expose(Widget _w, XEvent *_event, Region _region)
|
||||
{
|
||||
GC insensitiveGC;
|
||||
XmLabelWidget lw = (XmLabelWidget)_w;
|
||||
@@ -396,7 +389,7 @@ label_expose(_w, _event, _region)
|
||||
* Create all the motif widgets necessary.
|
||||
*/
|
||||
void
|
||||
gui_x11_create_widgets()
|
||||
gui_x11_create_widgets(void)
|
||||
{
|
||||
#ifdef FEAT_GUI_TABLINE
|
||||
Widget button, scroller;
|
||||
@@ -633,7 +626,7 @@ gui_x11_create_widgets()
|
||||
* Called when the GUI is not going to start after all.
|
||||
*/
|
||||
void
|
||||
gui_x11_destroy_widgets()
|
||||
gui_x11_destroy_widgets(void)
|
||||
{
|
||||
textArea = NULL;
|
||||
#ifdef FEAT_MENU
|
||||
@@ -642,11 +635,11 @@ gui_x11_destroy_widgets()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_text_area_pos(x, y, w, h)
|
||||
int x UNUSED;
|
||||
int y UNUSED;
|
||||
int w UNUSED;
|
||||
int h UNUSED;
|
||||
gui_mch_set_text_area_pos(
|
||||
int x UNUSED,
|
||||
int y UNUSED,
|
||||
int w UNUSED,
|
||||
int h UNUSED)
|
||||
{
|
||||
#ifdef FEAT_TOOLBAR
|
||||
/* Give keyboard focus to the textArea instead of the toolbar. */
|
||||
@@ -655,7 +648,7 @@ gui_mch_set_text_area_pos(x, y, w, h)
|
||||
}
|
||||
|
||||
void
|
||||
gui_x11_set_back_color()
|
||||
gui_x11_set_back_color(void)
|
||||
{
|
||||
if (textArea != NULL)
|
||||
#if (XmVersion >= 1002)
|
||||
@@ -672,8 +665,7 @@ gui_x11_set_back_color()
|
||||
* well.
|
||||
*/
|
||||
void
|
||||
manage_centered(dialog_child)
|
||||
Widget dialog_child;
|
||||
manage_centered(Widget dialog_child)
|
||||
{
|
||||
Widget shell = XtParent(dialog_child);
|
||||
Window root, child;
|
||||
@@ -731,8 +723,7 @@ manage_centered(dialog_child)
|
||||
* Encapsulate the way an XmFontList is created.
|
||||
*/
|
||||
XmFontList
|
||||
gui_motif_create_fontlist(font)
|
||||
XFontStruct *font;
|
||||
gui_motif_create_fontlist(XFontStruct *font)
|
||||
{
|
||||
XmFontList font_list;
|
||||
|
||||
@@ -753,8 +744,7 @@ gui_motif_create_fontlist(font)
|
||||
|
||||
# if ((XmVersion > 1001) && defined(FEAT_XFONTSET)) || defined(PROTO)
|
||||
XmFontList
|
||||
gui_motif_fontset2fontlist(fontset)
|
||||
XFontSet *fontset;
|
||||
gui_motif_fontset2fontlist(XFontSet *fontset)
|
||||
{
|
||||
XmFontList font_list;
|
||||
|
||||
@@ -788,8 +778,7 @@ static void do_set_mnemonics(int enable);
|
||||
static int menu_enabled = TRUE;
|
||||
|
||||
void
|
||||
gui_mch_enable_menu(flag)
|
||||
int flag;
|
||||
gui_mch_enable_menu(int flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
@@ -900,8 +889,7 @@ gui_mch_enable_menu(flag)
|
||||
* Enable or disable mnemonics for the toplevel menus.
|
||||
*/
|
||||
void
|
||||
gui_motif_set_mnemonics(enable)
|
||||
int enable;
|
||||
gui_motif_set_mnemonics(int enable)
|
||||
{
|
||||
/*
|
||||
* Don't enable menu mnemonics when the menu bar is disabled, LessTif
|
||||
@@ -913,8 +901,7 @@ gui_motif_set_mnemonics(enable)
|
||||
}
|
||||
|
||||
static void
|
||||
do_set_mnemonics(enable)
|
||||
int enable;
|
||||
do_set_mnemonics(int enable)
|
||||
{
|
||||
vimmenu_T *menu;
|
||||
|
||||
@@ -926,9 +913,7 @@ do_set_mnemonics(enable)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_add_menu(menu, idx)
|
||||
vimmenu_T *menu;
|
||||
int idx;
|
||||
gui_mch_add_menu(vimmenu_T *menu, int idx)
|
||||
{
|
||||
XmString label;
|
||||
Widget shell;
|
||||
@@ -1036,8 +1021,7 @@ gui_mch_add_menu(menu, idx)
|
||||
* Add mnemonic and accelerator text to a menu button.
|
||||
*/
|
||||
static void
|
||||
gui_motif_add_actext(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_motif_add_actext(vimmenu_T *menu)
|
||||
{
|
||||
XmString label;
|
||||
|
||||
@@ -1053,8 +1037,7 @@ gui_motif_add_actext(menu)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_toggle_tearoffs(enable)
|
||||
int enable;
|
||||
gui_mch_toggle_tearoffs(int enable)
|
||||
{
|
||||
#if (XmVersion >= 1002)
|
||||
if (enable)
|
||||
@@ -1072,8 +1055,7 @@ gui_mch_toggle_tearoffs(enable)
|
||||
* tearoff widget.
|
||||
*/
|
||||
static void
|
||||
toggle_tearoff(wid)
|
||||
Widget wid;
|
||||
toggle_tearoff(Widget wid)
|
||||
{
|
||||
Widget w;
|
||||
|
||||
@@ -1084,8 +1066,7 @@ toggle_tearoff(wid)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_mch_recurse_tearoffs(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_recurse_tearoffs(vimmenu_T *menu)
|
||||
{
|
||||
while (menu != NULL)
|
||||
{
|
||||
@@ -1101,7 +1082,7 @@ gui_mch_recurse_tearoffs(menu)
|
||||
#endif
|
||||
|
||||
int
|
||||
gui_mch_text_area_extra_height()
|
||||
gui_mch_text_area_extra_height(void)
|
||||
{
|
||||
Dimension shadowHeight;
|
||||
|
||||
@@ -1115,8 +1096,8 @@ gui_mch_text_area_extra_height()
|
||||
* there are several rows, and/or some characters extend higher or lower.
|
||||
*/
|
||||
void
|
||||
gui_mch_compute_menu_height(id)
|
||||
Widget id; /* can be NULL when deleting menu */
|
||||
gui_mch_compute_menu_height(
|
||||
Widget id) /* can be NULL when deleting menu */
|
||||
{
|
||||
Dimension y, maxy;
|
||||
Dimension margin, shadow;
|
||||
@@ -1200,8 +1181,7 @@ static int add_pixmap_args(vimmenu_T *menu, Arg *args, int n);
|
||||
* Read an Xpm file. Return OK or FAIL.
|
||||
*/
|
||||
static int
|
||||
check_xpm(path)
|
||||
char_u *path;
|
||||
check_xpm(char_u *path)
|
||||
{
|
||||
XpmAttributes attrs;
|
||||
int status;
|
||||
@@ -1229,9 +1209,7 @@ check_xpm(path)
|
||||
* Return a blank pixmap if it fails.
|
||||
*/
|
||||
static char **
|
||||
get_toolbar_pixmap(menu, fname)
|
||||
vimmenu_T *menu;
|
||||
char **fname;
|
||||
get_toolbar_pixmap(vimmenu_T *menu, char **fname)
|
||||
{
|
||||
char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
|
||||
char **xpm = NULL; /* xpm array */
|
||||
@@ -1272,10 +1250,7 @@ get_toolbar_pixmap(menu, fname)
|
||||
* Add arguments for the toolbar pixmap to a menu item.
|
||||
*/
|
||||
static int
|
||||
add_pixmap_args(menu, args, n)
|
||||
vimmenu_T *menu;
|
||||
Arg *args;
|
||||
int n;
|
||||
add_pixmap_args(vimmenu_T *menu, Arg *args, int n)
|
||||
{
|
||||
vim_free(menu->xpm_fname);
|
||||
menu->xpm = get_toolbar_pixmap(menu, &menu->xpm_fname);
|
||||
@@ -1297,9 +1272,7 @@ add_pixmap_args(menu, args, n)
|
||||
#endif /* FEAT_TOOLBAR */
|
||||
|
||||
void
|
||||
gui_mch_add_menu_item(menu, idx)
|
||||
vimmenu_T *menu;
|
||||
int idx;
|
||||
gui_mch_add_menu_item(vimmenu_T *menu, int idx)
|
||||
{
|
||||
XmString label;
|
||||
vimmenu_T *parent = menu->parent;
|
||||
@@ -1457,8 +1430,7 @@ gui_mch_add_menu_item(menu, idx)
|
||||
* there exists a popup menu but it isn't managed.
|
||||
*/
|
||||
void
|
||||
gui_motif_update_mousemodel(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_motif_update_mousemodel(vimmenu_T *menu)
|
||||
{
|
||||
int idx = 0;
|
||||
|
||||
@@ -1500,7 +1472,7 @@ gui_motif_update_mousemodel(menu)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_new_menu_colors()
|
||||
gui_mch_new_menu_colors(void)
|
||||
{
|
||||
if (menuBar == (Widget)0)
|
||||
return;
|
||||
@@ -1514,7 +1486,7 @@ gui_mch_new_menu_colors()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_new_menu_font()
|
||||
gui_mch_new_menu_font(void)
|
||||
{
|
||||
if (menuBar == (Widget)0)
|
||||
return;
|
||||
@@ -1539,7 +1511,7 @@ gui_mch_new_menu_font()
|
||||
|
||||
#if defined(FEAT_BEVAL) || defined(PROTO)
|
||||
void
|
||||
gui_mch_new_tooltip_font()
|
||||
gui_mch_new_tooltip_font(void)
|
||||
{
|
||||
# ifdef FEAT_TOOLBAR
|
||||
vimmenu_T *menu;
|
||||
@@ -1554,7 +1526,7 @@ gui_mch_new_tooltip_font()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_new_tooltip_colors()
|
||||
gui_mch_new_tooltip_colors(void)
|
||||
{
|
||||
# ifdef FEAT_TOOLBAR
|
||||
vimmenu_T *toolbar;
|
||||
@@ -1570,9 +1542,9 @@ gui_mch_new_tooltip_colors()
|
||||
#endif
|
||||
|
||||
static void
|
||||
submenu_change(menu, colors)
|
||||
vimmenu_T *menu;
|
||||
int colors; /* TRUE for colors, FALSE for font */
|
||||
submenu_change(
|
||||
vimmenu_T *menu,
|
||||
int colors) /* TRUE for colors, FALSE for font */
|
||||
{
|
||||
vimmenu_T *mp;
|
||||
|
||||
@@ -1650,8 +1622,7 @@ submenu_change(menu, colors)
|
||||
* Destroy the machine specific menu widget.
|
||||
*/
|
||||
void
|
||||
gui_mch_destroy_menu(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
{
|
||||
/* Please be sure to destroy the parent widget first (i.e. menu->id).
|
||||
* On the other hand, problems have been reported that the submenu must be
|
||||
@@ -1708,8 +1679,7 @@ gui_mch_destroy_menu(menu)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_show_popupmenu(menu)
|
||||
vimmenu_T *menu UNUSED;
|
||||
gui_mch_show_popupmenu(vimmenu_T *menu UNUSED)
|
||||
{
|
||||
#ifdef MOTIF_POPUP
|
||||
XmMenuPosition(menu->submenu_id, gui_x11_get_last_mouse_event());
|
||||
@@ -1723,7 +1693,7 @@ gui_mch_show_popupmenu(menu)
|
||||
* Set the menu and scrollbar colors to their default values.
|
||||
*/
|
||||
void
|
||||
gui_mch_def_colors()
|
||||
gui_mch_def_colors(void)
|
||||
{
|
||||
if (gui.in_use)
|
||||
{
|
||||
@@ -1748,11 +1718,11 @@ gui_mch_def_colors()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_thumb(sb, val, size, max)
|
||||
scrollbar_T *sb;
|
||||
long val;
|
||||
long size;
|
||||
long max;
|
||||
gui_mch_set_scrollbar_thumb(
|
||||
scrollbar_T *sb,
|
||||
long val,
|
||||
long size,
|
||||
long max)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtVaSetValues(sb->id,
|
||||
@@ -1764,12 +1734,12 @@ gui_mch_set_scrollbar_thumb(sb, val, size, max)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_pos(sb, x, y, w, h)
|
||||
scrollbar_T *sb;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
gui_mch_set_scrollbar_pos(
|
||||
scrollbar_T *sb,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
{
|
||||
@@ -1798,9 +1768,7 @@ gui_mch_set_scrollbar_pos(sb, x, y, w, h)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_enable_scrollbar(sb, flag)
|
||||
scrollbar_T *sb;
|
||||
int flag;
|
||||
gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
|
||||
{
|
||||
Arg args[16];
|
||||
int n;
|
||||
@@ -1855,9 +1823,9 @@ gui_mch_enable_scrollbar(sb, flag)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_create_scrollbar(sb, orient)
|
||||
scrollbar_T *sb;
|
||||
int orient; /* SBAR_VERT or SBAR_HORIZ */
|
||||
gui_mch_create_scrollbar(
|
||||
scrollbar_T *sb,
|
||||
int orient) /* SBAR_VERT or SBAR_HORIZ */
|
||||
{
|
||||
Arg args[16];
|
||||
int n;
|
||||
@@ -1913,8 +1881,7 @@ gui_mch_create_scrollbar(sb, orient)
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
gui_mch_destroy_scrollbar(sb)
|
||||
scrollbar_T *sb;
|
||||
gui_mch_destroy_scrollbar(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
XtDestroyWidget(sb->id);
|
||||
@@ -1922,8 +1889,7 @@ gui_mch_destroy_scrollbar(sb)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_set_scrollbar_colors(sb)
|
||||
scrollbar_T *sb;
|
||||
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
|
||||
{
|
||||
if (sb->id != (Widget)0)
|
||||
{
|
||||
@@ -1957,7 +1923,7 @@ gui_mch_set_scrollbar_colors(sb)
|
||||
*/
|
||||
|
||||
Window
|
||||
gui_x11_get_wid()
|
||||
gui_x11_get_wid(void)
|
||||
{
|
||||
return(XtWindow(textArea));
|
||||
}
|
||||
@@ -2130,8 +2096,7 @@ static void set_fontlist(Widget wg);
|
||||
* Use the 'guifont' or 'guifontset' as a fontlist for a dialog widget.
|
||||
*/
|
||||
static void
|
||||
set_fontlist(id)
|
||||
Widget id;
|
||||
set_fontlist(Widget id)
|
||||
{
|
||||
XmFontList fl;
|
||||
|
||||
@@ -2211,11 +2176,8 @@ static void DialogAcceptCB(Widget, XtPointer, XtPointer);
|
||||
*/
|
||||
static void set_predefined_label(Widget parent, String name, char *new_label);
|
||||
|
||||
static void
|
||||
set_predefined_label(parent, name, new_label)
|
||||
Widget parent;
|
||||
String name;
|
||||
char *new_label;
|
||||
static void
|
||||
set_predefined_label(Widget parent, String name, char *new_label)
|
||||
{
|
||||
XmString str;
|
||||
Widget w;
|
||||
@@ -2258,10 +2220,8 @@ set_predefined_label(parent, name, new_label)
|
||||
gui_motif_menu_fontlist(w);
|
||||
}
|
||||
|
||||
static void
|
||||
set_predefined_fontlist(parent, name)
|
||||
Widget parent;
|
||||
String name;
|
||||
static void
|
||||
set_predefined_fontlist(Widget parent, String name)
|
||||
{
|
||||
Widget w;
|
||||
w = XtNameToWidget(parent, name);
|
||||
@@ -2277,13 +2237,13 @@ set_predefined_fontlist(parent, name)
|
||||
* Returns the selected name in allocated memory, or NULL for Cancel.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_browse(saving, title, dflt, ext, initdir, filter)
|
||||
int saving UNUSED; /* select file to write */
|
||||
char_u *title; /* title for the window */
|
||||
char_u *dflt; /* default name */
|
||||
char_u *ext UNUSED; /* not used (extension added) */
|
||||
char_u *initdir; /* initial directory, NULL for current dir */
|
||||
char_u *filter; /* file name filter */
|
||||
gui_mch_browse(
|
||||
int saving UNUSED, /* select file to write */
|
||||
char_u *title, /* title for the window */
|
||||
char_u *dflt, /* default name */
|
||||
char_u *ext UNUSED, /* not used (extension added) */
|
||||
char_u *initdir, /* initial directory, NULL for current dir */
|
||||
char_u *filter) /* file name filter */
|
||||
{
|
||||
char_u dirbuf[MAXPATHL];
|
||||
char_u dfltbuf[MAXPATHL];
|
||||
@@ -2402,10 +2362,10 @@ gui_mch_browse(saving, title, dflt, ext, initdir, filter)
|
||||
* Process callback from Dialog cancel actions.
|
||||
*/
|
||||
static void
|
||||
DialogCancelCB(w, client_data, call_data)
|
||||
Widget w UNUSED; /* widget id */
|
||||
XtPointer client_data UNUSED; /* data from application */
|
||||
XtPointer call_data UNUSED; /* data from widget class */
|
||||
DialogCancelCB(
|
||||
Widget w UNUSED, /* widget id */
|
||||
XtPointer client_data UNUSED, /* data from application */
|
||||
XtPointer call_data UNUSED) /* data from widget class */
|
||||
{
|
||||
if (browse_fname != NULL)
|
||||
{
|
||||
@@ -2419,10 +2379,10 @@ DialogCancelCB(w, client_data, call_data)
|
||||
* Process callback from Dialog actions.
|
||||
*/
|
||||
static void
|
||||
DialogAcceptCB(w, client_data, call_data)
|
||||
Widget w UNUSED; /* widget id */
|
||||
XtPointer client_data UNUSED; /* data from application */
|
||||
XtPointer call_data; /* data from widget class */
|
||||
DialogAcceptCB(
|
||||
Widget w UNUSED, /* widget id */
|
||||
XtPointer client_data UNUSED, /* data from application */
|
||||
XtPointer call_data) /* data from widget class */
|
||||
{
|
||||
XmFileSelectionBoxCallbackStruct *fcb;
|
||||
|
||||
@@ -2454,11 +2414,11 @@ static void butproc(Widget w, XtPointer client_data, XtPointer call_data);
|
||||
* hitting the "OK" button, ESC like "Cancel".
|
||||
*/
|
||||
static void
|
||||
keyhit_callback(w, client_data, event, cont)
|
||||
Widget w;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *cont UNUSED;
|
||||
keyhit_callback(
|
||||
Widget w,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
char buf[2];
|
||||
KeySym key_sym;
|
||||
@@ -2476,10 +2436,10 @@ keyhit_callback(w, client_data, event, cont)
|
||||
}
|
||||
|
||||
static void
|
||||
butproc(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
butproc(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
dialogStatus = (int)(long)client_data + 1;
|
||||
}
|
||||
@@ -2489,12 +2449,12 @@ butproc(w, client_data, call_data)
|
||||
static Widget create_pixmap_label(Widget parent, String name, char **data, ArgList args, Cardinal arg);
|
||||
|
||||
static Widget
|
||||
create_pixmap_label(parent, name, data, args, arg)
|
||||
Widget parent;
|
||||
String name;
|
||||
char **data;
|
||||
ArgList args;
|
||||
Cardinal arg;
|
||||
create_pixmap_label(
|
||||
Widget parent,
|
||||
String name,
|
||||
char **data,
|
||||
ArgList args,
|
||||
Cardinal arg)
|
||||
{
|
||||
Widget label;
|
||||
Display *dsp;
|
||||
@@ -2552,14 +2512,14 @@ create_pixmap_label(parent, name, data, args, arg)
|
||||
#endif
|
||||
|
||||
int
|
||||
gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd)
|
||||
int type UNUSED;
|
||||
char_u *title;
|
||||
char_u *message;
|
||||
char_u *button_names;
|
||||
int dfltbutton;
|
||||
char_u *textfield; /* buffer of size IOSIZE */
|
||||
int ex_cmd UNUSED;
|
||||
gui_mch_dialog(
|
||||
int type UNUSED,
|
||||
char_u *title,
|
||||
char_u *message,
|
||||
char_u *button_names,
|
||||
int dfltbutton,
|
||||
char_u *textfield, /* buffer of size IOSIZE */
|
||||
int ex_cmd UNUSED)
|
||||
{
|
||||
char_u *buts;
|
||||
char_u *p, *next;
|
||||
@@ -2927,7 +2887,7 @@ gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield, ex_cmd
|
||||
#if defined(FEAT_FOOTER) || defined(PROTO)
|
||||
|
||||
static int
|
||||
gui_mch_compute_footer_height()
|
||||
gui_mch_compute_footer_height(void)
|
||||
{
|
||||
Dimension height; /* total Toolbar height */
|
||||
Dimension top; /* XmNmarginTop */
|
||||
@@ -2945,8 +2905,7 @@ gui_mch_compute_footer_height()
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_enable_footer(showit)
|
||||
int showit;
|
||||
gui_mch_enable_footer(int showit)
|
||||
{
|
||||
if (showit)
|
||||
{
|
||||
@@ -2962,8 +2921,7 @@ gui_mch_enable_footer(showit)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_footer(s)
|
||||
char_u *s;
|
||||
gui_mch_set_footer(char_u *s)
|
||||
{
|
||||
XmString xms;
|
||||
|
||||
@@ -3135,14 +3093,14 @@ gui_mch_show_toolbar(int showit)
|
||||
* input go to the editor window, not the button
|
||||
*/
|
||||
static void
|
||||
reset_focus()
|
||||
reset_focus(void)
|
||||
{
|
||||
if (textArea != NULL)
|
||||
XmProcessTraversal(textArea, XmTRAVERSE_CURRENT);
|
||||
}
|
||||
|
||||
int
|
||||
gui_mch_compute_toolbar_height()
|
||||
gui_mch_compute_toolbar_height(void)
|
||||
{
|
||||
Dimension borders;
|
||||
Dimension height; /* total Toolbar height */
|
||||
@@ -3189,12 +3147,12 @@ gui_mch_compute_toolbar_height()
|
||||
}
|
||||
|
||||
void
|
||||
motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
|
||||
Pixel *bgp;
|
||||
Pixel *fgp;
|
||||
Pixel *bsp;
|
||||
Pixel *tsp;
|
||||
Pixel *hsp;
|
||||
motif_get_toolbar_colors(
|
||||
Pixel *bgp,
|
||||
Pixel *fgp,
|
||||
Pixel *bsp,
|
||||
Pixel *tsp,
|
||||
Pixel *hsp)
|
||||
{
|
||||
XtVaGetValues(toolBar,
|
||||
XmNbackground, bgp,
|
||||
@@ -3212,11 +3170,11 @@ motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
|
||||
* get implemented and the user will have a choice.
|
||||
*/
|
||||
static void
|
||||
toolbarbutton_enter_cb(w, client_data, event, cont)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *cont UNUSED;
|
||||
toolbarbutton_enter_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
vimmenu_T *menu = (vimmenu_T *) client_data;
|
||||
|
||||
@@ -3228,11 +3186,11 @@ toolbarbutton_enter_cb(w, client_data, event, cont)
|
||||
}
|
||||
|
||||
static void
|
||||
toolbarbutton_leave_cb(w, client_data, event, cont)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *cont UNUSED;
|
||||
toolbarbutton_leave_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *cont UNUSED)
|
||||
{
|
||||
gui_mch_set_footer((char_u *) "");
|
||||
}
|
||||
@@ -3413,8 +3371,7 @@ gui_mch_update_tabline(void)
|
||||
* Set the current tab to "nr". First tab is 1.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_curtab(nr)
|
||||
int nr;
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
int currentpage;
|
||||
|
||||
@@ -3431,8 +3388,7 @@ gui_mch_set_curtab(nr)
|
||||
* Set the colors of Widget "id" to the menu colors.
|
||||
*/
|
||||
static void
|
||||
gui_motif_menu_colors(id)
|
||||
Widget id;
|
||||
gui_motif_menu_colors(Widget id)
|
||||
{
|
||||
if (gui.menu_bg_pixel != INVALCOLOR)
|
||||
#if (XmVersion >= 1002)
|
||||
@@ -3448,8 +3404,7 @@ gui_motif_menu_colors(id)
|
||||
* Set the colors of Widget "id" to the scrollbar colors.
|
||||
*/
|
||||
static void
|
||||
gui_motif_scroll_colors(id)
|
||||
Widget id;
|
||||
gui_motif_scroll_colors(Widget id)
|
||||
{
|
||||
if (gui.scroll_bg_pixel != INVALCOLOR)
|
||||
#if (XmVersion >= 1002)
|
||||
@@ -3465,8 +3420,7 @@ gui_motif_scroll_colors(id)
|
||||
* Set the fontlist for Widget "id" to use gui.menu_fontset or gui.menu_font.
|
||||
*/
|
||||
void
|
||||
gui_motif_menu_fontlist(id)
|
||||
Widget id UNUSED;
|
||||
gui_motif_menu_fontlist(Widget id UNUSED)
|
||||
{
|
||||
#ifdef FEAT_MENU
|
||||
#ifdef FONTSET_ALWAYS
|
||||
@@ -3548,10 +3502,10 @@ static void find_replace_keypress(Widget w, SharedFindReplace * frdp, XKeyEvent
|
||||
static void find_replace_dialog_create(char_u *entry_text, int do_replace);
|
||||
|
||||
static void
|
||||
find_replace_destroy_callback(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
find_replace_destroy_callback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
SharedFindReplace *cd = (SharedFindReplace *)client_data;
|
||||
|
||||
@@ -3561,10 +3515,10 @@ find_replace_destroy_callback(w, client_data, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
find_replace_dismiss_callback(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
find_replace_dismiss_callback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
SharedFindReplace *cd = (SharedFindReplace *)client_data;
|
||||
|
||||
@@ -3573,19 +3527,19 @@ find_replace_dismiss_callback(w, client_data, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
entry_activate_callback(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
entry_activate_callback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
XmProcessTraversal((Widget)client_data, XmTRAVERSE_CURRENT);
|
||||
}
|
||||
|
||||
static void
|
||||
find_replace_callback(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
find_replace_callback(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
long_u flags = (long_u)client_data;
|
||||
char *find_text, *repl_text;
|
||||
@@ -3636,10 +3590,10 @@ find_replace_callback(w, client_data, call_data)
|
||||
}
|
||||
|
||||
static void
|
||||
find_replace_keypress(w, frdp, event)
|
||||
Widget w UNUSED;
|
||||
SharedFindReplace *frdp;
|
||||
XKeyEvent *event;
|
||||
find_replace_keypress(
|
||||
Widget w UNUSED,
|
||||
SharedFindReplace *frdp,
|
||||
XKeyEvent *event)
|
||||
{
|
||||
KeySym keysym;
|
||||
|
||||
@@ -3654,9 +3608,7 @@ find_replace_keypress(w, frdp, event)
|
||||
}
|
||||
|
||||
static void
|
||||
set_label(w, label)
|
||||
Widget w;
|
||||
char *label;
|
||||
set_label(Widget w, char *label)
|
||||
{
|
||||
XmString str;
|
||||
char_u *p, *next;
|
||||
@@ -3696,9 +3648,7 @@ set_label(w, label)
|
||||
}
|
||||
|
||||
static void
|
||||
find_replace_dialog_create(arg, do_replace)
|
||||
char_u *arg;
|
||||
int do_replace;
|
||||
find_replace_dialog_create(char_u *arg, int do_replace)
|
||||
{
|
||||
SharedFindReplace *frdp;
|
||||
Widget separator;
|
||||
@@ -4050,8 +4000,7 @@ find_replace_dialog_create(arg, do_replace)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_find_dialog(eap)
|
||||
exarg_T *eap;
|
||||
gui_mch_find_dialog(exarg_T *eap)
|
||||
{
|
||||
if (!gui.in_use)
|
||||
return;
|
||||
@@ -4061,8 +4010,7 @@ gui_mch_find_dialog(eap)
|
||||
|
||||
|
||||
void
|
||||
gui_mch_replace_dialog(eap)
|
||||
exarg_T *eap;
|
||||
gui_mch_replace_dialog(exarg_T *eap)
|
||||
{
|
||||
if (!gui.in_use)
|
||||
return;
|
||||
@@ -4074,7 +4022,7 @@ gui_mch_replace_dialog(eap)
|
||||
* Synchronize all gui elements, which are dependant upon the
|
||||
* main text font used. Those are in esp. the find/replace dialogs.
|
||||
* If you don't understand why this should be needed, please try to
|
||||
* search for "piê¶æ" in iso8859-2.
|
||||
* search for "pi\xea\xb6\xe6" in iso8859-2.
|
||||
*/
|
||||
void
|
||||
gui_motif_synch_fonts(void)
|
||||
|
||||
+5
-10
@@ -1111,9 +1111,7 @@ gui_ph_encoding_changed(int new_encoding)
|
||||
/****************************************************************************/
|
||||
|
||||
void
|
||||
gui_mch_prepare(argc, argv)
|
||||
int *argc;
|
||||
char **argv;
|
||||
gui_mch_prepare(int *argc, char **argv)
|
||||
{
|
||||
PtInit(NULL);
|
||||
}
|
||||
@@ -1720,7 +1718,7 @@ gui_mch_iconify(void)
|
||||
* Bring the Vim window to the foreground.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_foreground()
|
||||
gui_mch_set_foreground(void)
|
||||
{
|
||||
PhWindowEvent_t event;
|
||||
|
||||
@@ -1860,8 +1858,7 @@ static int mshape_ids[] =
|
||||
};
|
||||
|
||||
void
|
||||
mch_set_mouse_shape(shape)
|
||||
int shape;
|
||||
mch_set_mouse_shape(int shape)
|
||||
{
|
||||
int id;
|
||||
|
||||
@@ -2184,7 +2181,7 @@ gui_mch_clear_block(int row1, int col1, int row2, int col2)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_clear_all()
|
||||
gui_mch_clear_all(void)
|
||||
{
|
||||
PhRect_t text_rect = {
|
||||
{ gui.border_width, gui.border_width },
|
||||
@@ -3078,9 +3075,7 @@ gui_mch_get_font(char_u *vim_font_name, int report_error)
|
||||
* Don't know how to get the actual name, thus use the provided name.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
|
||||
+56
-68
@@ -57,7 +57,6 @@ directx_enabled(void)
|
||||
gui_mch_set_rendering_options(char_u *s)
|
||||
{
|
||||
#ifdef FEAT_DIRECTX
|
||||
int retval = FAIL;
|
||||
char_u *p, *q;
|
||||
|
||||
int dx_enable = 0;
|
||||
@@ -95,36 +94,36 @@ gui_mch_set_rendering_options(char_u *s)
|
||||
else if (STRCMP(name, "gamma") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 0;
|
||||
dx_gamma = (float)atof(value);
|
||||
dx_gamma = (float)atof((char *)value);
|
||||
}
|
||||
else if (STRCMP(name, "contrast") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 1;
|
||||
dx_contrast = (float)atof(value);
|
||||
dx_contrast = (float)atof((char *)value);
|
||||
}
|
||||
else if (STRCMP(name, "level") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 2;
|
||||
dx_level = (float)atof(value);
|
||||
dx_level = (float)atof((char *)value);
|
||||
}
|
||||
else if (STRCMP(name, "geom") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 3;
|
||||
dx_geom = atoi(value);
|
||||
dx_geom = atoi((char *)value);
|
||||
if (dx_geom < 0 || dx_geom > 2)
|
||||
return FAIL;
|
||||
}
|
||||
else if (STRCMP(name, "renmode") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 4;
|
||||
dx_renmode = atoi(value);
|
||||
dx_renmode = atoi((char *)value);
|
||||
if (dx_renmode < 0 || dx_renmode > 6)
|
||||
return FAIL;
|
||||
}
|
||||
else if (STRCMP(name, "taamode") == 0)
|
||||
{
|
||||
dx_flags |= 1 << 5;
|
||||
dx_taamode = atoi(value);
|
||||
dx_taamode = atoi((char *)value);
|
||||
if (dx_taamode < 0 || dx_taamode > 3)
|
||||
return FAIL;
|
||||
}
|
||||
@@ -1131,7 +1130,7 @@ _WndProc(
|
||||
|
||||
if (STRLEN(str) < sizeof(lpdi->szText)
|
||||
|| ((tt_text = vim_strsave(str)) == NULL))
|
||||
vim_strncpy(lpdi->szText, str,
|
||||
vim_strncpy((char_u *)lpdi->szText, str,
|
||||
sizeof(lpdi->szText) - 1);
|
||||
else
|
||||
lpdi->lpszText = tt_text;
|
||||
@@ -1670,6 +1669,7 @@ gui_mch_init(void)
|
||||
if (s_textArea == NULL)
|
||||
return FAIL;
|
||||
|
||||
#ifdef FEAT_LIBCALL
|
||||
/* Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico. */
|
||||
{
|
||||
HANDLE hIcon = NULL;
|
||||
@@ -1677,6 +1677,7 @@ gui_mch_init(void)
|
||||
if (mch_icon_load(&hIcon) == OK && hIcon != NULL)
|
||||
SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
s_menuBar = CreateMenu();
|
||||
@@ -1747,9 +1748,9 @@ gui_mch_init(void)
|
||||
|
||||
/* Initialise the struct */
|
||||
s_findrep_struct.lStructSize = sizeof(s_findrep_struct);
|
||||
s_findrep_struct.lpstrFindWhat = alloc(MSWIN_FR_BUFSIZE);
|
||||
s_findrep_struct.lpstrFindWhat = (LPSTR)alloc(MSWIN_FR_BUFSIZE);
|
||||
s_findrep_struct.lpstrFindWhat[0] = NUL;
|
||||
s_findrep_struct.lpstrReplaceWith = alloc(MSWIN_FR_BUFSIZE);
|
||||
s_findrep_struct.lpstrReplaceWith = (LPSTR)alloc(MSWIN_FR_BUFSIZE);
|
||||
s_findrep_struct.lpstrReplaceWith[0] = NUL;
|
||||
s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
|
||||
s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
|
||||
@@ -1770,7 +1771,7 @@ gui_mch_init(void)
|
||||
# if !defined(_MSC_VER) || (_MSC_VER < 1400)
|
||||
/* Define HandleToLong for old MS and non-MS compilers if not defined. */
|
||||
# ifndef HandleToLong
|
||||
# define HandleToLong(h) ((long)(h))
|
||||
# define HandleToLong(h) ((long)(intptr_t)(h))
|
||||
# endif
|
||||
# endif
|
||||
/* set the v:windowid variable */
|
||||
@@ -2099,7 +2100,7 @@ GetCompositionString_inUCS2(HIMC hIMC, DWORD GCS, int *lenp)
|
||||
pImmGetCompositionStringA(hIMC, GCS, buf, ret);
|
||||
|
||||
/* convert from codepage to UCS-2 */
|
||||
MultiByteToWideChar_alloc(GetACP(), 0, buf, ret, &wbuf, lenp);
|
||||
MultiByteToWideChar_alloc(GetACP(), 0, (LPCSTR)buf, ret, &wbuf, lenp);
|
||||
vim_free(buf);
|
||||
|
||||
return (short_u *)wbuf;
|
||||
@@ -2246,7 +2247,7 @@ im_set_active(int active)
|
||||
* Get IM status. When IM is on, return not 0. Else return 0.
|
||||
*/
|
||||
int
|
||||
im_get_status()
|
||||
im_get_status(void)
|
||||
{
|
||||
int status = 0;
|
||||
HIMC hImc;
|
||||
@@ -2292,7 +2293,7 @@ im_set_active(int active)
|
||||
* Get IM status. When IM is on, return not 0. Else return 0.
|
||||
*/
|
||||
int
|
||||
im_get_status()
|
||||
im_get_status(void)
|
||||
{
|
||||
return global_ime_get_status();
|
||||
}
|
||||
@@ -3028,7 +3029,7 @@ rebuild_tearoff(vimmenu_T *menu)
|
||||
|
||||
HWND thwnd = menu->tearoff_handle;
|
||||
|
||||
GetWindowText(thwnd, tbuf, 127);
|
||||
GetWindowText(thwnd, (LPSTR)tbuf, 127);
|
||||
if (GetWindowRect(thwnd, &trect)
|
||||
&& GetWindowRect(s_hwnd, &rct)
|
||||
&& GetClientRect(s_hwnd, &roct))
|
||||
@@ -3174,7 +3175,7 @@ dialog_callback(
|
||||
else
|
||||
# endif
|
||||
GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2,
|
||||
s_textfield, IOSIZE);
|
||||
(LPSTR)s_textfield, IOSIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3216,7 +3217,7 @@ dialog_callback(
|
||||
* If stubbing out this fn, return 1.
|
||||
*/
|
||||
|
||||
static const char_u *dlg_icons[] = /* must match names in resource file */
|
||||
static const char *dlg_icons[] = /* must match names in resource file */
|
||||
{
|
||||
"IDR_VIM",
|
||||
"IDR_VIM_ERROR",
|
||||
@@ -3353,7 +3354,7 @@ gui_mch_dialog(
|
||||
fontHeight = fontInfo.tmHeight;
|
||||
|
||||
/* Minimum width for horizontal button */
|
||||
minButtonWidth = GetTextWidth(hdc, "Cancel", 6);
|
||||
minButtonWidth = GetTextWidth(hdc, (char_u *)"Cancel", 6);
|
||||
|
||||
/* Maximum width of a dialog, if possible */
|
||||
if (s_hwnd == NULL)
|
||||
@@ -3617,7 +3618,7 @@ gui_mch_dialog(
|
||||
+ 2 * fontHeight * i),
|
||||
PixelToDialogX(dlgwidth - 2 * DLG_VERT_PADDING_X),
|
||||
(WORD)(PixelToDialogY(2 * fontHeight) - 1),
|
||||
(WORD)(IDCANCEL + 1 + i), (WORD)0x0080, pstart);
|
||||
(WORD)(IDCANCEL + 1 + i), (WORD)0x0080, (char *)pstart);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3628,7 +3629,7 @@ gui_mch_dialog(
|
||||
PixelToDialogY(buttonYpos), /* TBK */
|
||||
PixelToDialogX(buttonWidths[i]),
|
||||
(WORD)(PixelToDialogY(2 * fontHeight) - 1),
|
||||
(WORD)(IDCANCEL + 1 + i), (WORD)0x0080, pstart);
|
||||
(WORD)(IDCANCEL + 1 + i), (WORD)0x0080, (char *)pstart);
|
||||
}
|
||||
pstart = pend + 1; /*next button*/
|
||||
}
|
||||
@@ -3649,7 +3650,7 @@ gui_mch_dialog(
|
||||
PixelToDialogY(dlgPaddingY),
|
||||
(WORD)(PixelToDialogX(messageWidth) + 1),
|
||||
PixelToDialogY(msgheight),
|
||||
DLG_NONBUTTON_CONTROL + 1, (WORD)0x0081, message);
|
||||
DLG_NONBUTTON_CONTROL + 1, (WORD)0x0081, (char *)message);
|
||||
|
||||
/* Edit box */
|
||||
if (textfield != NULL)
|
||||
@@ -3659,7 +3660,7 @@ gui_mch_dialog(
|
||||
PixelToDialogY(2 * dlgPaddingY + msgheight),
|
||||
PixelToDialogX(dlgwidth - 4 * dlgPaddingX),
|
||||
PixelToDialogY(fontHeight + dlgPaddingY),
|
||||
DLG_NONBUTTON_CONTROL + 2, (WORD)0x0081, textfield);
|
||||
DLG_NONBUTTON_CONTROL + 2, (WORD)0x0081, (char *)textfield);
|
||||
*pnumitems += 1;
|
||||
}
|
||||
|
||||
@@ -3798,7 +3799,7 @@ nCopyAnsiToWideChar(
|
||||
if (enc_codepage == 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
/* Not a codepage, use our own conversion function. */
|
||||
wn = enc_to_utf16(lpAnsiIn, NULL);
|
||||
wn = enc_to_utf16((char_u *)lpAnsiIn, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
wcscpy(lpWCStr, wn);
|
||||
@@ -4043,7 +4044,7 @@ gui_mch_tearoff(
|
||||
|
||||
/* Calculate width of a single space. Used for padding columns to the
|
||||
* right width. */
|
||||
spaceWidth = GetTextWidth(hdc, " ", 1);
|
||||
spaceWidth = GetTextWidth(hdc, (char_u *)" ", 1);
|
||||
|
||||
/* Figure out max width of the text column, the accelerator column and the
|
||||
* optional submenu column. */
|
||||
@@ -4086,7 +4087,7 @@ gui_mch_tearoff(
|
||||
textWidth = columnWidths[0] + columnWidths[1];
|
||||
if (submenuWidth != 0)
|
||||
{
|
||||
submenuWidth = GetTextWidth(hdc, TEAROFF_SUBMENU_LABEL,
|
||||
submenuWidth = GetTextWidth(hdc, (char_u *)TEAROFF_SUBMENU_LABEL,
|
||||
(int)STRLEN(TEAROFF_SUBMENU_LABEL));
|
||||
textWidth += submenuWidth;
|
||||
}
|
||||
@@ -4262,7 +4263,7 @@ gui_mch_tearoff(
|
||||
(WORD)(sepPadding + 1 + 13 * (*pnumitems)),
|
||||
(WORD)PixelToDialogX(dlgwidth - 2 * TEAROFF_PADDING_X),
|
||||
(WORD)12,
|
||||
menuID, (WORD)0x0080, label);
|
||||
menuID, (WORD)0x0080, (char *)label);
|
||||
vim_free(label);
|
||||
(*pnumitems)++;
|
||||
}
|
||||
@@ -4360,7 +4361,7 @@ get_toolbar_bitmap(vimmenu_T *menu)
|
||||
gui_find_iconfile(menu->iconfile, fname, "bmp");
|
||||
hbitmap = LoadImage(
|
||||
NULL,
|
||||
fname,
|
||||
(LPCSTR)fname,
|
||||
IMAGE_BITMAP,
|
||||
TOOLBAR_BUTTON_WIDTH,
|
||||
TOOLBAR_BUTTON_HEIGHT,
|
||||
@@ -4381,7 +4382,7 @@ get_toolbar_bitmap(vimmenu_T *menu)
|
||||
menu->dname, fname, "bmp") == OK))
|
||||
hbitmap = LoadImage(
|
||||
NULL,
|
||||
fname,
|
||||
(LPCSTR)fname,
|
||||
IMAGE_BITMAP,
|
||||
TOOLBAR_BUTTON_WIDTH,
|
||||
TOOLBAR_BUTTON_HEIGHT,
|
||||
@@ -4525,10 +4526,7 @@ typedef struct _signicon_t
|
||||
} signicon_t;
|
||||
|
||||
void
|
||||
gui_mch_drawsign(row, col, typenr)
|
||||
int row;
|
||||
int col;
|
||||
int typenr;
|
||||
gui_mch_drawsign(int row, int col, int typenr)
|
||||
{
|
||||
signicon_t *sign;
|
||||
int x, y, w, h;
|
||||
@@ -4605,8 +4603,7 @@ close_signicon_image(signicon_t *sign)
|
||||
}
|
||||
|
||||
void *
|
||||
gui_mch_register_sign(signfile)
|
||||
char_u *signfile;
|
||||
gui_mch_register_sign(char_u *signfile)
|
||||
{
|
||||
signicon_t sign, *psign;
|
||||
char_u *ext;
|
||||
@@ -4633,14 +4630,15 @@ gui_mch_register_sign(signfile)
|
||||
do_load = 0;
|
||||
|
||||
if (do_load)
|
||||
sign.hImage = (HANDLE)LoadImage(NULL, signfile, sign.uType,
|
||||
sign.hImage = (HANDLE)LoadImage(NULL, (LPCSTR)signfile, sign.uType,
|
||||
gui.char_width * 2, gui.char_height,
|
||||
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
|
||||
#ifdef FEAT_XPM_W32
|
||||
if (!STRICMP(ext, ".xpm"))
|
||||
{
|
||||
sign.uType = IMAGE_XPM;
|
||||
LoadXpmImage(signfile, (HBITMAP *)&sign.hImage, (HBITMAP *)&sign.hShape);
|
||||
LoadXpmImage((char *)signfile, (HBITMAP *)&sign.hImage,
|
||||
(HBITMAP *)&sign.hShape);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4661,8 +4659,7 @@ gui_mch_register_sign(signfile)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_sign(sign)
|
||||
void *sign;
|
||||
gui_mch_destroy_sign(void *sign)
|
||||
{
|
||||
if (sign)
|
||||
{
|
||||
@@ -4745,13 +4742,13 @@ multiline_balloon_available(void)
|
||||
UINT vlen = 0;
|
||||
void *data = alloc(len);
|
||||
|
||||
if (data != NULL
|
||||
if ((data != NULL
|
||||
&& GetFileVersionInfo(comctl_dll, 0, len, data)
|
||||
&& VerQueryValue(data, "\\", (void **)&ver, &vlen)
|
||||
&& vlen
|
||||
&& HIWORD(ver->dwFileVersionMS) > 4
|
||||
|| (HIWORD(ver->dwFileVersionMS) == 4
|
||||
&& LOWORD(ver->dwFileVersionMS) >= 70))
|
||||
&& HIWORD(ver->dwFileVersionMS) > 4)
|
||||
|| ((HIWORD(ver->dwFileVersionMS) == 4
|
||||
&& LOWORD(ver->dwFileVersionMS) >= 70)))
|
||||
{
|
||||
vim_free(data);
|
||||
multiline_tip = TRUE;
|
||||
@@ -4766,10 +4763,7 @@ multiline_balloon_available(void)
|
||||
}
|
||||
|
||||
static void
|
||||
make_tooltip(beval, text, pt)
|
||||
BalloonEval *beval;
|
||||
char *text;
|
||||
POINT pt;
|
||||
make_tooltip(BalloonEval *beval, char *text, POINT pt)
|
||||
{
|
||||
TOOLINFO *pti;
|
||||
int ToolInfoSize;
|
||||
@@ -4833,19 +4827,18 @@ make_tooltip(beval, text, pt)
|
||||
}
|
||||
|
||||
static void
|
||||
delete_tooltip(beval)
|
||||
BalloonEval *beval;
|
||||
delete_tooltip(BalloonEval *beval)
|
||||
{
|
||||
PostMessage(beval->balloon, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static VOID CALLBACK
|
||||
BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
|
||||
HWND hwnd;
|
||||
UINT uMsg;
|
||||
UINT_PTR idEvent;
|
||||
DWORD dwTime;
|
||||
BevalTimerProc(
|
||||
HWND hwnd,
|
||||
UINT uMsg,
|
||||
UINT_PTR idEvent,
|
||||
DWORD dwTime)
|
||||
{
|
||||
POINT pt;
|
||||
RECT rect;
|
||||
@@ -4883,8 +4876,7 @@ BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_disable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_disable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
// TRACE0("gui_mch_disable_beval_area {{{");
|
||||
KillTimer(s_textArea, BevalTimerId);
|
||||
@@ -4893,8 +4885,7 @@ gui_mch_disable_beval_area(beval)
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_enable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_enable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
// TRACE0("gui_mch_enable_beval_area |||");
|
||||
if (beval == NULL)
|
||||
@@ -4905,9 +4896,7 @@ gui_mch_enable_beval_area(beval)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_post_balloon(beval, mesg)
|
||||
BalloonEval *beval;
|
||||
char_u *mesg;
|
||||
gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
|
||||
{
|
||||
POINT pt;
|
||||
// TRACE0("gui_mch_post_balloon {{{");
|
||||
@@ -4921,18 +4910,18 @@ gui_mch_post_balloon(beval, mesg)
|
||||
{
|
||||
gui_mch_disable_beval_area(cur_beval);
|
||||
beval->showState = ShS_SHOWING;
|
||||
make_tooltip(beval, mesg, pt);
|
||||
make_tooltip(beval, (char *)mesg, pt);
|
||||
}
|
||||
// TRACE0("gui_mch_post_balloon }}}");
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
BalloonEval *
|
||||
gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
|
||||
void *target; /* ignored, always use s_textArea */
|
||||
char_u *mesg;
|
||||
void (*mesgCB)(BalloonEval *, int);
|
||||
void *clientData;
|
||||
gui_mch_create_beval_area(
|
||||
void *target, /* ignored, always use s_textArea */
|
||||
char_u *mesg,
|
||||
void (*mesgCB)(BalloonEval *, int),
|
||||
void *clientData)
|
||||
{
|
||||
/* partially stolen from gui_beval.c */
|
||||
BalloonEval *beval;
|
||||
@@ -5010,8 +4999,7 @@ TrackUserActivity(UINT uMsg)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_destroy_beval_area(BalloonEval *beval)
|
||||
{
|
||||
vim_free(beval);
|
||||
}
|
||||
|
||||
+51
-41
@@ -534,7 +534,8 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
|
||||
else
|
||||
{
|
||||
string[0] = ch;
|
||||
len = MultiByteToWideChar(GetACP(), 0, string, 1, wstring, 2);
|
||||
len = MultiByteToWideChar(GetACP(), 0, (LPCSTR)string,
|
||||
1, wstring, 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -551,7 +552,7 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
|
||||
if (enc_codepage > 0)
|
||||
{
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
string, slen, 0, NULL);
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
/* If we had included the ALT key into the character but now the
|
||||
* upper bit is no longer set, that probably means the conversion
|
||||
* failed. Convert the original character and set the upper bit
|
||||
@@ -560,7 +561,7 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
|
||||
{
|
||||
wstring[0] = ch & 0x7f;
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
string, slen, 0, NULL);
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
if (len == 1) /* safety check */
|
||||
string[0] |= 0x80;
|
||||
}
|
||||
@@ -921,7 +922,7 @@ findrep_atow(LPFINDREPLACEW lpfrw, LPFINDREPLACE lpfr)
|
||||
lpfrw->hwndOwner = lpfr->hwndOwner;
|
||||
lpfrw->Flags = lpfr->Flags;
|
||||
|
||||
wp = enc_to_utf16(lpfr->lpstrFindWhat, NULL);
|
||||
wp = enc_to_utf16((char_u *)lpfr->lpstrFindWhat, NULL);
|
||||
wcsncpy(lpfrw->lpstrFindWhat, wp, lpfrw->wFindWhatLen - 1);
|
||||
vim_free(wp);
|
||||
|
||||
@@ -938,12 +939,12 @@ findrep_wtoa(LPFINDREPLACE lpfr, LPFINDREPLACEW lpfrw)
|
||||
|
||||
lpfr->Flags = lpfrw->Flags;
|
||||
|
||||
p = utf16_to_enc(lpfrw->lpstrFindWhat, NULL);
|
||||
vim_strncpy(lpfr->lpstrFindWhat, p, lpfr->wFindWhatLen - 1);
|
||||
p = utf16_to_enc((short_u*)lpfrw->lpstrFindWhat, NULL);
|
||||
vim_strncpy((char_u *)lpfr->lpstrFindWhat, p, lpfr->wFindWhatLen - 1);
|
||||
vim_free(p);
|
||||
|
||||
p = utf16_to_enc(lpfrw->lpstrReplaceWith, NULL);
|
||||
vim_strncpy(lpfr->lpstrReplaceWith, p, lpfr->wReplaceWithLen - 1);
|
||||
p = utf16_to_enc((short_u*)lpfrw->lpstrReplaceWith, NULL);
|
||||
vim_strncpy((char_u *)lpfr->lpstrReplaceWith, p, lpfr->wReplaceWithLen - 1);
|
||||
vim_free(p);
|
||||
}
|
||||
# endif
|
||||
@@ -1000,8 +1001,8 @@ _OnFindRepl(void)
|
||||
if (s_findrep_struct.Flags & FR_MATCHCASE)
|
||||
flags |= FRD_MATCH_CASE;
|
||||
down = (s_findrep_struct.Flags & FR_DOWN) != 0;
|
||||
gui_do_findrepl(flags, s_findrep_struct.lpstrFindWhat,
|
||||
s_findrep_struct.lpstrReplaceWith, down);
|
||||
gui_do_findrepl(flags, (char_u *)s_findrep_struct.lpstrFindWhat,
|
||||
(char_u *)s_findrep_struct.lpstrReplaceWith, down);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1144,7 +1145,7 @@ gui_mch_new_colors(void)
|
||||
* Set the colors to their default values.
|
||||
*/
|
||||
void
|
||||
gui_mch_def_colors()
|
||||
gui_mch_def_colors(void)
|
||||
{
|
||||
gui.norm_pixel = GetSysColor(COLOR_WINDOWTEXT);
|
||||
gui.back_pixel = GetSysColor(COLOR_WINDOW);
|
||||
@@ -1390,9 +1391,7 @@ gui_mch_get_font(
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@@ -1532,7 +1531,7 @@ gui_mch_get_color(char_u *name)
|
||||
int r, g, b;
|
||||
int i;
|
||||
|
||||
if (name[0] == '#' && strlen(name) == 7)
|
||||
if (name[0] == '#' && STRLEN(name) == 7)
|
||||
{
|
||||
/* Name is in "#rrggbb" format */
|
||||
r = hex_digit(name[1]) * 16 + hex_digit(name[2]);
|
||||
@@ -1782,10 +1781,17 @@ process_message(void)
|
||||
#ifdef FEAT_CHANNEL
|
||||
if (msg.message == WM_NETBEANS)
|
||||
{
|
||||
int channel_idx = channel_socket2idx((sock_T)msg.wParam);
|
||||
int what;
|
||||
channel_T *channel = channel_fd2channel((sock_T)msg.wParam, &what);
|
||||
|
||||
if (channel_idx >= 0)
|
||||
channel_read(channel_idx);
|
||||
if (channel != NULL)
|
||||
{
|
||||
/* Disable error messages, they can mess up the display and throw
|
||||
* an exception. */
|
||||
++emsg_off;
|
||||
channel_read(channel, what, "process_message");
|
||||
--emsg_off;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -2093,6 +2099,10 @@ gui_mch_wait_for_chars(int wtime)
|
||||
parse_queued_messages();
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CHANNEL
|
||||
channel_handle_events();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't use gui_mch_update() because then we will spin-lock until a
|
||||
* char arrives, instead we use GetMessage() to hang until an
|
||||
@@ -2263,7 +2273,7 @@ GetTextWidth(HDC hdc, char_u *str, int len)
|
||||
{
|
||||
SIZE size;
|
||||
|
||||
GetTextExtentPoint(hdc, str, len, &size);
|
||||
GetTextExtentPoint(hdc, (LPCSTR)str, len, &size);
|
||||
return size.cx;
|
||||
}
|
||||
|
||||
@@ -2436,7 +2446,7 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
|
||||
info.fMask = MIIM_TYPE | MIIM_ID;
|
||||
info.wID = item_id;
|
||||
info.fType = MFT_STRING;
|
||||
info.dwTypeData = item_text;
|
||||
info.dwTypeData = (LPTSTR)item_text;
|
||||
info.cch = (UINT)STRLEN(item_text);
|
||||
InsertMenuItem(pmenu, item_id, FALSE, &info);
|
||||
}
|
||||
@@ -2463,10 +2473,11 @@ show_tabline_popup_menu(void)
|
||||
|
||||
if (first_tabpage->tp_next != NULL)
|
||||
add_tabline_popup_menu_entry(tab_pmenu,
|
||||
TABLINE_MENU_CLOSE, _("Close tab"));
|
||||
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
|
||||
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
|
||||
_("Open tab..."));
|
||||
TABLINE_MENU_CLOSE, (char_u *)_("Close tab"));
|
||||
add_tabline_popup_menu_entry(tab_pmenu,
|
||||
TABLINE_MENU_NEW, (char_u *)_("New tab"));
|
||||
add_tabline_popup_menu_entry(tab_pmenu,
|
||||
TABLINE_MENU_OPEN, (char_u *)_("Open tab..."));
|
||||
|
||||
GetCursorPos(&pt);
|
||||
rval = TrackPopupMenuEx(tab_pmenu, TPM_RETURNCMD, pt.x, pt.y, s_tabhwnd,
|
||||
@@ -2578,7 +2589,7 @@ gui_mch_update_tabline(void)
|
||||
}
|
||||
|
||||
get_tabline_label(tp, FALSE);
|
||||
tie.pszText = NameBuff;
|
||||
tie.pszText = (LPSTR)NameBuff;
|
||||
#ifdef FEAT_MBYTE
|
||||
wstr = NULL;
|
||||
if (use_unicode)
|
||||
@@ -2623,8 +2634,7 @@ gui_mch_update_tabline(void)
|
||||
* Set the current tab to "nr". First tab is 1.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_curtab(nr)
|
||||
int nr;
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
if (s_tabhwnd == NULL)
|
||||
return;
|
||||
@@ -2676,7 +2686,7 @@ initialise_findrep(char_u *initial_string)
|
||||
if (wword)
|
||||
s_findrep_struct.Flags |= FR_WHOLEWORD;
|
||||
if (entry_text != NULL && *entry_text != NUL)
|
||||
vim_strncpy(s_findrep_struct.lpstrFindWhat, entry_text,
|
||||
vim_strncpy((char_u *)s_findrep_struct.lpstrFindWhat, entry_text,
|
||||
s_findrep_struct.wFindWhatLen - 1);
|
||||
vim_free(entry_text);
|
||||
}
|
||||
@@ -3190,11 +3200,11 @@ logfont2name(LOGFONT lf)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
int len;
|
||||
acp_to_enc(lf.lfFaceName, (int)strlen(lf.lfFaceName),
|
||||
acp_to_enc((char_u *)lf.lfFaceName, (int)strlen(lf.lfFaceName),
|
||||
(char_u **)&font_name, &len);
|
||||
}
|
||||
#endif
|
||||
res = alloc((unsigned)(strlen(font_name) + 20
|
||||
res = (char *)alloc((unsigned)(strlen(font_name) + 20
|
||||
+ (charset_name == NULL ? 0 : strlen(charset_name) + 2)));
|
||||
if (res != NULL)
|
||||
{
|
||||
@@ -3229,7 +3239,7 @@ logfont2name(LOGFONT lf)
|
||||
if (font_name != lf.lfFaceName)
|
||||
vim_free(font_name);
|
||||
#endif
|
||||
return res;
|
||||
return (char_u *)res;
|
||||
}
|
||||
|
||||
|
||||
@@ -3258,7 +3268,7 @@ update_im_font(void)
|
||||
* Handler of gui.wide_font (p_guifontwide) changed notification.
|
||||
*/
|
||||
void
|
||||
gui_mch_wide_font_changed()
|
||||
gui_mch_wide_font_changed(void)
|
||||
{
|
||||
# ifndef MSWIN16_FASTTEXT
|
||||
LOGFONT lf;
|
||||
@@ -3319,7 +3329,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
|
||||
return FAIL;
|
||||
|
||||
if (font_name == NULL)
|
||||
font_name = lf.lfFaceName;
|
||||
font_name = (char_u *)lf.lfFaceName;
|
||||
#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
|
||||
norm_logfont = lf;
|
||||
sub_logfont = lf;
|
||||
@@ -3385,7 +3395,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
|
||||
* Return TRUE if the GUI window is maximized, filling the whole screen.
|
||||
*/
|
||||
int
|
||||
gui_mch_maximized()
|
||||
gui_mch_maximized(void)
|
||||
{
|
||||
WINDOWPLACEMENT wp;
|
||||
|
||||
@@ -3403,7 +3413,7 @@ gui_mch_maximized()
|
||||
* new Rows and Columns. This is like resizing the window.
|
||||
*/
|
||||
void
|
||||
gui_mch_newfont()
|
||||
gui_mch_newfont(void)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
@@ -3749,12 +3759,12 @@ gui_mch_browse(
|
||||
fileStruct.lStructSize = sizeof(fileStruct);
|
||||
#endif
|
||||
|
||||
fileStruct.lpstrTitle = title;
|
||||
fileStruct.lpstrDefExt = ext;
|
||||
fileStruct.lpstrTitle = (LPSTR)title;
|
||||
fileStruct.lpstrDefExt = (LPSTR)ext;
|
||||
|
||||
fileStruct.lpstrFile = fileBuf;
|
||||
fileStruct.lpstrFile = (LPSTR)fileBuf;
|
||||
fileStruct.nMaxFile = MAXPATHL;
|
||||
fileStruct.lpstrFilter = filterp;
|
||||
fileStruct.lpstrFilter = (LPSTR)filterp;
|
||||
fileStruct.hwndOwner = s_hwnd; /* main Vim window is owner*/
|
||||
/* has an initial dir been specified? */
|
||||
if (initdir != NULL && *initdir != NUL)
|
||||
@@ -3765,7 +3775,7 @@ gui_mch_browse(
|
||||
for (p = initdirp; *p != NUL; ++p)
|
||||
if (*p == '/')
|
||||
*p = '\\';
|
||||
fileStruct.lpstrInitialDir = initdirp;
|
||||
fileStruct.lpstrInitialDir = (LPSTR)initdirp;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3847,7 +3857,7 @@ _OnDropFiles(
|
||||
#endif
|
||||
{
|
||||
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
|
||||
fnames[i] = vim_strsave(szFile);
|
||||
fnames[i] = vim_strsave((char_u *)szFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+173
-234
@@ -571,19 +571,19 @@ static char **gui_argv = NULL;
|
||||
*/
|
||||
|
||||
static void
|
||||
gui_x11_timer_cb(timed_out, interval_id)
|
||||
XtPointer timed_out;
|
||||
XtIntervalId *interval_id UNUSED;
|
||||
gui_x11_timer_cb(
|
||||
XtPointer timed_out,
|
||||
XtIntervalId *interval_id UNUSED)
|
||||
{
|
||||
*((int *)timed_out) = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_visibility_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_visibility_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
if (event->type != VisibilityNotify)
|
||||
return;
|
||||
@@ -602,11 +602,11 @@ gui_x11_visibility_cb(w, dud, event, dum)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_expose_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_expose_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XExposeEvent *gevent;
|
||||
int new_x;
|
||||
@@ -678,11 +678,11 @@ shellRectangle(Widget shell, XRectangle *r)
|
||||
#endif
|
||||
|
||||
static void
|
||||
gui_x11_resize_window_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_resize_window_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
static int lastWidth, lastHeight;
|
||||
|
||||
@@ -724,31 +724,31 @@ gui_x11_resize_window_cb(w, dud, event, dum)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_focus_change_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_focus_change_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(event->type == FocusIn);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_enter_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_enter_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_leave_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_leave_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(FALSE);
|
||||
}
|
||||
@@ -760,11 +760,11 @@ gui_x11_leave_cb(w, data, event, dum)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_x11_key_hit_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_key_hit_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XKeyPressedEvent *ev_press;
|
||||
#ifdef FEAT_XIM
|
||||
@@ -1071,11 +1071,11 @@ theend:
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_mouse_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_mouse_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
static XtIntervalId timer = (XtIntervalId)0;
|
||||
static int timed_out = TRUE;
|
||||
@@ -1166,10 +1166,10 @@ gui_x11_mouse_cb(w, dud, event, dum)
|
||||
#ifdef FEAT_SNIFF
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
gui_x11_sniff_request_cb(closure, source, id)
|
||||
XtPointer closure UNUSED;
|
||||
int *source UNUSED;
|
||||
XtInputId *id UNUSED;
|
||||
gui_x11_sniff_request_cb(
|
||||
XtPointer closure UNUSED,
|
||||
int *source UNUSED,
|
||||
XtInputId *id UNUSED)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
|
||||
|
||||
@@ -1187,9 +1187,7 @@ gui_x11_sniff_request_cb(closure, source, id)
|
||||
* when vim is started, whether or not the GUI has been started.
|
||||
*/
|
||||
void
|
||||
gui_mch_prepare(argc, argv)
|
||||
int *argc;
|
||||
char **argv;
|
||||
gui_mch_prepare(int *argc, char **argv)
|
||||
{
|
||||
int arg;
|
||||
int i;
|
||||
@@ -1285,7 +1283,7 @@ gui_mch_prepare(argc, argv)
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
int
|
||||
gui_mch_init_check()
|
||||
gui_mch_init_check(void)
|
||||
{
|
||||
#ifdef FEAT_XIM
|
||||
XtSetLanguageProc(NULL, NULL, NULL);
|
||||
@@ -1315,10 +1313,10 @@ static XtInputId _xsmp_xtinputid;
|
||||
static void local_xsmp_handle_requests(XtPointer c, int *s, XtInputId *i);
|
||||
|
||||
static void
|
||||
local_xsmp_handle_requests(c, s, i)
|
||||
XtPointer c UNUSED;
|
||||
int *s UNUSED;
|
||||
XtInputId *i UNUSED;
|
||||
local_xsmp_handle_requests(
|
||||
XtPointer c UNUSED,
|
||||
int *s UNUSED,
|
||||
XtInputId *i UNUSED)
|
||||
{
|
||||
if (xsmp_handle_requests() == FAIL)
|
||||
XtRemoveInput(_xsmp_xtinputid);
|
||||
@@ -1331,7 +1329,7 @@ local_xsmp_handle_requests(c, s, i)
|
||||
* Returns OK for success, FAIL when the GUI can't be started.
|
||||
*/
|
||||
int
|
||||
gui_mch_init()
|
||||
gui_mch_init(void)
|
||||
{
|
||||
XtGCMask gc_mask;
|
||||
XGCValues gc_vals;
|
||||
@@ -1575,7 +1573,7 @@ gui_mch_init()
|
||||
* Called when starting the GUI fails after calling gui_mch_init().
|
||||
*/
|
||||
void
|
||||
gui_mch_uninit()
|
||||
gui_mch_uninit(void)
|
||||
{
|
||||
gui_x11_destroy_widgets();
|
||||
XtCloseDisplay(gui.dpy);
|
||||
@@ -1589,7 +1587,7 @@ gui_mch_uninit()
|
||||
* Called when the foreground or background color has been changed.
|
||||
*/
|
||||
void
|
||||
gui_mch_new_colors()
|
||||
gui_mch_new_colors(void)
|
||||
{
|
||||
long_u gc_mask;
|
||||
XGCValues gc_vals;
|
||||
@@ -1619,7 +1617,7 @@ gui_mch_new_colors()
|
||||
* Open the GUI window which was created by a call to gui_mch_init().
|
||||
*/
|
||||
int
|
||||
gui_mch_open()
|
||||
gui_mch_open(void)
|
||||
{
|
||||
/* Actually open the window */
|
||||
XtRealizeWidget(vimShell);
|
||||
@@ -1700,7 +1698,7 @@ gui_mch_open()
|
||||
* Convert the tooltip fontset name to an XFontSet.
|
||||
*/
|
||||
void
|
||||
gui_init_tooltip_font()
|
||||
gui_init_tooltip_font(void)
|
||||
{
|
||||
XrmValue from, to;
|
||||
|
||||
@@ -1719,7 +1717,7 @@ gui_init_tooltip_font()
|
||||
#if defined(FEAT_MENU) || defined(PROTO)
|
||||
/* Convert the menu font/fontset name to an XFontStruct/XFontset */
|
||||
void
|
||||
gui_init_menu_font()
|
||||
gui_init_menu_font(void)
|
||||
{
|
||||
XrmValue from, to;
|
||||
|
||||
@@ -1748,8 +1746,7 @@ gui_init_menu_font()
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_exit(rc)
|
||||
int rc UNUSED;
|
||||
gui_mch_exit(int rc UNUSED)
|
||||
{
|
||||
#if 0
|
||||
/* Lesstif gives an error message here, and so does Solaris. The man page
|
||||
@@ -1764,8 +1761,7 @@ gui_mch_exit(rc)
|
||||
* Get the position of the top left corner of the window.
|
||||
*/
|
||||
int
|
||||
gui_mch_get_winpos(x, y)
|
||||
int *x, *y;
|
||||
gui_mch_get_winpos(int *x, int *y)
|
||||
{
|
||||
Dimension xpos, ypos;
|
||||
|
||||
@@ -1783,8 +1779,7 @@ gui_mch_get_winpos(x, y)
|
||||
* coordinates.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_winpos(x, y)
|
||||
int x, y;
|
||||
gui_mch_set_winpos(int x, int y)
|
||||
{
|
||||
XtVaSetValues(vimShell,
|
||||
XtNx, x,
|
||||
@@ -1793,15 +1788,14 @@ gui_mch_set_winpos(x, y)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
base_width, base_height, direction)
|
||||
int width;
|
||||
int height;
|
||||
int min_width;
|
||||
int min_height;
|
||||
int base_width;
|
||||
int base_height;
|
||||
int direction UNUSED;
|
||||
gui_mch_set_shellsize(
|
||||
int width,
|
||||
int height,
|
||||
int min_width,
|
||||
int min_height,
|
||||
int base_width,
|
||||
int base_height,
|
||||
int direction UNUSED)
|
||||
{
|
||||
#ifdef FEAT_XIM
|
||||
height += xim_get_status_area_height(),
|
||||
@@ -1825,9 +1819,9 @@ gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
* Is there no way in X to find out how wide the borders really are?
|
||||
*/
|
||||
void
|
||||
gui_mch_get_screen_dimensions(screen_w, screen_h)
|
||||
int *screen_w;
|
||||
int *screen_h;
|
||||
gui_mch_get_screen_dimensions(
|
||||
int *screen_w,
|
||||
int *screen_h)
|
||||
{
|
||||
*screen_w = DisplayWidth(gui.dpy, DefaultScreen(gui.dpy)) - 10;
|
||||
*screen_h = DisplayHeight(gui.dpy, DefaultScreen(gui.dpy)) - p_ghr;
|
||||
@@ -1840,9 +1834,9 @@ gui_mch_get_screen_dimensions(screen_w, screen_h)
|
||||
* Return FAIL if the font could not be loaded, OK otherwise.
|
||||
*/
|
||||
int
|
||||
gui_mch_init_font(font_name, do_fontset)
|
||||
char_u *font_name;
|
||||
int do_fontset UNUSED;
|
||||
gui_mch_init_font(
|
||||
char_u *font_name,
|
||||
int do_fontset UNUSED)
|
||||
{
|
||||
XFontStruct *font = NULL;
|
||||
|
||||
@@ -1970,9 +1964,7 @@ gui_mch_init_font(font_name, do_fontset)
|
||||
* Get a font structure for highlighting.
|
||||
*/
|
||||
GuiFont
|
||||
gui_mch_get_font(name, giveErrorIfMissing)
|
||||
char_u *name;
|
||||
int giveErrorIfMissing;
|
||||
gui_mch_get_font(char_u *name, int giveErrorIfMissing)
|
||||
{
|
||||
XFontStruct *font;
|
||||
|
||||
@@ -2021,9 +2013,7 @@ gui_mch_get_font(name, giveErrorIfMissing)
|
||||
* Don't know how to get the actual name, thus use the provided name.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font UNUSED;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font UNUSED, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@@ -2035,7 +2025,7 @@ gui_mch_get_fontname(font, name)
|
||||
* Adjust gui.char_height (after 'linespace' was changed).
|
||||
*/
|
||||
int
|
||||
gui_mch_adjust_charheight()
|
||||
gui_mch_adjust_charheight(void)
|
||||
{
|
||||
#ifdef FEAT_XFONTSET
|
||||
if (gui.fontset != NOFONTSET)
|
||||
@@ -2059,8 +2049,7 @@ gui_mch_adjust_charheight()
|
||||
* Set the current text font.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_font(font)
|
||||
GuiFont font;
|
||||
gui_mch_set_font(GuiFont font)
|
||||
{
|
||||
static Font prev_font = (Font)-1;
|
||||
Font fid = ((XFontStruct *)font)->fid;
|
||||
@@ -2083,8 +2072,7 @@ gui_mch_set_font(font)
|
||||
* Adjust the ascent, in case it's different.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_fontset(fontset)
|
||||
GuiFontset fontset;
|
||||
gui_mch_set_fontset(GuiFontset fontset)
|
||||
{
|
||||
current_fontset = (XFontSet)fontset;
|
||||
gui.char_ascent = fontset_ascent(current_fontset) + p_linespace / 2;
|
||||
@@ -2095,8 +2083,7 @@ gui_mch_set_fontset(fontset)
|
||||
* If a font is not going to be used, free its structure.
|
||||
*/
|
||||
void
|
||||
gui_mch_free_font(font)
|
||||
GuiFont font;
|
||||
gui_mch_free_font(GuiFont font)
|
||||
{
|
||||
if (font != NOFONT)
|
||||
XFreeFont(gui.dpy, (XFontStruct *)font);
|
||||
@@ -2107,8 +2094,7 @@ gui_mch_free_font(font)
|
||||
* If a fontset is not going to be used, free its structure.
|
||||
*/
|
||||
void
|
||||
gui_mch_free_fontset(fontset)
|
||||
GuiFontset fontset;
|
||||
gui_mch_free_fontset(GuiFontset fontset)
|
||||
{
|
||||
if (fontset != NOFONTSET)
|
||||
XFreeFontSet(gui.dpy, (XFontSet)fontset);
|
||||
@@ -2119,10 +2105,10 @@ gui_mch_free_fontset(fontset)
|
||||
* Return a reference to the fontset, or NOFONTSET when failing.
|
||||
*/
|
||||
GuiFontset
|
||||
gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width)
|
||||
char_u *name;
|
||||
int giveErrorIfMissing;
|
||||
int fixed_width;
|
||||
gui_mch_get_fontset(
|
||||
char_u *name,
|
||||
int giveErrorIfMissing,
|
||||
int fixed_width)
|
||||
{
|
||||
XFontSet fontset;
|
||||
char **missing, *def_str;
|
||||
@@ -2165,8 +2151,7 @@ gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width)
|
||||
* Check if fontset "fs" is fixed width.
|
||||
*/
|
||||
static int
|
||||
check_fontset_sanity(fs)
|
||||
XFontSet fs;
|
||||
check_fontset_sanity(XFontSet fs)
|
||||
{
|
||||
XFontStruct **xfs;
|
||||
char **font_name;
|
||||
@@ -2216,15 +2201,14 @@ check_fontset_sanity(fs)
|
||||
}
|
||||
|
||||
static int
|
||||
fontset_width(fs)
|
||||
XFontSet fs;
|
||||
fontset_width(XFontSet fs)
|
||||
{
|
||||
return XmbTextEscapement(fs, "Vim", 3) / 3;
|
||||
return XmbTextEscapement(fs, "Vim", 3) / 3;
|
||||
}
|
||||
|
||||
int
|
||||
fontset_height(fs)
|
||||
XFontSet fs;
|
||||
fontset_height(
|
||||
XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@@ -2239,8 +2223,7 @@ fontset_height(fs)
|
||||
* characters in all fonts of the fontset.
|
||||
*/
|
||||
int
|
||||
fontset_height2(fs)
|
||||
XFontSet fs;
|
||||
fontset_height2(XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@@ -2251,8 +2234,7 @@ fontset_height2(fs)
|
||||
|
||||
/* NOT USED YET
|
||||
static int
|
||||
fontset_descent(fs)
|
||||
XFontSet fs;
|
||||
fontset_descent(XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@@ -2262,8 +2244,7 @@ fontset_descent(fs)
|
||||
*/
|
||||
|
||||
static int
|
||||
fontset_ascent(fs)
|
||||
XFontSet fs;
|
||||
fontset_ascent(XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@@ -2278,8 +2259,7 @@ fontset_ascent(fs)
|
||||
* Return INVALCOLOR for error.
|
||||
*/
|
||||
guicolor_T
|
||||
gui_mch_get_color(reqname)
|
||||
char_u *reqname;
|
||||
gui_mch_get_color(char_u *reqname)
|
||||
{
|
||||
int i;
|
||||
char_u *name = reqname;
|
||||
@@ -2382,9 +2362,7 @@ gui_mch_get_color(reqname)
|
||||
* Return FAIL if not able to find or allocate a color.
|
||||
*/
|
||||
static int
|
||||
find_closest_color(colormap, colorPtr)
|
||||
Colormap colormap;
|
||||
XColor *colorPtr;
|
||||
find_closest_color(Colormap colormap, XColor *colorPtr)
|
||||
{
|
||||
double tmp, distance, closestDistance;
|
||||
int i, closest, numFound, cmap_size;
|
||||
@@ -2452,8 +2430,7 @@ find_closest_color(colormap, colorPtr)
|
||||
* Set the current text foreground color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_fg_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_fg_color(guicolor_T color)
|
||||
{
|
||||
if (color != prev_fg_color)
|
||||
{
|
||||
@@ -2466,8 +2443,7 @@ gui_mch_set_fg_color(color)
|
||||
* Set the current text background color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_bg_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_bg_color(guicolor_T color)
|
||||
{
|
||||
if (color != prev_bg_color)
|
||||
{
|
||||
@@ -2480,8 +2456,7 @@ gui_mch_set_bg_color(color)
|
||||
* Set the current text special color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_sp_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_sp_color(guicolor_T color)
|
||||
{
|
||||
prev_sp_color = color;
|
||||
}
|
||||
@@ -2490,7 +2465,7 @@ gui_mch_set_sp_color(color)
|
||||
* create a mouse pointer that is blank
|
||||
*/
|
||||
static Cursor
|
||||
gui_x11_create_blank_mouse()
|
||||
gui_x11_create_blank_mouse(void)
|
||||
{
|
||||
Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1);
|
||||
GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0);
|
||||
@@ -2504,10 +2479,7 @@ gui_x11_create_blank_mouse()
|
||||
* Draw a curled line at the bottom of the character cell.
|
||||
*/
|
||||
static void
|
||||
draw_curl(row, col, cells)
|
||||
int row;
|
||||
int col;
|
||||
int cells;
|
||||
draw_curl(int row, int col, int cells)
|
||||
{
|
||||
int i;
|
||||
int offset;
|
||||
@@ -2524,12 +2496,12 @@ draw_curl(row, col, cells)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_draw_string(row, col, s, len, flags)
|
||||
int row;
|
||||
int col;
|
||||
char_u *s;
|
||||
int len;
|
||||
int flags;
|
||||
gui_mch_draw_string(
|
||||
int row,
|
||||
int col,
|
||||
char_u *s,
|
||||
int len,
|
||||
int flags)
|
||||
{
|
||||
int cells = len;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -2691,8 +2663,7 @@ gui_mch_draw_string(row, col, s, len, flags)
|
||||
* Return OK if the key with the termcap name "name" is supported.
|
||||
*/
|
||||
int
|
||||
gui_mch_haskey(name)
|
||||
char_u *name;
|
||||
gui_mch_haskey(char_u *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2707,9 +2678,7 @@ gui_mch_haskey(name)
|
||||
* Return the text window-id and display. Only required for X-based GUI's
|
||||
*/
|
||||
int
|
||||
gui_get_x11_windis(win, dis)
|
||||
Window *win;
|
||||
Display **dis;
|
||||
gui_get_x11_windis(Window *win, Display **dis)
|
||||
{
|
||||
*win = XtWindow(vimShell);
|
||||
*dis = gui.dpy;
|
||||
@@ -2717,14 +2686,13 @@ gui_get_x11_windis(win, dis)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_beep()
|
||||
gui_mch_beep(void)
|
||||
{
|
||||
XBell(gui.dpy, 0);
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_flash(msec)
|
||||
int msec;
|
||||
gui_mch_flash(int msec)
|
||||
{
|
||||
/* Do a visual beep by reversing the foreground and background colors */
|
||||
XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
|
||||
@@ -2741,11 +2709,11 @@ gui_mch_flash(msec)
|
||||
* Invert a rectangle from row r, column c, for nr rows and nc columns.
|
||||
*/
|
||||
void
|
||||
gui_mch_invert_rectangle(r, c, nr, nc)
|
||||
int r;
|
||||
int c;
|
||||
int nr;
|
||||
int nc;
|
||||
gui_mch_invert_rectangle(
|
||||
int r,
|
||||
int c,
|
||||
int nr,
|
||||
int nc)
|
||||
{
|
||||
XFillRectangle(gui.dpy, gui.wid, gui.invert_gc,
|
||||
FILL_X(c), FILL_Y(r), (nc) * gui.char_width, (nr) * gui.char_height);
|
||||
@@ -2755,7 +2723,7 @@ gui_mch_invert_rectangle(r, c, nr, nc)
|
||||
* Iconify the GUI window.
|
||||
*/
|
||||
void
|
||||
gui_mch_iconify()
|
||||
gui_mch_iconify(void)
|
||||
{
|
||||
XIconifyWindow(gui.dpy, XtWindow(vimShell), DefaultScreen(gui.dpy));
|
||||
}
|
||||
@@ -2765,7 +2733,7 @@ gui_mch_iconify()
|
||||
* Bring the Vim window to the foreground.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_foreground()
|
||||
gui_mch_set_foreground(void)
|
||||
{
|
||||
XMapRaised(gui.dpy, XtWindow(vimShell));
|
||||
}
|
||||
@@ -2775,8 +2743,7 @@ gui_mch_set_foreground()
|
||||
* Draw a cursor without focus.
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_hollow_cursor(color)
|
||||
guicolor_T color;
|
||||
gui_mch_draw_hollow_cursor(guicolor_T color)
|
||||
{
|
||||
int w = 1;
|
||||
|
||||
@@ -2794,10 +2761,7 @@ gui_mch_draw_hollow_cursor(color)
|
||||
* color "color".
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_part_cursor(w, h, color)
|
||||
int w;
|
||||
int h;
|
||||
guicolor_T color;
|
||||
gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
|
||||
{
|
||||
gui_mch_set_fg_color(color);
|
||||
|
||||
@@ -2818,7 +2782,7 @@ gui_mch_draw_part_cursor(w, h, color)
|
||||
* immediately.
|
||||
*/
|
||||
void
|
||||
gui_mch_update()
|
||||
gui_mch_update(void)
|
||||
{
|
||||
XtInputMask mask, desired;
|
||||
|
||||
@@ -2843,8 +2807,7 @@ gui_mch_update()
|
||||
* or FAIL otherwise.
|
||||
*/
|
||||
int
|
||||
gui_mch_wait_for_chars(wtime)
|
||||
long wtime;
|
||||
gui_mch_wait_for_chars(long wtime)
|
||||
{
|
||||
int focus;
|
||||
|
||||
@@ -2930,7 +2893,7 @@ gui_mch_wait_for_chars(wtime)
|
||||
|
||||
/* Flush any output to the screen */
|
||||
void
|
||||
gui_mch_flush()
|
||||
gui_mch_flush(void)
|
||||
{
|
||||
XFlush(gui.dpy);
|
||||
}
|
||||
@@ -2940,11 +2903,11 @@ gui_mch_flush()
|
||||
* (row2, col2) inclusive.
|
||||
*/
|
||||
void
|
||||
gui_mch_clear_block(row1, col1, row2, col2)
|
||||
int row1;
|
||||
int col1;
|
||||
int row2;
|
||||
int col2;
|
||||
gui_mch_clear_block(
|
||||
int row1,
|
||||
int col1,
|
||||
int row2,
|
||||
int col2)
|
||||
{
|
||||
int x;
|
||||
|
||||
@@ -2958,7 +2921,7 @@ gui_mch_clear_block(row1, col1, row2, col2)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_clear_all()
|
||||
gui_mch_clear_all(void)
|
||||
{
|
||||
XClearArea(gui.dpy, gui.wid, 0, 0, 0, 0, False);
|
||||
}
|
||||
@@ -2968,9 +2931,7 @@ gui_mch_clear_all()
|
||||
* text further down within the scroll region.
|
||||
*/
|
||||
void
|
||||
gui_mch_delete_lines(row, num_lines)
|
||||
int row;
|
||||
int num_lines;
|
||||
gui_mch_delete_lines(int row, int num_lines)
|
||||
{
|
||||
if (gui.visibility == VisibilityFullyObscured)
|
||||
return; /* Can't see the window */
|
||||
@@ -2995,9 +2956,7 @@ gui_mch_delete_lines(row, num_lines)
|
||||
* following text within the scroll region.
|
||||
*/
|
||||
void
|
||||
gui_mch_insert_lines(row, num_lines)
|
||||
int row;
|
||||
int num_lines;
|
||||
gui_mch_insert_lines(int row, int num_lines)
|
||||
{
|
||||
if (gui.visibility == VisibilityFullyObscured)
|
||||
return; /* Can't see the window */
|
||||
@@ -3020,7 +2979,7 @@ gui_mch_insert_lines(row, num_lines)
|
||||
* Update the region revealed by scrolling up/down.
|
||||
*/
|
||||
static void
|
||||
gui_x11_check_copy_area()
|
||||
gui_x11_check_copy_area(void)
|
||||
{
|
||||
XEvent event;
|
||||
XGraphicsExposeEvent *gevent;
|
||||
@@ -3052,29 +3011,26 @@ gui_x11_check_copy_area()
|
||||
*/
|
||||
|
||||
void
|
||||
clip_mch_lose_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_lose_selection(VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_lose_selection(vimShell, cbd);
|
||||
}
|
||||
|
||||
int
|
||||
clip_mch_own_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_own_selection(VimClipboard *cbd)
|
||||
{
|
||||
return clip_x11_own_selection(vimShell, cbd);
|
||||
}
|
||||
|
||||
void
|
||||
clip_mch_request_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_request_selection(VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_request_selection(vimShell, gui.dpy, cbd);
|
||||
clip_x11_request_selection(vimShell, gui.dpy, cbd);
|
||||
}
|
||||
|
||||
void
|
||||
clip_mch_set_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_set_selection(
|
||||
VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_set_selection(cbd);
|
||||
}
|
||||
@@ -3088,9 +3044,7 @@ clip_mch_set_selection(cbd)
|
||||
* Make a menu either grey or not grey.
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_grey(menu, grey)
|
||||
vimmenu_T *menu;
|
||||
int grey;
|
||||
gui_mch_menu_grey(vimmenu_T *menu, int grey)
|
||||
{
|
||||
if (menu->id != (Widget)0)
|
||||
{
|
||||
@@ -3110,9 +3064,7 @@ gui_mch_menu_grey(menu, grey)
|
||||
* Make menu item hidden or not hidden
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_hidden(menu, hidden)
|
||||
vimmenu_T *menu;
|
||||
int hidden;
|
||||
gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
|
||||
{
|
||||
if (menu->id != (Widget)0)
|
||||
{
|
||||
@@ -3127,16 +3079,16 @@ gui_mch_menu_hidden(menu, hidden)
|
||||
* This is called after setting all the menus to grey/hidden or not.
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_menubar()
|
||||
gui_mch_draw_menubar(void)
|
||||
{
|
||||
/* Nothing to do in X */
|
||||
}
|
||||
|
||||
void
|
||||
gui_x11_menu_cb(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
gui_x11_menu_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
gui_menu_cb((vimmenu_T *)client_data);
|
||||
}
|
||||
@@ -3150,11 +3102,11 @@ gui_x11_menu_cb(w, client_data, call_data)
|
||||
* Should put up a requester!
|
||||
*/
|
||||
static void
|
||||
gui_x11_wm_protocol_handler(w, client_data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_wm_protocol_handler(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
/*
|
||||
* Only deal with Client messages.
|
||||
@@ -3192,11 +3144,11 @@ gui_x11_wm_protocol_handler(w, client_data, event, dum)
|
||||
* Function called when property changed. Check for incoming commands
|
||||
*/
|
||||
static void
|
||||
gui_x11_send_event_handler(w, client_data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_send_event_handler(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XPropertyEvent *e = (XPropertyEvent *) event;
|
||||
|
||||
@@ -3228,8 +3180,7 @@ static long_u blink_offtime = 250;
|
||||
static XtIntervalId blink_timer = (XtIntervalId)0;
|
||||
|
||||
void
|
||||
gui_mch_set_blinking(waittime, on, off)
|
||||
long waittime, on, off;
|
||||
gui_mch_set_blinking(long waittime, long on, long off)
|
||||
{
|
||||
blink_waittime = waittime;
|
||||
blink_ontime = on;
|
||||
@@ -3240,7 +3191,7 @@ gui_mch_set_blinking(waittime, on, off)
|
||||
* Stop the cursor blinking. Show the cursor if it wasn't shown.
|
||||
*/
|
||||
void
|
||||
gui_mch_stop_blink()
|
||||
gui_mch_stop_blink(void)
|
||||
{
|
||||
if (blink_timer != (XtIntervalId)0)
|
||||
{
|
||||
@@ -3257,7 +3208,7 @@ gui_mch_stop_blink()
|
||||
* waiting time and shows the cursor.
|
||||
*/
|
||||
void
|
||||
gui_mch_start_blink()
|
||||
gui_mch_start_blink(void)
|
||||
{
|
||||
if (blink_timer != (XtIntervalId)0)
|
||||
XtRemoveTimeOut(blink_timer);
|
||||
@@ -3272,9 +3223,9 @@ gui_mch_start_blink()
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_blink_cb(timed_out, interval_id)
|
||||
XtPointer timed_out UNUSED;
|
||||
XtIntervalId *interval_id UNUSED;
|
||||
gui_x11_blink_cb(
|
||||
XtPointer timed_out UNUSED,
|
||||
XtIntervalId *interval_id UNUSED)
|
||||
{
|
||||
if (blink_state == BLINK_ON)
|
||||
{
|
||||
@@ -3296,8 +3247,7 @@ gui_x11_blink_cb(timed_out, interval_id)
|
||||
* Return the RGB value of a pixel as a long.
|
||||
*/
|
||||
long_u
|
||||
gui_mch_get_rgb(pixel)
|
||||
guicolor_T pixel;
|
||||
gui_mch_get_rgb(guicolor_T pixel)
|
||||
{
|
||||
XColor xc;
|
||||
Colormap colormap;
|
||||
@@ -3314,9 +3264,7 @@ gui_mch_get_rgb(pixel)
|
||||
* Add the callback functions.
|
||||
*/
|
||||
void
|
||||
gui_x11_callbacks(textArea, vimForm)
|
||||
Widget textArea;
|
||||
Widget vimForm;
|
||||
gui_x11_callbacks(Widget textArea, Widget vimForm)
|
||||
{
|
||||
XtAddEventHandler(textArea, VisibilityChangeMask, FALSE,
|
||||
gui_x11_visibility_cb, (XtPointer)0);
|
||||
@@ -3379,9 +3327,7 @@ gui_mch_getmouse(int *x, int *y)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_setmouse(x, y)
|
||||
int x;
|
||||
int y;
|
||||
gui_mch_setmouse(int x, int y)
|
||||
{
|
||||
if (gui.wid)
|
||||
XWarpPointer(gui.dpy, (Window)0, gui.wid, 0, 0, 0, 0, x, y);
|
||||
@@ -3389,7 +3335,7 @@ gui_mch_setmouse(x, y)
|
||||
|
||||
#if (defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)) || defined(PROTO)
|
||||
XButtonPressedEvent *
|
||||
gui_x11_get_last_mouse_event()
|
||||
gui_x11_get_last_mouse_event(void)
|
||||
{
|
||||
return &last_mouse_event;
|
||||
}
|
||||
@@ -3402,10 +3348,7 @@ gui_x11_get_last_mouse_event()
|
||||
# define SIGN_WIDTH (gui.char_width * 2)
|
||||
|
||||
void
|
||||
gui_mch_drawsign(row, col, typenr)
|
||||
int row;
|
||||
int col;
|
||||
int typenr;
|
||||
gui_mch_drawsign(int row, int col, int typenr)
|
||||
{
|
||||
XImage *sign;
|
||||
|
||||
@@ -3421,8 +3364,7 @@ gui_mch_drawsign(row, col, typenr)
|
||||
}
|
||||
|
||||
void *
|
||||
gui_mch_register_sign(signfile)
|
||||
char_u *signfile;
|
||||
gui_mch_register_sign(char_u *signfile)
|
||||
{
|
||||
XpmAttributes attrs;
|
||||
XImage *sign = NULL;
|
||||
@@ -3462,8 +3404,7 @@ gui_mch_register_sign(signfile)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_sign(sign)
|
||||
void *sign;
|
||||
gui_mch_destroy_sign(void *sign)
|
||||
{
|
||||
XDestroyImage((XImage*)sign);
|
||||
}
|
||||
@@ -3480,8 +3421,8 @@ static int last_shape = 0;
|
||||
* Use the blank mouse pointer or not.
|
||||
*/
|
||||
void
|
||||
gui_mch_mousehide(hide)
|
||||
int hide; /* TRUE = use blank ptr, FALSE = use parent ptr */
|
||||
gui_mch_mousehide(
|
||||
int hide) /* TRUE = use blank ptr, FALSE = use parent ptr */
|
||||
{
|
||||
if (gui.pointer_hidden != hide)
|
||||
{
|
||||
@@ -3523,8 +3464,7 @@ static int mshape_ids[] =
|
||||
};
|
||||
|
||||
void
|
||||
mch_set_mouse_shape(shape)
|
||||
int shape;
|
||||
mch_set_mouse_shape(int shape)
|
||||
{
|
||||
int id;
|
||||
|
||||
@@ -3560,8 +3500,7 @@ mch_set_mouse_shape(shape)
|
||||
* passing a normal menu item here. Can't explain that, but better avoid it.
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_set_tip(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_menu_set_tip(vimmenu_T *menu)
|
||||
{
|
||||
if (menu->id != NULL && menu->parent != NULL
|
||||
&& menu_is_toolbar(menu->parent->name))
|
||||
|
||||
+30
-54
@@ -96,9 +96,7 @@ static short_u kind_table_for_3[] =
|
||||
*/
|
||||
|
||||
static int
|
||||
comfcon3(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comfcon3(int v, int c)
|
||||
{
|
||||
if (v == 2 && c == 2)
|
||||
return 3;
|
||||
@@ -118,9 +116,7 @@ comfcon3(v, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comvow3(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comvow3(int v, int c)
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
@@ -159,9 +155,7 @@ comvow3(v, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comcon3(k, c)
|
||||
int k;
|
||||
int c;
|
||||
comcon3(int k, int c)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
@@ -217,8 +211,7 @@ comcon3(k, c)
|
||||
/**********************************************************************/
|
||||
|
||||
static int
|
||||
kind_table_for_2(c)
|
||||
int c;
|
||||
kind_table_for_2(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@@ -241,8 +234,7 @@ kind_table_for_2(c)
|
||||
* 결과: 초성이 아니면 0 (If it is not initial sound, return 0).
|
||||
*/
|
||||
static int
|
||||
fcon(c)
|
||||
int c;
|
||||
fcon(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@@ -266,8 +258,7 @@ fcon(c)
|
||||
* 결과: 중성이 아니면 0 (If it is not medial vowel, return 0).
|
||||
*/
|
||||
static int
|
||||
vow(c)
|
||||
int c;
|
||||
vow(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@@ -289,8 +280,7 @@ vow(c)
|
||||
* 결과: 받침이 아니면 0 (If not prop, return 0)
|
||||
*/
|
||||
static int
|
||||
lcon(c)
|
||||
int c;
|
||||
lcon(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@@ -312,9 +302,7 @@ lcon(c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comcon2(k, c)
|
||||
int k;
|
||||
int c;
|
||||
comcon2(int k, int c)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
@@ -369,9 +357,7 @@ comcon2(k, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comvow2(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comvow2(int v, int c)
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
@@ -408,27 +394,26 @@ comvow2(v, c)
|
||||
}
|
||||
|
||||
int
|
||||
hangul_input_state_get()
|
||||
hangul_input_state_get(void)
|
||||
{
|
||||
return hangul_input_state;
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_state_set(state)
|
||||
int state;
|
||||
hangul_input_state_set(int state)
|
||||
{
|
||||
hangul_input_state = state;
|
||||
hangul_input_clear();
|
||||
}
|
||||
|
||||
int
|
||||
im_get_status()
|
||||
im_get_status(void)
|
||||
{
|
||||
return hangul_input_state_get();
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_state_toggle()
|
||||
hangul_input_state_toggle(void)
|
||||
{
|
||||
if (hangul_input_state_get())
|
||||
{
|
||||
@@ -452,9 +437,7 @@ hangul_input_state_toggle()
|
||||
}
|
||||
|
||||
static int
|
||||
hangul_automata2(buf, c)
|
||||
char_u *buf;
|
||||
int_u *c;
|
||||
hangul_automata2(char_u *buf, int_u *c)
|
||||
{
|
||||
int t,t2;
|
||||
|
||||
@@ -614,9 +597,7 @@ hangul_automata2(buf, c)
|
||||
}
|
||||
|
||||
static int
|
||||
hangul_automata3(buf, c)
|
||||
char_u *buf;
|
||||
int_u *c;
|
||||
hangul_automata3(char_u *buf, int_u *c)
|
||||
{
|
||||
int t, t2;
|
||||
|
||||
@@ -725,7 +706,7 @@ hangul_automata3(buf, c)
|
||||
}
|
||||
|
||||
void
|
||||
hangul_keyboard_set()
|
||||
hangul_keyboard_set(void)
|
||||
{
|
||||
int keyboard;
|
||||
char *s;
|
||||
@@ -746,9 +727,7 @@ hangul_keyboard_set()
|
||||
}
|
||||
|
||||
int
|
||||
hangul_input_process(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
hangul_input_process(char_u *s, int len)
|
||||
{
|
||||
int n;
|
||||
unsigned int c;
|
||||
@@ -831,7 +810,7 @@ hangul_input_process(s, len)
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_clear()
|
||||
hangul_input_clear(void)
|
||||
{
|
||||
sp = 0;
|
||||
f = F_NULL;
|
||||
@@ -1503,11 +1482,11 @@ static const char_u johab_lcon_to_wan[] =
|
||||
};
|
||||
|
||||
static void
|
||||
convert_ks_to_3(src, fp, mp, lp)
|
||||
const char_u *src;
|
||||
int *fp;
|
||||
int *mp;
|
||||
int *lp;
|
||||
convert_ks_to_3(
|
||||
const char_u *src,
|
||||
int *fp,
|
||||
int *mp,
|
||||
int *lp)
|
||||
{
|
||||
int h = *src;
|
||||
int low = *(src + 1);
|
||||
@@ -1539,11 +1518,11 @@ convert_ks_to_3(src, fp, mp, lp)
|
||||
}
|
||||
|
||||
static int
|
||||
convert_3_to_ks(fv, mv, lv, des)
|
||||
int fv;
|
||||
int mv;
|
||||
int lv;
|
||||
char_u *des;
|
||||
convert_3_to_ks(
|
||||
int fv,
|
||||
int mv,
|
||||
int lv,
|
||||
char_u *des)
|
||||
{
|
||||
char_u key[3];
|
||||
register int hi, lo, mi = 0, result, found;
|
||||
@@ -1621,9 +1600,7 @@ convert_3_to_ks(fv, mv, lv, des)
|
||||
}
|
||||
|
||||
char_u *
|
||||
hangul_string_convert(buf, p_len)
|
||||
char_u *buf;
|
||||
int *p_len;
|
||||
hangul_string_convert(char_u *buf, int *p_len)
|
||||
{
|
||||
char_u *tmpbuf = NULL;
|
||||
vimconv_T vc;
|
||||
@@ -1642,8 +1619,7 @@ hangul_string_convert(buf, p_len)
|
||||
}
|
||||
|
||||
char_u *
|
||||
hangul_composing_buffer_get(p_len)
|
||||
int *p_len;
|
||||
hangul_composing_buffer_get(int *p_len)
|
||||
{
|
||||
char_u *tmpbuf = NULL;
|
||||
|
||||
|
||||
+121
-192
@@ -157,7 +157,7 @@ static void prt_get_attr(int hl_id, prt_text_attr_T* pattr, int modec);
|
||||
* Returns an error message or NULL;
|
||||
*/
|
||||
char_u *
|
||||
parse_printoptions()
|
||||
parse_printoptions(void)
|
||||
{
|
||||
return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ parse_printoptions()
|
||||
* Returns an error message or NULL;
|
||||
*/
|
||||
char_u *
|
||||
parse_printmbfont()
|
||||
parse_printmbfont(void)
|
||||
{
|
||||
return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS);
|
||||
}
|
||||
@@ -184,10 +184,10 @@ parse_printmbfont()
|
||||
* Only used for the printer at the moment...
|
||||
*/
|
||||
static char_u *
|
||||
parse_list_options(option_str, table, table_size)
|
||||
char_u *option_str;
|
||||
option_table_T *table;
|
||||
int table_size;
|
||||
parse_list_options(
|
||||
char_u *option_str,
|
||||
option_table_T *table,
|
||||
int table_size)
|
||||
{
|
||||
char_u *stringp;
|
||||
char_u *colonp;
|
||||
@@ -250,8 +250,7 @@ parse_list_options(option_str, table, table_size)
|
||||
* up well on white paper, so reduce their brightness.
|
||||
*/
|
||||
static long_u
|
||||
darken_rgb(rgb)
|
||||
long_u rgb;
|
||||
darken_rgb(long_u rgb)
|
||||
{
|
||||
return ((rgb >> 17) << 16)
|
||||
+ (((rgb & 0xff00) >> 9) << 8)
|
||||
@@ -259,8 +258,7 @@ darken_rgb(rgb)
|
||||
}
|
||||
|
||||
static long_u
|
||||
prt_get_term_color(colorindex)
|
||||
int colorindex;
|
||||
prt_get_term_color(int colorindex)
|
||||
{
|
||||
/* TODO: Should check for xterm with 88 or 256 colors. */
|
||||
if (t_colors > 8)
|
||||
@@ -269,10 +267,10 @@ prt_get_term_color(colorindex)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_get_attr(hl_id, pattr, modec)
|
||||
int hl_id;
|
||||
prt_text_attr_T *pattr;
|
||||
int modec;
|
||||
prt_get_attr(
|
||||
int hl_id,
|
||||
prt_text_attr_T *pattr,
|
||||
int modec)
|
||||
{
|
||||
int colorindex;
|
||||
long_u fg_color;
|
||||
@@ -321,8 +319,7 @@ prt_get_attr(hl_id, pattr, modec)
|
||||
#endif /* FEAT_SYN_HL */
|
||||
|
||||
static void
|
||||
prt_set_fg(fg)
|
||||
long_u fg;
|
||||
prt_set_fg(long_u fg)
|
||||
{
|
||||
if (fg != curr_fg)
|
||||
{
|
||||
@@ -332,8 +329,7 @@ prt_set_fg(fg)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_set_bg(bg)
|
||||
long_u bg;
|
||||
prt_set_bg(long_u bg)
|
||||
{
|
||||
if (bg != curr_bg)
|
||||
{
|
||||
@@ -343,10 +339,7 @@ prt_set_bg(bg)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_set_font(bold, italic, underline)
|
||||
int bold;
|
||||
int italic;
|
||||
int underline;
|
||||
prt_set_font(int bold, int italic, int underline)
|
||||
{
|
||||
if (curr_bold != bold
|
||||
|| curr_italic != italic
|
||||
@@ -363,10 +356,10 @@ prt_set_font(bold, italic, underline)
|
||||
* Print the line number in the left margin.
|
||||
*/
|
||||
static void
|
||||
prt_line_number(psettings, page_line, lnum)
|
||||
prt_settings_T *psettings;
|
||||
int page_line;
|
||||
linenr_T lnum;
|
||||
prt_line_number(
|
||||
prt_settings_T *psettings,
|
||||
int page_line,
|
||||
linenr_T lnum)
|
||||
{
|
||||
int i;
|
||||
char_u tbuf[20];
|
||||
@@ -400,7 +393,7 @@ prt_line_number(psettings, page_line, lnum)
|
||||
* Get the currently effective header height.
|
||||
*/
|
||||
int
|
||||
prt_header_height()
|
||||
prt_header_height(void)
|
||||
{
|
||||
if (printer_opts[OPT_PRINT_HEADERHEIGHT].present)
|
||||
return printer_opts[OPT_PRINT_HEADERHEIGHT].number;
|
||||
@@ -411,7 +404,7 @@ prt_header_height()
|
||||
* Return TRUE if using a line number for printing.
|
||||
*/
|
||||
int
|
||||
prt_use_number()
|
||||
prt_use_number(void)
|
||||
{
|
||||
return (printer_opts[OPT_PRINT_NUMBER].present
|
||||
&& TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y');
|
||||
@@ -422,8 +415,7 @@ prt_use_number()
|
||||
* Returns PRT_UNIT_NONE if not recognized.
|
||||
*/
|
||||
int
|
||||
prt_get_unit(idx)
|
||||
int idx;
|
||||
prt_get_unit(int idx)
|
||||
{
|
||||
int u = PRT_UNIT_NONE;
|
||||
int i;
|
||||
@@ -443,10 +435,10 @@ prt_get_unit(idx)
|
||||
* Print the page header.
|
||||
*/
|
||||
static void
|
||||
prt_header(psettings, pagenum, lnum)
|
||||
prt_settings_T *psettings;
|
||||
int pagenum;
|
||||
linenr_T lnum UNUSED;
|
||||
prt_header(
|
||||
prt_settings_T *psettings,
|
||||
int pagenum,
|
||||
linenr_T lnum UNUSED)
|
||||
{
|
||||
int width = psettings->chars_per_line;
|
||||
int page_line;
|
||||
@@ -549,8 +541,7 @@ prt_header(psettings, pagenum, lnum)
|
||||
* Display a print status message.
|
||||
*/
|
||||
static void
|
||||
prt_message(s)
|
||||
char_u *s;
|
||||
prt_message(char_u *s)
|
||||
{
|
||||
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
||||
screen_puts(s, (int)Rows - 1, 0, hl_attr(HLF_R));
|
||||
@@ -558,8 +549,7 @@ prt_message(s)
|
||||
}
|
||||
|
||||
void
|
||||
ex_hardcopy(eap)
|
||||
exarg_T *eap;
|
||||
ex_hardcopy(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int collated_copies, uncollated_copies;
|
||||
@@ -825,10 +815,10 @@ print_fail_no_begin:
|
||||
* Return the next column to print, or zero if the line is finished.
|
||||
*/
|
||||
static colnr_T
|
||||
hardcopy_line(psettings, page_line, ppos)
|
||||
prt_settings_T *psettings;
|
||||
int page_line;
|
||||
prt_pos_T *ppos;
|
||||
hardcopy_line(
|
||||
prt_settings_T *psettings,
|
||||
int page_line,
|
||||
prt_pos_T *ppos)
|
||||
{
|
||||
colnr_T col;
|
||||
char_u *line;
|
||||
@@ -1458,9 +1448,7 @@ static char_u prt_hexchar[] = "0123456789abcdef";
|
||||
# endif
|
||||
|
||||
static void
|
||||
prt_write_file_raw_len(buffer, bytes)
|
||||
char_u *buffer;
|
||||
int bytes;
|
||||
prt_write_file_raw_len(char_u *buffer, int bytes)
|
||||
{
|
||||
if (!prt_file_error
|
||||
&& fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd)
|
||||
@@ -1472,16 +1460,13 @@ prt_write_file_raw_len(buffer, bytes)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_write_file(buffer)
|
||||
char_u *buffer;
|
||||
prt_write_file(char_u *buffer)
|
||||
{
|
||||
prt_write_file_len(buffer, (int)STRLEN(buffer));
|
||||
}
|
||||
|
||||
static void
|
||||
prt_write_file_len(buffer, bytes)
|
||||
char_u *buffer;
|
||||
int bytes;
|
||||
prt_write_file_len(char_u *buffer, int bytes)
|
||||
{
|
||||
#ifdef EBCDIC
|
||||
ebcdic2ascii(buffer, bytes);
|
||||
@@ -1493,8 +1478,7 @@ prt_write_file_len(buffer, bytes)
|
||||
* Write a string.
|
||||
*/
|
||||
static void
|
||||
prt_write_string(s)
|
||||
char *s;
|
||||
prt_write_string(char *s)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%s", s);
|
||||
prt_write_file(prt_line_buffer);
|
||||
@@ -1504,8 +1488,7 @@ prt_write_string(s)
|
||||
* Write an int and a space.
|
||||
*/
|
||||
static void
|
||||
prt_write_int(i)
|
||||
int i;
|
||||
prt_write_int(int i)
|
||||
{
|
||||
sprintf((char *)prt_line_buffer, "%d ", i);
|
||||
prt_write_file(prt_line_buffer);
|
||||
@@ -1515,8 +1498,7 @@ prt_write_int(i)
|
||||
* Write a boolean and a space.
|
||||
*/
|
||||
static void
|
||||
prt_write_boolean(b)
|
||||
int b;
|
||||
prt_write_boolean(int b)
|
||||
{
|
||||
sprintf((char *)prt_line_buffer, "%s ", (b ? "T" : "F"));
|
||||
prt_write_file(prt_line_buffer);
|
||||
@@ -1526,11 +1508,11 @@ prt_write_boolean(b)
|
||||
* Write PostScript to re-encode and define the font.
|
||||
*/
|
||||
static void
|
||||
prt_def_font(new_name, encoding, height, font)
|
||||
char *new_name;
|
||||
char *encoding;
|
||||
int height;
|
||||
char *font;
|
||||
prt_def_font(
|
||||
char *new_name,
|
||||
char *encoding,
|
||||
int height,
|
||||
char *font)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/_%s /VIM-%s /%s ref\n", new_name, encoding, font);
|
||||
@@ -1551,10 +1533,7 @@ prt_def_font(new_name, encoding, height, font)
|
||||
* Write a line to define the CID font.
|
||||
*/
|
||||
static void
|
||||
prt_def_cidfont(new_name, height, cidfont)
|
||||
char *new_name;
|
||||
int height;
|
||||
char *cidfont;
|
||||
prt_def_cidfont(char *new_name, int height, char *cidfont)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/_%s /%s[/%s] vim_composefont\n", new_name, prt_cmap, cidfont);
|
||||
@@ -1568,9 +1547,7 @@ prt_def_cidfont(new_name, height, cidfont)
|
||||
* Write a line to define a duplicate of a CID font
|
||||
*/
|
||||
static void
|
||||
prt_dup_cidfont(original_name, new_name)
|
||||
char *original_name;
|
||||
char *new_name;
|
||||
prt_dup_cidfont(char *original_name, char *new_name)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/%s %s d\n", new_name, original_name);
|
||||
@@ -1584,11 +1561,11 @@ prt_dup_cidfont(original_name, new_name)
|
||||
* is also rounded based on the precision + 1'th fractional digit.
|
||||
*/
|
||||
static void
|
||||
prt_real_bits(real, precision, pinteger, pfraction)
|
||||
double real;
|
||||
int precision;
|
||||
int *pinteger;
|
||||
int *pfraction;
|
||||
prt_real_bits(
|
||||
double real,
|
||||
int precision,
|
||||
int *pinteger,
|
||||
int *pfraction)
|
||||
{
|
||||
int i;
|
||||
int integer;
|
||||
@@ -1611,9 +1588,7 @@ prt_real_bits(real, precision, pinteger, pfraction)
|
||||
* what decimal point character to use, but PS always requires a '.'.
|
||||
*/
|
||||
static void
|
||||
prt_write_real(val, prec)
|
||||
double val;
|
||||
int prec;
|
||||
prt_write_real(double val, int prec)
|
||||
{
|
||||
int integer;
|
||||
int fraction;
|
||||
@@ -1643,10 +1618,7 @@ prt_write_real(val, prec)
|
||||
* Write a line to define a numeric variable.
|
||||
*/
|
||||
static void
|
||||
prt_def_var(name, value, prec)
|
||||
char *name;
|
||||
double value;
|
||||
int prec;
|
||||
prt_def_var(char *name, double value, int prec)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/%s ", name);
|
||||
@@ -1660,7 +1632,7 @@ prt_def_var(name, value, prec)
|
||||
#define PRT_PS_FONT_TO_USER(scale, size) ((size) * ((scale)/1000.0))
|
||||
|
||||
static void
|
||||
prt_flush_buffer()
|
||||
prt_flush_buffer(void)
|
||||
{
|
||||
if (prt_ps_buffer.ga_len > 0)
|
||||
{
|
||||
@@ -1742,9 +1714,7 @@ prt_flush_buffer()
|
||||
|
||||
|
||||
static void
|
||||
prt_resource_name(filename, cookie)
|
||||
char_u *filename;
|
||||
void *cookie;
|
||||
prt_resource_name(char_u *filename, void *cookie)
|
||||
{
|
||||
char_u *resource_filename = cookie;
|
||||
|
||||
@@ -1755,9 +1725,7 @@ prt_resource_name(filename, cookie)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_find_resource(name, resource)
|
||||
char *name;
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_find_resource(char *name, struct prt_ps_resource_S *resource)
|
||||
{
|
||||
char_u *buffer;
|
||||
int retval;
|
||||
@@ -1798,7 +1766,7 @@ struct prt_resfile_buffer_S
|
||||
static struct prt_resfile_buffer_S prt_resfile;
|
||||
|
||||
static int
|
||||
prt_resfile_next_line()
|
||||
prt_resfile_next_line(void)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -1824,10 +1792,7 @@ prt_resfile_next_line()
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_strncmp(offset, string, len)
|
||||
int offset;
|
||||
char *string;
|
||||
int len;
|
||||
prt_resfile_strncmp(int offset, char *string, int len)
|
||||
{
|
||||
/* Force not equal if string is longer than remainder of line */
|
||||
if (len > (prt_resfile.line_end - (prt_resfile.line_start + offset)))
|
||||
@@ -1838,8 +1803,7 @@ prt_resfile_strncmp(offset, string, len)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_skip_nonws(offset)
|
||||
int offset;
|
||||
prt_resfile_skip_nonws(int offset)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -1854,8 +1818,7 @@ prt_resfile_skip_nonws(offset)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_skip_ws(offset)
|
||||
int offset;
|
||||
prt_resfile_skip_ws(int offset)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -1872,8 +1835,7 @@ prt_resfile_skip_ws(offset)
|
||||
/* prt_next_dsc() - returns detail on next DSC comment line found. Returns true
|
||||
* if a DSC comment is found, else false */
|
||||
static int
|
||||
prt_next_dsc(p_dsc_line)
|
||||
struct prt_dsc_line_S *p_dsc_line;
|
||||
prt_next_dsc(struct prt_dsc_line_S *p_dsc_line)
|
||||
{
|
||||
int comment;
|
||||
int offset;
|
||||
@@ -1922,8 +1884,7 @@ prt_next_dsc(p_dsc_line)
|
||||
* PS resource file so the file details can be added to the DSC header comments.
|
||||
*/
|
||||
static int
|
||||
prt_open_resource(resource)
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_open_resource(struct prt_ps_resource_S *resource)
|
||||
{
|
||||
int offset;
|
||||
int seen_all;
|
||||
@@ -2048,9 +2009,7 @@ prt_open_resource(resource)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_check_resource(resource, version)
|
||||
struct prt_ps_resource_S *resource;
|
||||
char_u *version;
|
||||
prt_check_resource(struct prt_ps_resource_S *resource, char_u *version)
|
||||
{
|
||||
/* Version number m.n should match, the revision number does not matter */
|
||||
if (STRNCMP(resource->version, version, STRLEN(version)))
|
||||
@@ -2065,14 +2024,13 @@ prt_check_resource(resource, version)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_start()
|
||||
prt_dsc_start(void)
|
||||
{
|
||||
prt_write_string("%!PS-Adobe-3.0\n");
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_noarg(comment)
|
||||
char *comment;
|
||||
prt_dsc_noarg(char *comment)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%%s\n", comment);
|
||||
@@ -2080,9 +2038,7 @@ prt_dsc_noarg(comment)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_textline(comment, text)
|
||||
char *comment;
|
||||
char *text;
|
||||
prt_dsc_textline(char *comment, char *text)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%%s: %s\n", comment, text);
|
||||
@@ -2090,9 +2046,7 @@ prt_dsc_textline(comment, text)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_text(comment, text)
|
||||
char *comment;
|
||||
char *text;
|
||||
prt_dsc_text(char *comment, char *text)
|
||||
{
|
||||
/* TODO - should scan 'text' for any chars needing escaping! */
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
@@ -2103,10 +2057,7 @@ prt_dsc_text(comment, text)
|
||||
#define prt_dsc_atend(c) prt_dsc_text((c), "atend")
|
||||
|
||||
static void
|
||||
prt_dsc_ints(comment, count, ints)
|
||||
char *comment;
|
||||
int count;
|
||||
int *ints;
|
||||
prt_dsc_ints(char *comment, int count, int *ints)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2124,10 +2075,10 @@ prt_dsc_ints(comment, count, ints)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_resources(comment, type, string)
|
||||
char *comment; /* if NULL add to previous */
|
||||
char *type;
|
||||
char *string;
|
||||
prt_dsc_resources(
|
||||
char *comment, /* if NULL add to previous */
|
||||
char *type,
|
||||
char *string)
|
||||
{
|
||||
if (comment != NULL)
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
@@ -2143,9 +2094,7 @@ prt_dsc_resources(comment, type, string)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_font_resource(resource, ps_font)
|
||||
char *resource;
|
||||
struct prt_ps_font_S *ps_font;
|
||||
prt_dsc_font_resource(char *resource, struct prt_ps_font_S *ps_font)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2157,12 +2106,12 @@ prt_dsc_font_resource(resource, ps_font)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_requirements(duplex, tumble, collate, color, num_copies)
|
||||
int duplex;
|
||||
int tumble;
|
||||
int collate;
|
||||
int color;
|
||||
int num_copies;
|
||||
prt_dsc_requirements(
|
||||
int duplex,
|
||||
int tumble,
|
||||
int collate,
|
||||
int color,
|
||||
int num_copies)
|
||||
{
|
||||
/* Only output the comment if we need to.
|
||||
* Note: tumble is ignored if we are not duplexing
|
||||
@@ -2195,13 +2144,13 @@ prt_dsc_requirements(duplex, tumble, collate, color, num_copies)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_docmedia(paper_name, width, height, weight, colour, type)
|
||||
char *paper_name;
|
||||
double width;
|
||||
double height;
|
||||
double weight;
|
||||
char *colour;
|
||||
char *type;
|
||||
prt_dsc_docmedia(
|
||||
char *paper_name,
|
||||
double width,
|
||||
double height,
|
||||
double weight,
|
||||
char *colour,
|
||||
char *type)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%DocumentMedia: %s ", paper_name);
|
||||
@@ -2222,7 +2171,7 @@ prt_dsc_docmedia(paper_name, width, height, weight, colour, type)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_cleanup()
|
||||
mch_print_cleanup(void)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (prt_out_mbyte)
|
||||
@@ -2261,10 +2210,7 @@ mch_print_cleanup()
|
||||
}
|
||||
|
||||
static float
|
||||
to_device_units(idx, physsize, def_number)
|
||||
int idx;
|
||||
double physsize;
|
||||
int def_number;
|
||||
to_device_units(int idx, double physsize, int def_number)
|
||||
{
|
||||
float ret;
|
||||
int u;
|
||||
@@ -2303,13 +2249,13 @@ to_device_units(idx, physsize, def_number)
|
||||
* Calculate margins for given width and height from printoptions settings.
|
||||
*/
|
||||
static void
|
||||
prt_page_margins(width, height, left, right, top, bottom)
|
||||
double width;
|
||||
double height;
|
||||
double *left;
|
||||
double *right;
|
||||
double *top;
|
||||
double *bottom;
|
||||
prt_page_margins(
|
||||
double width,
|
||||
double height,
|
||||
double *left,
|
||||
double *right,
|
||||
double *top,
|
||||
double *bottom)
|
||||
{
|
||||
*left = to_device_units(OPT_PRINT_LEFT, width, 10);
|
||||
*right = width - to_device_units(OPT_PRINT_RIGHT, width, 5);
|
||||
@@ -2318,8 +2264,7 @@ prt_page_margins(width, height, left, right, top, bottom)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_font_metrics(font_scale)
|
||||
int font_scale;
|
||||
prt_font_metrics(int font_scale)
|
||||
{
|
||||
prt_line_height = (float)font_scale;
|
||||
prt_char_width = (float)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx);
|
||||
@@ -2327,7 +2272,7 @@ prt_font_metrics(font_scale)
|
||||
|
||||
|
||||
static int
|
||||
prt_get_cpl()
|
||||
prt_get_cpl(void)
|
||||
{
|
||||
if (prt_use_number())
|
||||
{
|
||||
@@ -2349,10 +2294,7 @@ prt_get_cpl()
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
static int
|
||||
prt_build_cid_fontname(font, name, name_len)
|
||||
int font;
|
||||
char_u *name;
|
||||
int name_len;
|
||||
prt_build_cid_fontname(int font, char_u *name, int name_len)
|
||||
{
|
||||
char *fontname;
|
||||
|
||||
@@ -2370,7 +2312,7 @@ prt_build_cid_fontname(font, name, name_len)
|
||||
* Get number of lines of text that fit on a page (excluding the header).
|
||||
*/
|
||||
static int
|
||||
prt_get_lpp()
|
||||
prt_get_lpp(void)
|
||||
{
|
||||
int lpp;
|
||||
|
||||
@@ -2402,10 +2344,10 @@ prt_get_lpp()
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
static int
|
||||
prt_match_encoding(p_encoding, p_cmap, pp_mbenc)
|
||||
char *p_encoding;
|
||||
struct prt_ps_mbfont_S *p_cmap;
|
||||
struct prt_ps_encoding_S **pp_mbenc;
|
||||
prt_match_encoding(
|
||||
char *p_encoding,
|
||||
struct prt_ps_mbfont_S *p_cmap,
|
||||
struct prt_ps_encoding_S **pp_mbenc)
|
||||
{
|
||||
int mbenc;
|
||||
int enc_len;
|
||||
@@ -2428,10 +2370,10 @@ prt_match_encoding(p_encoding, p_cmap, pp_mbenc)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_match_charset(p_charset, p_cmap, pp_mbchar)
|
||||
char *p_charset;
|
||||
struct prt_ps_mbfont_S *p_cmap;
|
||||
struct prt_ps_charset_S **pp_mbchar;
|
||||
prt_match_charset(
|
||||
char *p_charset,
|
||||
struct prt_ps_mbfont_S *p_cmap,
|
||||
struct prt_ps_charset_S **pp_mbchar)
|
||||
{
|
||||
int mbchar;
|
||||
int char_len;
|
||||
@@ -2456,10 +2398,10 @@ prt_match_charset(p_charset, p_cmap, pp_mbchar)
|
||||
#endif
|
||||
|
||||
int
|
||||
mch_print_init(psettings, jobname, forceit)
|
||||
prt_settings_T *psettings;
|
||||
char_u *jobname;
|
||||
int forceit UNUSED;
|
||||
mch_print_init(
|
||||
prt_settings_T *psettings,
|
||||
char_u *jobname,
|
||||
int forceit UNUSED)
|
||||
{
|
||||
int i;
|
||||
char *paper_name;
|
||||
@@ -2805,8 +2747,7 @@ mch_print_init(psettings, jobname, forceit)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_add_resource(resource)
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_add_resource(struct prt_ps_resource_S *resource)
|
||||
{
|
||||
FILE* fd_resource;
|
||||
char_u resource_buffer[512];
|
||||
@@ -2853,8 +2794,7 @@ prt_add_resource(resource)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_begin(psettings)
|
||||
prt_settings_T *psettings;
|
||||
mch_print_begin(prt_settings_T *psettings)
|
||||
{
|
||||
time_t now;
|
||||
int bbox[4];
|
||||
@@ -3295,8 +3235,7 @@ theend:
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_end(psettings)
|
||||
prt_settings_T *psettings;
|
||||
mch_print_end(prt_settings_T *psettings)
|
||||
{
|
||||
prt_dsc_noarg("Trailer");
|
||||
|
||||
@@ -3333,7 +3272,7 @@ mch_print_end(psettings)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_end_page()
|
||||
mch_print_end_page(void)
|
||||
{
|
||||
prt_flush_buffer();
|
||||
|
||||
@@ -3345,8 +3284,7 @@ mch_print_end_page()
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_begin_page(str)
|
||||
char_u *str UNUSED;
|
||||
mch_print_begin_page(char_u *str UNUSED)
|
||||
{
|
||||
int page_num[2];
|
||||
|
||||
@@ -3387,7 +3325,7 @@ mch_print_begin_page(str)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_blank_page()
|
||||
mch_print_blank_page(void)
|
||||
{
|
||||
return (mch_print_begin_page(NULL) ? (mch_print_end_page()) : FALSE);
|
||||
}
|
||||
@@ -3396,9 +3334,7 @@ static float prt_pos_x = 0;
|
||||
static float prt_pos_y = 0;
|
||||
|
||||
void
|
||||
mch_print_start_line(margin, page_line)
|
||||
int margin;
|
||||
int page_line;
|
||||
mch_print_start_line(int margin, int page_line)
|
||||
{
|
||||
prt_pos_x = prt_left_margin;
|
||||
if (margin)
|
||||
@@ -3415,9 +3351,7 @@ mch_print_start_line(margin, page_line)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_text_out(p, len)
|
||||
char_u *p;
|
||||
int len UNUSED;
|
||||
mch_print_text_out(char_u *p, int len UNUSED)
|
||||
{
|
||||
int need_break;
|
||||
char_u ch;
|
||||
@@ -3638,10 +3572,7 @@ mch_print_text_out(p, len)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_font(iBold, iItalic, iUnderline)
|
||||
int iBold;
|
||||
int iItalic;
|
||||
int iUnderline;
|
||||
mch_print_set_font(int iBold, int iItalic, int iUnderline)
|
||||
{
|
||||
int font = 0;
|
||||
|
||||
@@ -3665,8 +3596,7 @@ mch_print_set_font(iBold, iItalic, iUnderline)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_bg(bgcol)
|
||||
long_u bgcol;
|
||||
mch_print_set_bg(long_u bgcol)
|
||||
{
|
||||
prt_bgcol = (int)bgcol;
|
||||
prt_attribute_change = TRUE;
|
||||
@@ -3674,8 +3604,7 @@ mch_print_set_bg(bgcol)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_fg(fgcol)
|
||||
long_u fgcol;
|
||||
mch_print_set_fg(long_u fgcol)
|
||||
{
|
||||
if (fgcol != (long_u)prt_fgcol)
|
||||
{
|
||||
|
||||
+22
-42
@@ -49,7 +49,7 @@ static int hash_may_resize(hashtab_T *ht, int minitems);
|
||||
* Returns NULL when out of memory.
|
||||
*/
|
||||
hashtab_T *
|
||||
hash_create()
|
||||
hash_create(void)
|
||||
{
|
||||
hashtab_T *ht;
|
||||
|
||||
@@ -64,8 +64,7 @@ hash_create()
|
||||
* Initialize an empty hash table.
|
||||
*/
|
||||
void
|
||||
hash_init(ht)
|
||||
hashtab_T *ht;
|
||||
hash_init(hashtab_T *ht)
|
||||
{
|
||||
/* This zeroes all "ht_" entries and all the "hi_key" in "ht_smallarray". */
|
||||
vim_memset(ht, 0, sizeof(hashtab_T));
|
||||
@@ -78,8 +77,7 @@ hash_init(ht)
|
||||
* If "ht" is not freed then you should call hash_init() next!
|
||||
*/
|
||||
void
|
||||
hash_clear(ht)
|
||||
hashtab_T *ht;
|
||||
hash_clear(hashtab_T *ht)
|
||||
{
|
||||
if (ht->ht_array != ht->ht_smallarray)
|
||||
vim_free(ht->ht_array);
|
||||
@@ -91,9 +89,7 @@ hash_clear(ht)
|
||||
* memory to the location of the key (it's always positive).
|
||||
*/
|
||||
void
|
||||
hash_clear_all(ht, off)
|
||||
hashtab_T *ht;
|
||||
int off;
|
||||
hash_clear_all(hashtab_T *ht, int off)
|
||||
{
|
||||
long todo;
|
||||
hashitem_T *hi;
|
||||
@@ -119,9 +115,7 @@ hash_clear_all(ht, off)
|
||||
* (adding, setting or removing an item)!
|
||||
*/
|
||||
hashitem_T *
|
||||
hash_find(ht, key)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_find(hashtab_T *ht, char_u *key)
|
||||
{
|
||||
return hash_lookup(ht, key, hash_hash(key));
|
||||
}
|
||||
@@ -130,10 +124,7 @@ hash_find(ht, key)
|
||||
* Like hash_find(), but caller computes "hash".
|
||||
*/
|
||||
hashitem_T *
|
||||
hash_lookup(ht, key, hash)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_T hash;
|
||||
hash_lookup(hashtab_T *ht, char_u *key, hash_T hash)
|
||||
{
|
||||
hash_T perturb;
|
||||
hashitem_T *freeitem;
|
||||
@@ -195,7 +186,7 @@ hash_lookup(ht, key, hash)
|
||||
* Called when exiting.
|
||||
*/
|
||||
void
|
||||
hash_debug_results()
|
||||
hash_debug_results(void)
|
||||
{
|
||||
#ifdef HT_DEBUG
|
||||
fprintf(stderr, "\r\n\r\n\r\n\r\n");
|
||||
@@ -211,9 +202,7 @@ hash_debug_results()
|
||||
* Returns FAIL when out of memory or the key is already present.
|
||||
*/
|
||||
int
|
||||
hash_add(ht, key)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_add(hashtab_T *ht, char_u *key)
|
||||
{
|
||||
hash_T hash = hash_hash(key);
|
||||
hashitem_T *hi;
|
||||
@@ -234,11 +223,11 @@ hash_add(ht, key)
|
||||
* Returns OK or FAIL (out of memory).
|
||||
*/
|
||||
int
|
||||
hash_add_item(ht, hi, key, hash)
|
||||
hashtab_T *ht;
|
||||
hashitem_T *hi;
|
||||
char_u *key;
|
||||
hash_T hash;
|
||||
hash_add_item(
|
||||
hashtab_T *ht,
|
||||
hashitem_T *hi,
|
||||
char_u *key,
|
||||
hash_T hash)
|
||||
{
|
||||
/* If resizing failed before and it fails again we can't add an item. */
|
||||
if (ht->ht_error && hash_may_resize(ht, 0) == FAIL)
|
||||
@@ -265,9 +254,7 @@ hash_add_item(ht, hi, key, hash)
|
||||
* "hi" is invalid after this!
|
||||
*/
|
||||
void
|
||||
hash_set(hi, key)
|
||||
hashitem_T *hi;
|
||||
char_u *key;
|
||||
hash_set(hashitem_T *hi, char_u *key)
|
||||
{
|
||||
hi->hi_key = key;
|
||||
}
|
||||
@@ -279,9 +266,7 @@ hash_set(hi, key)
|
||||
* The caller must take care of freeing the item itself.
|
||||
*/
|
||||
void
|
||||
hash_remove(ht, hi)
|
||||
hashtab_T *ht;
|
||||
hashitem_T *hi;
|
||||
hash_remove(hashtab_T *ht, hashitem_T *hi)
|
||||
{
|
||||
--ht->ht_used;
|
||||
hi->hi_key = HI_KEY_REMOVED;
|
||||
@@ -294,8 +279,7 @@ hash_remove(ht, hi)
|
||||
* Must call hash_unlock() later.
|
||||
*/
|
||||
void
|
||||
hash_lock(ht)
|
||||
hashtab_T *ht;
|
||||
hash_lock(hashtab_T *ht)
|
||||
{
|
||||
++ht->ht_locked;
|
||||
}
|
||||
@@ -307,9 +291,7 @@ hash_lock(ht)
|
||||
* Must call hash_unlock() later.
|
||||
*/
|
||||
void
|
||||
hash_lock_size(ht, size)
|
||||
hashtab_T *ht;
|
||||
int size;
|
||||
hash_lock_size(hashtab_T *ht, int size)
|
||||
{
|
||||
(void)hash_may_resize(ht, size);
|
||||
++ht->ht_locked;
|
||||
@@ -322,8 +304,7 @@ hash_lock_size(ht, size)
|
||||
* This must balance a call to hash_lock().
|
||||
*/
|
||||
void
|
||||
hash_unlock(ht)
|
||||
hashtab_T *ht;
|
||||
hash_unlock(hashtab_T *ht)
|
||||
{
|
||||
--ht->ht_locked;
|
||||
(void)hash_may_resize(ht, 0);
|
||||
@@ -335,9 +316,9 @@ hash_unlock(ht)
|
||||
* Returns OK or FAIL (out of memory).
|
||||
*/
|
||||
static int
|
||||
hash_may_resize(ht, minitems)
|
||||
hashtab_T *ht;
|
||||
int minitems; /* minimal number of items */
|
||||
hash_may_resize(
|
||||
hashtab_T *ht,
|
||||
int minitems) /* minimal number of items */
|
||||
{
|
||||
hashitem_T temparray[HT_INIT_SIZE];
|
||||
hashitem_T *oldarray, *newarray;
|
||||
@@ -481,8 +462,7 @@ hash_may_resize(ht, minitems)
|
||||
* lower the percentage the better.
|
||||
*/
|
||||
hash_T
|
||||
hash_hash(key)
|
||||
char_u *key;
|
||||
hash_hash(char_u *key)
|
||||
{
|
||||
hash_T hash;
|
||||
char_u *p;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user