mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 = ""
|
||||
|
||||
@@ -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 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -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.
|
||||
|
||||
+106
-43
@@ -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 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -11,7 +11,7 @@ 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*
|
||||
|
||||
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|
|
||||
@@ -32,13 +32,13 @@ $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 handle = 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(handle, '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 +48,93 @@ 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)
|
||||
echo "from the handler: " . a:msg
|
||||
endfunc
|
||||
call sendexpr(handle, 'hello!', "MyHandler")
|
||||
call ch_sendexpr(handle, 'hello!', "MyHandler")
|
||||
|
||||
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(handle)
|
||||
let handle = ch_open('localhost:8765', {'callback': "MyHandler"})
|
||||
call ch_sendexpr(handle, 'hello!', 0)
|
||||
|
||||
==============================================================================
|
||||
2. Opening a channel *channel-open*
|
||||
|
||||
To open a channel:
|
||||
let handle = connect({address}, {mode}, {callback})
|
||||
To open a channel: >
|
||||
let handle = ch_open({address} [, {argdict}])
|
||||
|
||||
{address} has the form "hostname:port". E.g., "localhost:8765".
|
||||
|
||||
{mode} can be: *channel-mode*
|
||||
"json" - Use JSON, see below; most convenient way
|
||||
{argdict} is a dictionary with optional entries:
|
||||
|
||||
"mode" can be: *channel-mode*
|
||||
"json" - Use JSON, see below; most convenient way. Default.
|
||||
"raw" - Use raw messages
|
||||
|
||||
*channel-callback*
|
||||
{callback} is a function that is called when a message is received that is not
|
||||
"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)
|
||||
echo 'Received: ' . a:msg
|
||||
endfunc
|
||||
let handle = connect("localhost:8765", 'json', "Handle")
|
||||
let handle = ch_open("localhost:8765", 'json', "Handle")
|
||||
|
||||
When {mode} is "json" the "msg" argument is the body of the received message,
|
||||
"waittime" is 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.
|
||||
|
||||
"timeout" is the time to wait for a request when blocking, using
|
||||
ch_sendexpr(). Again in millisecons. The default si 2000 (2 seconds).
|
||||
|
||||
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.
|
||||
When "mode" is "raw" the "msg" argument is the whole message as a string.
|
||||
|
||||
When {mode} is "json" the {callback} is optional. When omitted it is only
|
||||
When "mode" is "json" the "callback" is optional. When omitted it is only
|
||||
possible to receive a message after sending one.
|
||||
|
||||
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.
|
||||
call ch_setcallback(handle, {callback})
|
||||
When "callback is empty (zero or an empty string) the handler is removed.
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
The timeout can be changed later: >
|
||||
call ch_settimeout(handle, {msec})
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
Once done with the channel, disconnect it like this: >
|
||||
call disconnect(handle)
|
||||
call ch_close(handle)
|
||||
|
||||
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.
|
||||
*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*
|
||||
|
||||
If {mode} is "json" then a message can be sent synchronously like this: >
|
||||
let response = sendexpr(handle, {expr})
|
||||
let response = ch_sendexpr(handle, {expr})
|
||||
This awaits a response from the other side.
|
||||
|
||||
To send a message, without handling a response: >
|
||||
call sendexpr(handle, {expr}, 0)
|
||||
call ch_sendexpr(handle, {expr}, 0)
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call sendexpr(handle, {expr}, {callback})
|
||||
call ch_sendexpr(handle, {expr}, {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,60 +162,101 @@ 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.
|
||||
|
||||
==============================================================================
|
||||
4. Vim commands *channel-commands*
|
||||
|
||||
NOT IMPLEMENTED YET
|
||||
PARTLY IMPLEMENTED: only "ex" and "normal" work
|
||||
|
||||
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 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*
|
||||
|
||||
If {mode} is "raw" then a message can be send like this: >
|
||||
let response = sendraw(handle, {string})
|
||||
let response = ch_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.
|
||||
|
||||
To send a message, without expecting a response: >
|
||||
call sendraw(handle, {string}, 0)
|
||||
call ch_sendraw(handle, {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(handle, {string}, {callback})
|
||||
|
||||
This {string} can also be JSON, use |jsonencode()| to create it and
|
||||
|jsondecode()| to handle a received JSON message.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1468,6 +1468,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
|
||||
|
||||
+43
-30
@@ -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 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1810,6 +1810,12 @@ 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_open( {address} [, {argdict})] Number open a channel to {address}
|
||||
ch_sendexpr( {handle}, {expr} [, {callback}])
|
||||
any send {expr} over JSON channel {handle}
|
||||
ch_sendraw( {handle}, {string} [, {callback}])
|
||||
any send {string} over raw 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 +1826,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}
|
||||
@@ -2029,10 +2033,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
|
||||
@@ -2666,17 +2666,47 @@ 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|.
|
||||
|
||||
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 |Directory|. The optional
|
||||
items are:
|
||||
mode "raw" 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.
|
||||
timeout Specify response read timeout value as
|
||||
milliseconds.
|
||||
Default: 2000.
|
||||
|
||||
{callback} is a function that handles received messages on the
|
||||
channel. See |channel-callback|.
|
||||
ch_sendexpr({handle}, {expr} [, {callback}]) *ch_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|.
|
||||
|
||||
ch_sendraw({handle}, {string} [, {callback}]) *ch_sendraw()*
|
||||
Send {string} over raw channel {handle}. See |channel-raw|.
|
||||
Works like |ch_sendexpr()|, but does not decode the response.
|
||||
|
||||
*copy()*
|
||||
copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
|
||||
@@ -5613,23 +5643,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>").
|
||||
@@ -7053,7 +7066,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|.
|
||||
|
||||
@@ -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 01
|
||||
|
||||
|
||||
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
|
||||
@@ -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,
|
||||
|
||||
+17
-5
@@ -4184,8 +4184,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,7 +4473,17 @@ 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*
|
||||
E91 options.txt /*E91*
|
||||
E92 message.txt /*E92*
|
||||
E93 windows.txt /*E93*
|
||||
@@ -5198,6 +5208,10 @@ 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_open() eval.txt /*ch_open()*
|
||||
ch_sendexpr() eval.txt /*ch_sendexpr()*
|
||||
ch_sendraw() eval.txt /*ch_sendraw()*
|
||||
change-list-jumps motion.txt /*change-list-jumps*
|
||||
change-name tips.txt /*change-name*
|
||||
change-tabs change.txt /*change-tabs*
|
||||
@@ -5366,7 +5380,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*
|
||||
@@ -8001,8 +8014,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 +8626,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()*
|
||||
|
||||
+77
-24
@@ -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 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -75,18 +75,41 @@ 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.
|
||||
Patch by Christian, 2016 Jan 29.
|
||||
|
||||
+channel:
|
||||
- use a timeout for connect()
|
||||
Patch from Yasuhiro Matsumoto, Feb 2
|
||||
Change connect() second argument to a dict with items:
|
||||
mode
|
||||
timeout
|
||||
callback
|
||||
- When receiving malformed json starting with a quote it doesn't get
|
||||
discarded.
|
||||
- add ch_setcallback()
|
||||
- add ch_settimeout()
|
||||
- cleanup on exit? in mch_getout() and getout().
|
||||
- more contents in channel.txt
|
||||
- Add more contents to channel.txt
|
||||
- implement debug log
|
||||
- implement job control:
|
||||
let job = job_start('command', {options})
|
||||
call job_stop(job)
|
||||
let job = job_maystart('command', {address}, {options})
|
||||
options:
|
||||
- keep running when Vim exits
|
||||
- add remark undo sync, is there a way to force it?
|
||||
- Add a test with a server that can send canned responses.
|
||||
- Add more testing in json_test.c
|
||||
- make sure errors lead to a useful error msg. ["ex","foobar"]
|
||||
- set timeout for channel.
|
||||
- implement check for ID in response.
|
||||
- json: implement UTF-16 surrogate pair.
|
||||
|
||||
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 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
|
||||
@@ -95,7 +118,21 @@ This difference is unexpected:
|
||||
0
|
||||
It's because tv_equal() works different.
|
||||
|
||||
Do we need to roll-back patch 1165, that put libintl-8.dll before libintl.dll?
|
||||
Allow for an empty dictionary key.
|
||||
|
||||
Patch to put undo options together in undo window.
|
||||
(Gary Johnson, 2016 Jan 28)
|
||||
|
||||
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
|
||||
has tests)
|
||||
|
||||
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 +143,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 +157,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 +174,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 +210,13 @@ 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
|
||||
|
||||
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 +224,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().
|
||||
@@ -225,6 +280,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 +320,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 +464,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
|
||||
@@ -456,6 +511,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 +600,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)
|
||||
|
||||
|
||||
@@ -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 02
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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 Jan 31
|
||||
|
||||
|
||||
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>|
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+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>96</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -1294,7 +1294,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
+730
-240
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;
|
||||
|
||||
+224
-288
File diff suppressed because it is too large
Load Diff
+1189
-2134
File diff suppressed because it is too large
Load Diff
+157
-227
@@ -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 */
|
||||
@@ -3982,8 +3946,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 +3961,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 +4105,7 @@ ex_append(eap)
|
||||
* ":change"
|
||||
*/
|
||||
void
|
||||
ex_change(eap)
|
||||
exarg_T *eap;
|
||||
ex_change(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
|
||||
@@ -4173,8 +4134,7 @@ ex_change(eap)
|
||||
}
|
||||
|
||||
void
|
||||
ex_z(eap)
|
||||
exarg_T *eap;
|
||||
ex_z(exarg_T *eap)
|
||||
{
|
||||
char_u *x;
|
||||
int bigness;
|
||||
@@ -4304,7 +4264,7 @@ ex_z(eap)
|
||||
* Otherwise, return FALSE.
|
||||
*/
|
||||
int
|
||||
check_restricted()
|
||||
check_restricted(void)
|
||||
{
|
||||
if (restricted)
|
||||
{
|
||||
@@ -4320,7 +4280,7 @@ check_restricted()
|
||||
* Otherwise, return FALSE.
|
||||
*/
|
||||
int
|
||||
check_secure()
|
||||
check_secure(void)
|
||||
{
|
||||
if (secure)
|
||||
{
|
||||
@@ -4355,8 +4315,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 +5393,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 +5453,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 +5573,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 +5630,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 +5640,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 +5652,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 +5664,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 +5714,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 +5931,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 +5954,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 +5980,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 +6024,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 +6041,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 +6249,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 +6317,7 @@ prepare_help_buffer()
|
||||
* highlighting is not used.
|
||||
*/
|
||||
void
|
||||
fix_help_buffer()
|
||||
fix_help_buffer(void)
|
||||
{
|
||||
linenr_T lnum;
|
||||
char_u *line;
|
||||
@@ -6610,8 +6559,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 +6568,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 +6703,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 +6957,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 +7008,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 +7027,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 +7433,7 @@ ex_sign(eap)
|
||||
* signs before it starts.
|
||||
*/
|
||||
void
|
||||
sign_gui_started()
|
||||
sign_gui_started(void)
|
||||
{
|
||||
sign_T *sp;
|
||||
|
||||
@@ -7504,8 +7447,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 +7492,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 +7516,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 +7543,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 +7555,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 +7571,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 +7586,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 +7608,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 +7654,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 +7774,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 +7801,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;
|
||||
|
||||
+145
-252
File diff suppressed because it is too large
Load Diff
+324
-542
File diff suppressed because it is too large
Load Diff
+53
-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;
|
||||
@@ -1657,8 +1625,7 @@ ex_catch(eap)
|
||||
* ":finally"
|
||||
*/
|
||||
void
|
||||
ex_finally(eap)
|
||||
exarg_T *eap;
|
||||
ex_finally(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
int skip = FALSE;
|
||||
@@ -1785,8 +1752,7 @@ ex_finally(eap)
|
||||
* ":endtry"
|
||||
*/
|
||||
void
|
||||
ex_endtry(eap)
|
||||
exarg_T *eap;
|
||||
ex_endtry(exarg_T *eap)
|
||||
{
|
||||
int idx;
|
||||
int skip;
|
||||
@@ -1984,8 +1950,7 @@ ex_endtry(eap)
|
||||
* execution.
|
||||
*/
|
||||
void
|
||||
enter_cleanup(csp)
|
||||
cleanup_T *csp;
|
||||
enter_cleanup(cleanup_T *csp)
|
||||
{
|
||||
int pending = CSTP_NONE;
|
||||
|
||||
@@ -2047,8 +2012,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 +2097,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 +2220,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 +2238,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 +2258,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 +2267,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;
|
||||
|
||||
|
||||
+187
-251
@@ -156,10 +156,10 @@ sort_func_compare(const void *s1, const void *s2);
|
||||
* otherwise.
|
||||
*/
|
||||
char_u *
|
||||
getcmdline(firstc, count, indent)
|
||||
int firstc;
|
||||
long count UNUSED; /* only used for incremental search */
|
||||
int indent; /* indent for inside conditionals */
|
||||
getcmdline(
|
||||
int firstc,
|
||||
long count UNUSED, /* only used for incremental search */
|
||||
int indent) /* indent for inside conditionals */
|
||||
{
|
||||
int c;
|
||||
int i;
|
||||
@@ -1129,10 +1129,7 @@ getcmdline(firstc, count, indent)
|
||||
/* In exmode it doesn't make sense to return. Except when
|
||||
* ":normal" runs out of characters. */
|
||||
if (exmode_active
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
&& (ex_normal_busy == 0 || typebuf.tb_len > 0)
|
||||
#endif
|
||||
)
|
||||
&& (ex_normal_busy == 0 || typebuf.tb_len > 0))
|
||||
goto cmdline_not_changed;
|
||||
|
||||
gotesc = TRUE; /* will free ccline.cmdbuff after
|
||||
@@ -1996,12 +1993,12 @@ returncmd:
|
||||
* Returns the command line in allocated memory, or NULL.
|
||||
*/
|
||||
char_u *
|
||||
getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
|
||||
int firstc;
|
||||
char_u *prompt; /* command line prompt */
|
||||
int attr; /* attributes for prompt */
|
||||
int xp_context; /* type of expansion */
|
||||
char_u *xp_arg; /* user-defined expansion argument */
|
||||
getcmdline_prompt(
|
||||
int firstc,
|
||||
char_u *prompt, /* command line prompt */
|
||||
int attr, /* attributes for prompt */
|
||||
int xp_context, /* type of expansion */
|
||||
char_u *xp_arg) /* user-defined expansion argument */
|
||||
{
|
||||
char_u *s;
|
||||
struct cmdline_info save_ccline;
|
||||
@@ -2034,7 +2031,7 @@ getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
|
||||
* 'balloonexpr', etc.
|
||||
*/
|
||||
int
|
||||
text_locked()
|
||||
text_locked(void)
|
||||
{
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -2048,7 +2045,7 @@ text_locked()
|
||||
* window is open or editing the cmdline in another way.
|
||||
*/
|
||||
void
|
||||
text_locked_msg()
|
||||
text_locked_msg(void)
|
||||
{
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -2064,7 +2061,7 @@ text_locked_msg()
|
||||
* and give an error message.
|
||||
*/
|
||||
int
|
||||
curbuf_locked()
|
||||
curbuf_locked(void)
|
||||
{
|
||||
if (curbuf_lock > 0)
|
||||
{
|
||||
@@ -2079,7 +2076,7 @@ curbuf_locked()
|
||||
* message.
|
||||
*/
|
||||
int
|
||||
allbuf_locked()
|
||||
allbuf_locked(void)
|
||||
{
|
||||
if (allbuf_lock > 0)
|
||||
{
|
||||
@@ -2091,8 +2088,7 @@ allbuf_locked()
|
||||
#endif
|
||||
|
||||
static int
|
||||
cmdline_charsize(idx)
|
||||
int idx;
|
||||
cmdline_charsize(int idx)
|
||||
{
|
||||
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
|
||||
if (cmdline_star > 0) /* showing '*', always 1 position */
|
||||
@@ -2106,7 +2102,7 @@ cmdline_charsize(idx)
|
||||
* indent.
|
||||
*/
|
||||
static void
|
||||
set_cmdspos()
|
||||
set_cmdspos(void)
|
||||
{
|
||||
if (ccline.cmdfirstc != NUL)
|
||||
ccline.cmdspos = 1 + ccline.cmdindent;
|
||||
@@ -2118,7 +2114,7 @@ set_cmdspos()
|
||||
* Compute the screen position for the cursor on the command line.
|
||||
*/
|
||||
static void
|
||||
set_cmdspos_cursor()
|
||||
set_cmdspos_cursor(void)
|
||||
{
|
||||
int i, m, c;
|
||||
|
||||
@@ -2159,9 +2155,7 @@ set_cmdspos_cursor()
|
||||
* character that doesn't fit, so that a ">" must be displayed.
|
||||
*/
|
||||
static void
|
||||
correct_cmdspos(idx, cells)
|
||||
int idx;
|
||||
int cells;
|
||||
correct_cmdspos(int idx, int cells)
|
||||
{
|
||||
if ((*mb_ptr2len)(ccline.cmdbuff + idx) > 1
|
||||
&& (*mb_ptr2cells)(ccline.cmdbuff + idx) > 1
|
||||
@@ -2174,10 +2168,10 @@ correct_cmdspos(idx, cells)
|
||||
* Get an Ex command line for the ":" command.
|
||||
*/
|
||||
char_u *
|
||||
getexline(c, cookie, indent)
|
||||
int c; /* normally ':', NUL for ":append" */
|
||||
void *cookie UNUSED;
|
||||
int indent; /* indent for inside conditionals */
|
||||
getexline(
|
||||
int c, /* normally ':', NUL for ":append" */
|
||||
void *cookie UNUSED,
|
||||
int indent) /* indent for inside conditionals */
|
||||
{
|
||||
/* When executing a register, remove ':' that's in front of each line. */
|
||||
if (exec_from_reg && vpeekc() == ':')
|
||||
@@ -2192,11 +2186,11 @@ getexline(c, cookie, indent)
|
||||
* Returns a string in allocated memory or NULL.
|
||||
*/
|
||||
char_u *
|
||||
getexmodeline(promptc, cookie, indent)
|
||||
int promptc; /* normally ':', NUL for ":append" and '?' for
|
||||
getexmodeline(
|
||||
int promptc, /* normally ':', NUL for ":append" and '?' for
|
||||
:s prompt */
|
||||
void *cookie UNUSED;
|
||||
int indent; /* indent for inside conditionals */
|
||||
void *cookie UNUSED,
|
||||
int indent) /* indent for inside conditionals */
|
||||
{
|
||||
garray_T line_ga;
|
||||
char_u *pend;
|
||||
@@ -2481,7 +2475,7 @@ redraw:
|
||||
* Return TRUE if ccline.overstrike is on.
|
||||
*/
|
||||
int
|
||||
cmdline_overstrike()
|
||||
cmdline_overstrike(void)
|
||||
{
|
||||
return ccline.overstrike;
|
||||
}
|
||||
@@ -2490,7 +2484,7 @@ cmdline_overstrike()
|
||||
* Return TRUE if the cursor is at the end of the cmdline.
|
||||
*/
|
||||
int
|
||||
cmdline_at_end()
|
||||
cmdline_at_end(void)
|
||||
{
|
||||
return (ccline.cmdpos >= ccline.cmdlen);
|
||||
}
|
||||
@@ -2503,7 +2497,7 @@ cmdline_at_end()
|
||||
* This is used by the IM code to obtain the start of the preedit string.
|
||||
*/
|
||||
colnr_T
|
||||
cmdline_getvcol_cursor()
|
||||
cmdline_getvcol_cursor(void)
|
||||
{
|
||||
if (ccline.cmdbuff == NULL || ccline.cmdpos > ccline.cmdlen)
|
||||
return MAXCOL;
|
||||
@@ -2531,7 +2525,7 @@ cmdline_getvcol_cursor()
|
||||
* IM feedback attributes. The cursor position is restored after drawing.
|
||||
*/
|
||||
static void
|
||||
redrawcmd_preedit()
|
||||
redrawcmd_preedit(void)
|
||||
{
|
||||
if ((State & CMDLINE)
|
||||
# ifndef FEAT_GUI_MACVIM
|
||||
@@ -2605,8 +2599,7 @@ redrawcmd_preedit()
|
||||
* Returns the new value of ccline.cmdbuff and ccline.cmdbufflen.
|
||||
*/
|
||||
static void
|
||||
alloc_cmdbuff(len)
|
||||
int len;
|
||||
alloc_cmdbuff(int len)
|
||||
{
|
||||
/*
|
||||
* give some extra space to avoid having to allocate all the time
|
||||
@@ -2625,8 +2618,7 @@ alloc_cmdbuff(len)
|
||||
* return FAIL for failure, OK otherwise
|
||||
*/
|
||||
static int
|
||||
realloc_cmdbuff(len)
|
||||
int len;
|
||||
realloc_cmdbuff(int len)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -2667,7 +2659,7 @@ static char_u *arshape_buf = NULL;
|
||||
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
free_cmdline_buf()
|
||||
free_cmdline_buf(void)
|
||||
{
|
||||
vim_free(arshape_buf);
|
||||
}
|
||||
@@ -2679,9 +2671,7 @@ free_cmdline_buf()
|
||||
* when cmdline_star is TRUE.
|
||||
*/
|
||||
static void
|
||||
draw_cmdline(start, len)
|
||||
int start;
|
||||
int len;
|
||||
draw_cmdline(int start, int len)
|
||||
{
|
||||
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
|
||||
int i;
|
||||
@@ -2802,9 +2792,7 @@ draw_cmdline(start, len)
|
||||
* "c" must be printable (fit in one display cell)!
|
||||
*/
|
||||
void
|
||||
putcmdline(c, shift)
|
||||
int c;
|
||||
int shift;
|
||||
putcmdline(int c, int shift)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
@@ -2820,7 +2808,7 @@ putcmdline(c, shift)
|
||||
* Undo a putcmdline(c, FALSE).
|
||||
*/
|
||||
void
|
||||
unputcmdline()
|
||||
unputcmdline(void)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
@@ -2847,10 +2835,7 @@ unputcmdline()
|
||||
* called afterwards.
|
||||
*/
|
||||
int
|
||||
put_on_cmdline(str, len, redraw)
|
||||
char_u *str;
|
||||
int len;
|
||||
int redraw;
|
||||
put_on_cmdline(char_u *str, int len, int redraw)
|
||||
{
|
||||
int retval;
|
||||
int i;
|
||||
@@ -3020,8 +3005,7 @@ static int prev_ccline_used = FALSE;
|
||||
* available globally in prev_ccline.
|
||||
*/
|
||||
static void
|
||||
save_cmdline(ccp)
|
||||
struct cmdline_info *ccp;
|
||||
save_cmdline(struct cmdline_info *ccp)
|
||||
{
|
||||
if (!prev_ccline_used)
|
||||
{
|
||||
@@ -3039,8 +3023,7 @@ save_cmdline(ccp)
|
||||
* Restore ccline after it has been saved with save_cmdline().
|
||||
*/
|
||||
static void
|
||||
restore_cmdline(ccp)
|
||||
struct cmdline_info *ccp;
|
||||
restore_cmdline(struct cmdline_info *ccp)
|
||||
{
|
||||
ccline = prev_ccline;
|
||||
prev_ccline = *ccp;
|
||||
@@ -3053,7 +3036,7 @@ restore_cmdline(ccp)
|
||||
* Returns NULL when failed.
|
||||
*/
|
||||
char_u *
|
||||
save_cmdline_alloc()
|
||||
save_cmdline_alloc(void)
|
||||
{
|
||||
struct cmdline_info *p;
|
||||
|
||||
@@ -3067,8 +3050,7 @@ save_cmdline_alloc()
|
||||
* Restore the command line from the return value of save_cmdline_alloc().
|
||||
*/
|
||||
void
|
||||
restore_cmdline_alloc(p)
|
||||
char_u *p;
|
||||
restore_cmdline_alloc(char_u *p)
|
||||
{
|
||||
if (p != NULL)
|
||||
{
|
||||
@@ -3087,10 +3069,10 @@ restore_cmdline_alloc(p)
|
||||
* Return FAIL for failure, OK otherwise.
|
||||
*/
|
||||
static int
|
||||
cmdline_paste(regname, literally, remcr)
|
||||
int regname;
|
||||
int literally; /* Insert text literally instead of "as typed" */
|
||||
int remcr; /* remove trailing CR */
|
||||
cmdline_paste(
|
||||
int regname,
|
||||
int literally, /* Insert text literally instead of "as typed" */
|
||||
int remcr) /* remove trailing CR */
|
||||
{
|
||||
long i;
|
||||
char_u *arg;
|
||||
@@ -3176,9 +3158,7 @@ cmdline_paste(regname, literally, remcr)
|
||||
* line.
|
||||
*/
|
||||
void
|
||||
cmdline_paste_str(s, literally)
|
||||
char_u *s;
|
||||
int literally;
|
||||
cmdline_paste_str(char_u *s, int literally)
|
||||
{
|
||||
int c, cv;
|
||||
|
||||
@@ -3213,8 +3193,7 @@ cmdline_paste_str(s, literally)
|
||||
* position.
|
||||
*/
|
||||
static void
|
||||
cmdline_del(from)
|
||||
int from;
|
||||
cmdline_del(int from)
|
||||
{
|
||||
mch_memmove(ccline.cmdbuff + from, ccline.cmdbuff + ccline.cmdpos,
|
||||
(size_t)(ccline.cmdlen - ccline.cmdpos + 1));
|
||||
@@ -3228,7 +3207,7 @@ cmdline_del(from)
|
||||
* search
|
||||
*/
|
||||
void
|
||||
redrawcmdline()
|
||||
redrawcmdline(void)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
@@ -3239,7 +3218,7 @@ redrawcmdline()
|
||||
}
|
||||
|
||||
static void
|
||||
redrawcmdprompt()
|
||||
redrawcmdprompt(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -3264,7 +3243,7 @@ redrawcmdprompt()
|
||||
* Redraw what is currently on the command line.
|
||||
*/
|
||||
void
|
||||
redrawcmd()
|
||||
redrawcmd(void)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
@@ -3300,7 +3279,7 @@ redrawcmd()
|
||||
}
|
||||
|
||||
void
|
||||
compute_cmdrow()
|
||||
compute_cmdrow(void)
|
||||
{
|
||||
if (exmode_active || msg_scrolled != 0)
|
||||
cmdline_row = Rows - 1;
|
||||
@@ -3310,7 +3289,7 @@ compute_cmdrow()
|
||||
}
|
||||
|
||||
static void
|
||||
cursorcmd()
|
||||
cursorcmd(void)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
@@ -3342,8 +3321,7 @@ cursorcmd()
|
||||
}
|
||||
|
||||
void
|
||||
gotocmdline(clr)
|
||||
int clr;
|
||||
gotocmdline(int clr)
|
||||
{
|
||||
msg_start();
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
@@ -3364,8 +3342,7 @@ gotocmdline(clr)
|
||||
* backspaces and the replacement string is inserted, followed by "c".
|
||||
*/
|
||||
static int
|
||||
ccheck_abbr(c)
|
||||
int c;
|
||||
ccheck_abbr(int c)
|
||||
{
|
||||
if (p_paste || no_abbr) /* no abbreviations or in paste mode */
|
||||
return FALSE;
|
||||
@@ -3378,9 +3355,7 @@ ccheck_abbr(c)
|
||||
#ifdef __BORLANDC__
|
||||
_RTLENTRYF
|
||||
#endif
|
||||
sort_func_compare(s1, s2)
|
||||
const void *s1;
|
||||
const void *s2;
|
||||
sort_func_compare(const void *s1, const void *s2)
|
||||
{
|
||||
char_u *p1 = *(char_u **)s1;
|
||||
char_u *p2 = *(char_u **)s2;
|
||||
@@ -3398,11 +3373,11 @@ sort_func_compare(s1, s2)
|
||||
* normal character (instead of being expanded). This allows :s/^I^D etc.
|
||||
*/
|
||||
static int
|
||||
nextwild(xp, type, options, escape)
|
||||
expand_T *xp;
|
||||
int type;
|
||||
int options; /* extra options for ExpandOne() */
|
||||
int escape; /* if TRUE, escape the returned matches */
|
||||
nextwild(
|
||||
expand_T *xp,
|
||||
int type,
|
||||
int options, /* extra options for ExpandOne() */
|
||||
int escape) /* if TRUE, escape the returned matches */
|
||||
{
|
||||
int i, j;
|
||||
char_u *p1;
|
||||
@@ -3551,12 +3526,12 @@ nextwild(xp, type, options, escape)
|
||||
* The variables xp->xp_context and xp->xp_backslash must have been set!
|
||||
*/
|
||||
char_u *
|
||||
ExpandOne(xp, str, orig, options, mode)
|
||||
expand_T *xp;
|
||||
char_u *str;
|
||||
char_u *orig; /* allocated copy of original of expanded string */
|
||||
int options;
|
||||
int mode;
|
||||
ExpandOne(
|
||||
expand_T *xp,
|
||||
char_u *str,
|
||||
char_u *orig, /* allocated copy of original of expanded string */
|
||||
int options,
|
||||
int mode)
|
||||
{
|
||||
char_u *ss = NULL;
|
||||
static int findex;
|
||||
@@ -3782,8 +3757,7 @@ ExpandOne(xp, str, orig, options, mode)
|
||||
* Prepare an expand structure for use.
|
||||
*/
|
||||
void
|
||||
ExpandInit(xp)
|
||||
expand_T *xp;
|
||||
ExpandInit(expand_T *xp)
|
||||
{
|
||||
xp->xp_pattern = NULL;
|
||||
xp->xp_pattern_len = 0;
|
||||
@@ -3803,8 +3777,7 @@ ExpandInit(xp)
|
||||
* Cleanup an expand structure after use.
|
||||
*/
|
||||
void
|
||||
ExpandCleanup(xp)
|
||||
expand_T *xp;
|
||||
ExpandCleanup(expand_T *xp)
|
||||
{
|
||||
if (xp->xp_numfiles >= 0)
|
||||
{
|
||||
@@ -3814,12 +3787,12 @@ ExpandCleanup(xp)
|
||||
}
|
||||
|
||||
void
|
||||
ExpandEscape(xp, str, numfiles, files, options)
|
||||
expand_T *xp;
|
||||
char_u *str;
|
||||
int numfiles;
|
||||
char_u **files;
|
||||
int options;
|
||||
ExpandEscape(
|
||||
expand_T *xp,
|
||||
char_u *str,
|
||||
int numfiles,
|
||||
char_u **files,
|
||||
int options)
|
||||
{
|
||||
int i;
|
||||
char_u *p;
|
||||
@@ -3910,9 +3883,7 @@ ExpandEscape(xp, str, numfiles, files, options)
|
||||
* Returns the result in allocated memory.
|
||||
*/
|
||||
char_u *
|
||||
vim_strsave_fnameescape(fname, shell)
|
||||
char_u *fname;
|
||||
int shell;
|
||||
vim_strsave_fnameescape(char_u *fname, int shell)
|
||||
{
|
||||
char_u *p;
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
@@ -3951,8 +3922,7 @@ vim_strsave_fnameescape(fname, shell)
|
||||
* Put a backslash before the file name in "pp", which is in allocated memory.
|
||||
*/
|
||||
static void
|
||||
escape_fname(pp)
|
||||
char_u **pp;
|
||||
escape_fname(char_u **pp)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -3971,10 +3941,10 @@ escape_fname(pp)
|
||||
* If 'orig_pat' starts with "~/", replace the home directory with "~".
|
||||
*/
|
||||
void
|
||||
tilde_replace(orig_pat, num_files, files)
|
||||
char_u *orig_pat;
|
||||
int num_files;
|
||||
char_u **files;
|
||||
tilde_replace(
|
||||
char_u *orig_pat,
|
||||
int num_files,
|
||||
char_u **files)
|
||||
{
|
||||
int i;
|
||||
char_u *p;
|
||||
@@ -3999,9 +3969,7 @@ tilde_replace(orig_pat, num_files, files)
|
||||
* be inserted like a normal character.
|
||||
*/
|
||||
static int
|
||||
showmatches(xp, wildmenu)
|
||||
expand_T *xp;
|
||||
int wildmenu UNUSED;
|
||||
showmatches(expand_T *xp, int wildmenu UNUSED)
|
||||
{
|
||||
#define L_SHOWFILE(m) (showtail ? sm_gettail(files_found[m]) : files_found[m])
|
||||
int num_files;
|
||||
@@ -4183,8 +4151,7 @@ showmatches(xp, wildmenu)
|
||||
* Find tail of file name path, but ignore trailing "/".
|
||||
*/
|
||||
char_u *
|
||||
sm_gettail(s)
|
||||
char_u *s;
|
||||
sm_gettail(char_u *s)
|
||||
{
|
||||
char_u *p;
|
||||
char_u *t = s;
|
||||
@@ -4214,8 +4181,7 @@ sm_gettail(s)
|
||||
* returned.
|
||||
*/
|
||||
static int
|
||||
expand_showtail(xp)
|
||||
expand_T *xp;
|
||||
expand_showtail(expand_T *xp)
|
||||
{
|
||||
char_u *s;
|
||||
char_u *end;
|
||||
@@ -4250,10 +4216,10 @@ expand_showtail(xp)
|
||||
* the name into allocated memory and prepend "^".
|
||||
*/
|
||||
char_u *
|
||||
addstar(fname, len, context)
|
||||
char_u *fname;
|
||||
int len;
|
||||
int context; /* EXPAND_FILES etc. */
|
||||
addstar(
|
||||
char_u *fname,
|
||||
int len,
|
||||
int context) /* EXPAND_FILES etc. */
|
||||
{
|
||||
char_u *retval;
|
||||
int i, j;
|
||||
@@ -4419,8 +4385,7 @@ addstar(fname, len, context)
|
||||
* EXPAND_USER Complete user names
|
||||
*/
|
||||
static void
|
||||
set_expand_context(xp)
|
||||
expand_T *xp;
|
||||
set_expand_context(expand_T *xp)
|
||||
{
|
||||
/* only expansion for ':', '>' and '=' command-lines */
|
||||
if (ccline.cmdfirstc != ':'
|
||||
@@ -4437,11 +4402,11 @@ set_expand_context(xp)
|
||||
}
|
||||
|
||||
void
|
||||
set_cmd_context(xp, str, len, col)
|
||||
expand_T *xp;
|
||||
char_u *str; /* start of command line */
|
||||
int len; /* length of command line (excl. NUL) */
|
||||
int col; /* position of cursor */
|
||||
set_cmd_context(
|
||||
expand_T *xp,
|
||||
char_u *str, /* start of command line */
|
||||
int len, /* length of command line (excl. NUL) */
|
||||
int col) /* position of cursor */
|
||||
{
|
||||
int old_char = NUL;
|
||||
char_u *nextcomm;
|
||||
@@ -4496,12 +4461,12 @@ set_cmd_context(xp, str, len, col)
|
||||
* Returns EXPAND_OK otherwise.
|
||||
*/
|
||||
int
|
||||
expand_cmdline(xp, str, col, matchcount, matches)
|
||||
expand_T *xp;
|
||||
char_u *str; /* start of command line */
|
||||
int col; /* position of cursor */
|
||||
int *matchcount; /* return: nr of matches */
|
||||
char_u ***matches; /* return: array of pointers to matches */
|
||||
expand_cmdline(
|
||||
expand_T *xp,
|
||||
char_u *str, /* start of command line */
|
||||
int col, /* position of cursor */
|
||||
int *matchcount, /* return: nr of matches */
|
||||
char_u ***matches) /* return: array of pointers to matches */
|
||||
{
|
||||
char_u *file_str = NULL;
|
||||
int options = WILD_ADD_SLASH|WILD_SILENT;
|
||||
@@ -4544,9 +4509,7 @@ expand_cmdline(xp, str, col, matchcount, matches)
|
||||
static void cleanup_help_tags(int num_file, char_u **file);
|
||||
|
||||
static void
|
||||
cleanup_help_tags(num_file, file)
|
||||
int num_file;
|
||||
char_u **file;
|
||||
cleanup_help_tags(int num_file, char_u **file)
|
||||
{
|
||||
int i, j;
|
||||
int len;
|
||||
@@ -4574,12 +4537,12 @@ cleanup_help_tags(num_file, file)
|
||||
* Do the expansion based on xp->xp_context and "pat".
|
||||
*/
|
||||
static int
|
||||
ExpandFromContext(xp, pat, num_file, file, options)
|
||||
expand_T *xp;
|
||||
char_u *pat;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
int options; /* EW_ flags */
|
||||
ExpandFromContext(
|
||||
expand_T *xp,
|
||||
char_u *pat,
|
||||
int *num_file,
|
||||
char_u ***file,
|
||||
int options) /* EW_ flags */
|
||||
{
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
regmatch_T regmatch;
|
||||
@@ -4813,14 +4776,14 @@ ExpandFromContext(xp, pat, num_file, file, options)
|
||||
* Returns OK when no problems encountered, FAIL for error (out of memory).
|
||||
*/
|
||||
int
|
||||
ExpandGeneric(xp, regmatch, num_file, file, func, escaped)
|
||||
expand_T *xp;
|
||||
regmatch_T *regmatch;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
char_u *((*func)(expand_T *, int));
|
||||
ExpandGeneric(
|
||||
expand_T *xp,
|
||||
regmatch_T *regmatch,
|
||||
int *num_file,
|
||||
char_u ***file,
|
||||
char_u *((*func)(expand_T *, int)),
|
||||
/* returns a string from the list */
|
||||
int escaped;
|
||||
int escaped)
|
||||
{
|
||||
int i;
|
||||
int count = 0;
|
||||
@@ -4905,11 +4868,11 @@ ExpandGeneric(xp, regmatch, num_file, file, func, escaped)
|
||||
* Returns FAIL or OK;
|
||||
*/
|
||||
static int
|
||||
expand_shellcmd(filepat, num_file, file, flagsarg)
|
||||
char_u *filepat; /* pattern to match with command names */
|
||||
int *num_file; /* return: number of matches */
|
||||
char_u ***file; /* return: array with matches */
|
||||
int flagsarg; /* EW_ flags */
|
||||
expand_shellcmd(
|
||||
char_u *filepat, /* pattern to match with command names */
|
||||
int *num_file, /* return: number of matches */
|
||||
char_u ***file, /* return: array with matches */
|
||||
int flagsarg) /* EW_ flags */
|
||||
{
|
||||
char_u *pat;
|
||||
int i;
|
||||
@@ -5030,11 +4993,11 @@ static void * call_user_expand_func(void *(*user_expand_func)(char_u *, int, cha
|
||||
* the result (either a string or a List).
|
||||
*/
|
||||
static void *
|
||||
call_user_expand_func(user_expand_func, xp, num_file, file)
|
||||
void *(*user_expand_func)(char_u *, int, char_u **, int);
|
||||
expand_T *xp;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
call_user_expand_func(
|
||||
void *(*user_expand_func)(char_u *, int, char_u **, int),
|
||||
expand_T *xp,
|
||||
int *num_file,
|
||||
char_u ***file)
|
||||
{
|
||||
int keep = 0;
|
||||
char_u num[50];
|
||||
@@ -5080,11 +5043,11 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
|
||||
* Expand names with a function defined by the user.
|
||||
*/
|
||||
static int
|
||||
ExpandUserDefined(xp, regmatch, num_file, file)
|
||||
expand_T *xp;
|
||||
regmatch_T *regmatch;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
ExpandUserDefined(
|
||||
expand_T *xp,
|
||||
regmatch_T *regmatch,
|
||||
int *num_file,
|
||||
char_u ***file)
|
||||
{
|
||||
char_u *retstr;
|
||||
char_u *s;
|
||||
@@ -5133,10 +5096,10 @@ ExpandUserDefined(xp, regmatch, num_file, file)
|
||||
* Expand names with a list returned by a function defined by the user.
|
||||
*/
|
||||
static int
|
||||
ExpandUserList(xp, num_file, file)
|
||||
expand_T *xp;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
ExpandUserList(
|
||||
expand_T *xp,
|
||||
int *num_file,
|
||||
char_u ***file)
|
||||
{
|
||||
list_T *retlist;
|
||||
listitem_T *li;
|
||||
@@ -5174,11 +5137,11 @@ ExpandUserList(xp, num_file, file)
|
||||
* "dirnames" is an array with one or more directory names.
|
||||
*/
|
||||
static int
|
||||
ExpandRTDir(pat, num_file, file, dirnames)
|
||||
char_u *pat;
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
char *dirnames[];
|
||||
ExpandRTDir(
|
||||
char_u *pat,
|
||||
int *num_file,
|
||||
char_u ***file,
|
||||
char *dirnames[])
|
||||
{
|
||||
char_u *s;
|
||||
char_u *e;
|
||||
@@ -5242,11 +5205,11 @@ ExpandRTDir(pat, num_file, file, dirnames)
|
||||
* Adds the matches to "ga". Caller must init "ga".
|
||||
*/
|
||||
void
|
||||
globpath(path, file, ga, expand_options)
|
||||
char_u *path;
|
||||
char_u *file;
|
||||
garray_T *ga;
|
||||
int expand_options;
|
||||
globpath(
|
||||
char_u *path,
|
||||
char_u *file,
|
||||
garray_T *ga,
|
||||
int expand_options)
|
||||
{
|
||||
expand_T xpc;
|
||||
char_u *buf;
|
||||
@@ -5312,8 +5275,7 @@ globpath(path, file, ga, expand_options)
|
||||
* Translate a history character to the associated type number.
|
||||
*/
|
||||
static int
|
||||
hist_char2type(c)
|
||||
int c;
|
||||
hist_char2type(int c)
|
||||
{
|
||||
if (c == ':')
|
||||
return HIST_CMD;
|
||||
@@ -5348,9 +5310,7 @@ static char *(history_names[]) =
|
||||
* arguments of the ":history command.
|
||||
*/
|
||||
static char_u *
|
||||
get_history_arg(xp, idx)
|
||||
expand_T *xp UNUSED;
|
||||
int idx;
|
||||
get_history_arg(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
static char_u compl[2] = { NUL, NUL };
|
||||
char *short_names = ":=@>?/";
|
||||
@@ -5375,7 +5335,7 @@ get_history_arg(xp, idx)
|
||||
* Also used to re-allocate the history when the size changes.
|
||||
*/
|
||||
void
|
||||
init_history()
|
||||
init_history(void)
|
||||
{
|
||||
int newlen; /* new length of history table */
|
||||
histentry_T *temp;
|
||||
@@ -5453,8 +5413,7 @@ init_history()
|
||||
}
|
||||
|
||||
static void
|
||||
clear_hist_entry(hisptr)
|
||||
histentry_T *hisptr;
|
||||
clear_hist_entry(histentry_T *hisptr)
|
||||
{
|
||||
hisptr->hisnum = 0;
|
||||
hisptr->viminfo = FALSE;
|
||||
@@ -5466,12 +5425,12 @@ clear_hist_entry(hisptr)
|
||||
* If 'move_to_front' is TRUE, matching entry is moved to end of history.
|
||||
*/
|
||||
static int
|
||||
in_history(type, str, move_to_front, sep, writing)
|
||||
int type;
|
||||
char_u *str;
|
||||
int move_to_front; /* Move the entry to the front if it exists */
|
||||
int sep;
|
||||
int writing; /* ignore entries read from viminfo */
|
||||
in_history(
|
||||
int type,
|
||||
char_u *str,
|
||||
int move_to_front, /* Move the entry to the front if it exists */
|
||||
int sep,
|
||||
int writing) /* ignore entries read from viminfo */
|
||||
{
|
||||
int i;
|
||||
int last_i = -1;
|
||||
@@ -5525,8 +5484,7 @@ in_history(type, str, move_to_front, sep, writing)
|
||||
* Returns -1 for unknown history name.
|
||||
*/
|
||||
int
|
||||
get_histtype(name)
|
||||
char_u *name;
|
||||
get_histtype(char_u *name)
|
||||
{
|
||||
int i;
|
||||
int len = (int)STRLEN(name);
|
||||
@@ -5553,11 +5511,11 @@ static int last_maptick = -1; /* last seen maptick */
|
||||
* values.
|
||||
*/
|
||||
void
|
||||
add_to_history(histype, new_entry, in_map, sep)
|
||||
int histype;
|
||||
char_u *new_entry;
|
||||
int in_map; /* consider maptick when inside a mapping */
|
||||
int sep; /* separator character used (search hist) */
|
||||
add_to_history(
|
||||
int histype,
|
||||
char_u *new_entry,
|
||||
int in_map, /* consider maptick when inside a mapping */
|
||||
int sep) /* separator character used (search hist) */
|
||||
{
|
||||
histentry_T *hisptr;
|
||||
int len;
|
||||
@@ -5614,8 +5572,7 @@ add_to_history(histype, new_entry, in_map, sep)
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
int
|
||||
get_history_idx(histype)
|
||||
int histype;
|
||||
get_history_idx(int histype)
|
||||
{
|
||||
if (hislen == 0 || histype < 0 || histype >= HIST_COUNT
|
||||
|| hisidx[histype] < 0)
|
||||
@@ -5631,7 +5588,7 @@ static struct cmdline_info *get_ccline_ptr(void);
|
||||
* ccline and put the previous value in prev_ccline.
|
||||
*/
|
||||
static struct cmdline_info *
|
||||
get_ccline_ptr()
|
||||
get_ccline_ptr(void)
|
||||
{
|
||||
if ((State & CMDLINE) == 0)
|
||||
return NULL;
|
||||
@@ -5648,7 +5605,7 @@ get_ccline_ptr()
|
||||
* Returns NULL when something is wrong.
|
||||
*/
|
||||
char_u *
|
||||
get_cmdline_str()
|
||||
get_cmdline_str(void)
|
||||
{
|
||||
struct cmdline_info *p = get_ccline_ptr();
|
||||
|
||||
@@ -5664,7 +5621,7 @@ get_cmdline_str()
|
||||
* Returns -1 when something is wrong.
|
||||
*/
|
||||
int
|
||||
get_cmdline_pos()
|
||||
get_cmdline_pos(void)
|
||||
{
|
||||
struct cmdline_info *p = get_ccline_ptr();
|
||||
|
||||
@@ -5679,8 +5636,8 @@ get_cmdline_pos()
|
||||
* Returns 1 when failed, 0 when OK.
|
||||
*/
|
||||
int
|
||||
set_cmdline_pos(pos)
|
||||
int pos;
|
||||
set_cmdline_pos(
|
||||
int pos)
|
||||
{
|
||||
struct cmdline_info *p = get_ccline_ptr();
|
||||
|
||||
@@ -5703,7 +5660,7 @@ set_cmdline_pos(pos)
|
||||
* Returns NUL when something is wrong.
|
||||
*/
|
||||
int
|
||||
get_cmdline_type()
|
||||
get_cmdline_type(void)
|
||||
{
|
||||
struct cmdline_info *p = get_ccline_ptr();
|
||||
|
||||
@@ -5721,9 +5678,7 @@ get_cmdline_type()
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
static int
|
||||
calc_hist_idx(histype, num)
|
||||
int histype;
|
||||
int num;
|
||||
calc_hist_idx(int histype, int num)
|
||||
{
|
||||
int i;
|
||||
histentry_T *hist;
|
||||
@@ -5763,9 +5718,7 @@ calc_hist_idx(histype, num)
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
char_u *
|
||||
get_history_entry(histype, idx)
|
||||
int histype;
|
||||
int idx;
|
||||
get_history_entry(int histype, int idx)
|
||||
{
|
||||
idx = calc_hist_idx(histype, idx);
|
||||
if (idx >= 0)
|
||||
@@ -5779,8 +5732,7 @@ get_history_entry(histype, idx)
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
int
|
||||
clr_history(histype)
|
||||
int histype;
|
||||
clr_history(int histype)
|
||||
{
|
||||
int i;
|
||||
histentry_T *hisptr;
|
||||
@@ -5805,9 +5757,7 @@ clr_history(histype)
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
int
|
||||
del_history_entry(histype, str)
|
||||
int histype;
|
||||
char_u *str;
|
||||
del_history_entry(int histype, char_u *str)
|
||||
{
|
||||
regmatch_T regmatch;
|
||||
histentry_T *hisptr;
|
||||
@@ -5863,9 +5813,7 @@ del_history_entry(histype, str)
|
||||
* "histype" may be one of the HIST_ values.
|
||||
*/
|
||||
int
|
||||
del_history_idx(histype, idx)
|
||||
int histype;
|
||||
int idx;
|
||||
del_history_idx(int histype, int idx)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@@ -5902,7 +5850,7 @@ del_history_idx(histype, idx)
|
||||
* history.
|
||||
*/
|
||||
void
|
||||
remove_key_from_history()
|
||||
remove_key_from_history(void)
|
||||
{
|
||||
char_u *p;
|
||||
int i;
|
||||
@@ -5937,10 +5885,7 @@ remove_key_from_history()
|
||||
* Returns OK if parsed successfully, otherwise FAIL.
|
||||
*/
|
||||
int
|
||||
get_list_range(str, num1, num2)
|
||||
char_u **str;
|
||||
int *num1;
|
||||
int *num2;
|
||||
get_list_range(char_u **str, int *num1, int *num2)
|
||||
{
|
||||
int len;
|
||||
int first = FALSE;
|
||||
@@ -5978,8 +5923,7 @@ get_list_range(str, num1, num2)
|
||||
* :history command - print a history
|
||||
*/
|
||||
void
|
||||
ex_history(eap)
|
||||
exarg_T *eap;
|
||||
ex_history(exarg_T *eap)
|
||||
{
|
||||
histentry_T *hist;
|
||||
int histype1 = HIST_CMD;
|
||||
@@ -6086,9 +6030,9 @@ static int hist_type2char(int type, int use_question);
|
||||
* Translate a history type number to the associated character.
|
||||
*/
|
||||
static int
|
||||
hist_type2char(type, use_question)
|
||||
int type;
|
||||
int use_question; /* use '?' instead of '/' */
|
||||
hist_type2char(
|
||||
int type,
|
||||
int use_question) /* use '?' instead of '/' */
|
||||
{
|
||||
if (type == HIST_CMD)
|
||||
return ':';
|
||||
@@ -6109,9 +6053,7 @@ hist_type2char(type, use_question)
|
||||
* This allocates history arrays to store the read history lines.
|
||||
*/
|
||||
void
|
||||
prepare_viminfo_history(asklen, writing)
|
||||
int asklen;
|
||||
int writing;
|
||||
prepare_viminfo_history(int asklen, int writing)
|
||||
{
|
||||
int i;
|
||||
int num;
|
||||
@@ -6151,9 +6093,7 @@ prepare_viminfo_history(asklen, writing)
|
||||
* new.
|
||||
*/
|
||||
int
|
||||
read_viminfo_history(virp, writing)
|
||||
vir_T *virp;
|
||||
int writing;
|
||||
read_viminfo_history(vir_T *virp, int writing)
|
||||
{
|
||||
int type;
|
||||
long_u len;
|
||||
@@ -6203,7 +6143,7 @@ read_viminfo_history(virp, writing)
|
||||
* Finish reading history lines from viminfo. Not used when writing viminfo.
|
||||
*/
|
||||
void
|
||||
finish_viminfo_history()
|
||||
finish_viminfo_history(void)
|
||||
{
|
||||
int idx;
|
||||
int i;
|
||||
@@ -6263,9 +6203,9 @@ finish_viminfo_history()
|
||||
* When "merge" is FALSE just write all history lines. Used for ":wviminfo!".
|
||||
*/
|
||||
void
|
||||
write_viminfo_history(fp, merge)
|
||||
FILE *fp;
|
||||
int merge;
|
||||
write_viminfo_history(
|
||||
FILE *fp,
|
||||
int merge)
|
||||
{
|
||||
int i;
|
||||
int type;
|
||||
@@ -6362,8 +6302,7 @@ write_viminfo_history(fp, merge)
|
||||
* It is directly written into the command buffer block.
|
||||
*/
|
||||
void
|
||||
cmd_pchar(c, offset)
|
||||
int c, offset;
|
||||
cmd_pchar(int c, int offset)
|
||||
{
|
||||
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
|
||||
{
|
||||
@@ -6375,8 +6314,7 @@ cmd_pchar(c, offset)
|
||||
}
|
||||
|
||||
int
|
||||
cmd_gchar(offset)
|
||||
int offset;
|
||||
cmd_gchar(int offset)
|
||||
{
|
||||
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
|
||||
{
|
||||
@@ -6397,7 +6335,7 @@ cmd_gchar(offset)
|
||||
* K_IGNORE if editing continues
|
||||
*/
|
||||
static int
|
||||
ex_window()
|
||||
ex_window(void)
|
||||
{
|
||||
struct cmdline_info save_ccline;
|
||||
buf_T *old_curbuf = curbuf;
|
||||
@@ -6688,9 +6626,7 @@ ex_window()
|
||||
* Returns a pointer to allocated memory with {script} or NULL.
|
||||
*/
|
||||
char_u *
|
||||
script_get(eap, cmd)
|
||||
exarg_T *eap;
|
||||
char_u *cmd;
|
||||
script_get(exarg_T *eap, char_u *cmd)
|
||||
{
|
||||
char_u *theline;
|
||||
char *end_pattern = NULL;
|
||||
|
||||
+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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
+221
-308
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
|
||||
|
||||
+160
-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,7 +1884,7 @@ vpeekc_any()
|
||||
* Return TRUE if a character is available, FALSE otherwise.
|
||||
*/
|
||||
int
|
||||
char_avail()
|
||||
char_avail(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -1930,9 +1894,11 @@ char_avail()
|
||||
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 +1932,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 +1978,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 +2598,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 +2720,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 +2743,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 +2945,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 +3071,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 +3139,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 +3188,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 +3767,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 +3783,7 @@ map_free(mpp)
|
||||
* Initialize maphash[] for first use.
|
||||
*/
|
||||
static void
|
||||
validate_maphash()
|
||||
validate_maphash(void)
|
||||
{
|
||||
if (!maphash_valid)
|
||||
{
|
||||
@@ -3840,9 +3796,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 +3838,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 +3870,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 +3947,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 +3986,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 +4061,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 +4099,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 +4163,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 +4240,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 +4388,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 +4598,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 +4627,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 +4658,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 +4708,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 +4736,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 +4949,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 +5062,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 +5154,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 +5320,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 +5337,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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
+21
-35
@@ -2246,7 +2246,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 +2292,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();
|
||||
}
|
||||
@@ -4525,10 +4525,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 +4602,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;
|
||||
@@ -4661,8 +4657,7 @@ gui_mch_register_sign(signfile)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_sign(sign)
|
||||
void *sign;
|
||||
gui_mch_destroy_sign(void *sign)
|
||||
{
|
||||
if (sign)
|
||||
{
|
||||
@@ -4766,10 +4761,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 +4825,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 +4874,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 +4883,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 +4894,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 {{{");
|
||||
@@ -4928,11 +4915,11 @@ gui_mch_post_balloon(beval, mesg)
|
||||
|
||||
/*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 +4997,7 @@ TrackUserActivity(UINT uMsg)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_destroy_beval_area(BalloonEval *beval)
|
||||
{
|
||||
vim_free(beval);
|
||||
}
|
||||
|
||||
+6
-9
@@ -1144,7 +1144,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 +1390,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;
|
||||
@@ -2623,8 +2621,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;
|
||||
@@ -3258,7 +3255,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;
|
||||
@@ -3385,7 +3382,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 +3400,7 @@ gui_mch_maximized()
|
||||
* new Rows and Columns. This is like resizing the window.
|
||||
*/
|
||||
void
|
||||
gui_mch_newfont()
|
||||
gui_mch_newfont(void)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
|
||||
+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;
|
||||
|
||||
+84
-119
@@ -83,8 +83,7 @@ static cscmd_T cs_cmds[] =
|
||||
};
|
||||
|
||||
static void
|
||||
cs_usage_msg(x)
|
||||
csid_e x;
|
||||
cs_usage_msg(csid_e x)
|
||||
{
|
||||
(void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
|
||||
}
|
||||
@@ -104,9 +103,7 @@ static enum
|
||||
* expansion.
|
||||
*/
|
||||
char_u *
|
||||
get_cscope_name(xp, idx)
|
||||
expand_T *xp UNUSED;
|
||||
int idx;
|
||||
get_cscope_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
int current_idx;
|
||||
int i;
|
||||
@@ -167,10 +164,10 @@ get_cscope_name(xp, idx)
|
||||
* Handle command line completion for :cscope command.
|
||||
*/
|
||||
void
|
||||
set_context_in_cscope_cmd(xp, arg, cmdidx)
|
||||
expand_T *xp;
|
||||
char_u *arg;
|
||||
cmdidx_T cmdidx;
|
||||
set_context_in_cscope_cmd(
|
||||
expand_T *xp,
|
||||
char_u *arg,
|
||||
cmdidx_T cmdidx)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -210,9 +207,9 @@ set_context_in_cscope_cmd(xp, arg, cmdidx)
|
||||
* command function.
|
||||
*/
|
||||
static void
|
||||
do_cscope_general(eap, make_split)
|
||||
exarg_T *eap;
|
||||
int make_split; /* whether to split window */
|
||||
do_cscope_general(
|
||||
exarg_T *eap,
|
||||
int make_split) /* whether to split window */
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
|
||||
@@ -248,8 +245,7 @@ do_cscope_general(eap, make_split)
|
||||
* PUBLIC: do_cscope
|
||||
*/
|
||||
void
|
||||
do_cscope(eap)
|
||||
exarg_T *eap;
|
||||
do_cscope(exarg_T *eap)
|
||||
{
|
||||
do_cscope_general(eap, FALSE);
|
||||
}
|
||||
@@ -260,8 +256,7 @@ do_cscope(eap)
|
||||
* same as do_cscope, but splits window, too.
|
||||
*/
|
||||
void
|
||||
do_scscope(eap)
|
||||
exarg_T *eap;
|
||||
do_scscope(exarg_T *eap)
|
||||
{
|
||||
do_cscope_general(eap, TRUE);
|
||||
}
|
||||
@@ -271,8 +266,7 @@ do_scscope(eap)
|
||||
*
|
||||
*/
|
||||
void
|
||||
do_cstag(eap)
|
||||
exarg_T *eap;
|
||||
do_cstag(exarg_T *eap)
|
||||
{
|
||||
int ret = FALSE;
|
||||
|
||||
@@ -354,9 +348,7 @@ do_cstag(eap)
|
||||
* returns TRUE if eof, FALSE otherwise
|
||||
*/
|
||||
int
|
||||
cs_fgets(buf, size)
|
||||
char_u *buf;
|
||||
int size;
|
||||
cs_fgets(char_u *buf, int size)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@@ -374,7 +366,7 @@ cs_fgets(buf, size)
|
||||
* called only from do_tag(), when popping the tag stack
|
||||
*/
|
||||
void
|
||||
cs_free_tags()
|
||||
cs_free_tags(void)
|
||||
{
|
||||
cs_manage_matches(NULL, NULL, -1, Free);
|
||||
}
|
||||
@@ -386,7 +378,7 @@ cs_free_tags()
|
||||
* called from do_tag()
|
||||
*/
|
||||
void
|
||||
cs_print_tags()
|
||||
cs_print_tags(void)
|
||||
{
|
||||
cs_manage_matches(NULL, NULL, -1, Print);
|
||||
}
|
||||
@@ -421,10 +413,7 @@ cs_print_tags()
|
||||
*/
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
int
|
||||
cs_connection(num, dbpath, ppath)
|
||||
int num;
|
||||
char_u *dbpath;
|
||||
char_u *ppath;
|
||||
cs_connection(int num, char_u *dbpath, char_u *ppath)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -486,8 +475,7 @@ cs_connection(num, dbpath, ppath)
|
||||
* MAXPATHL 256
|
||||
*/
|
||||
static int
|
||||
cs_add(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_add(exarg_T *eap UNUSED)
|
||||
{
|
||||
char *fname, *ppath, *flags = NULL;
|
||||
|
||||
@@ -503,8 +491,7 @@ cs_add(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
cs_stat_emsg(fname)
|
||||
char *fname;
|
||||
cs_stat_emsg(char *fname)
|
||||
{
|
||||
char *stat_emsg = _("E563: stat(%s) error: %d");
|
||||
char *buf = (char *)alloc((unsigned)strlen(stat_emsg) + MAXPATHL + 10);
|
||||
@@ -528,10 +515,10 @@ cs_stat_emsg(fname)
|
||||
* routine uses a number of goto statements.
|
||||
*/
|
||||
static int
|
||||
cs_add_common(arg1, arg2, flags)
|
||||
char *arg1; /* filename - may contain environment variables */
|
||||
char *arg2; /* prepend path - may contain environment variables */
|
||||
char *flags;
|
||||
cs_add_common(
|
||||
char *arg1, /* filename - may contain environment variables */
|
||||
char *arg2, /* prepend path - may contain environment variables */
|
||||
char *flags)
|
||||
{
|
||||
struct stat statbuf;
|
||||
int ret;
|
||||
@@ -665,14 +652,14 @@ add_err:
|
||||
|
||||
|
||||
static int
|
||||
cs_check_for_connections()
|
||||
cs_check_for_connections(void)
|
||||
{
|
||||
return (cs_cnt_connections() > 0);
|
||||
} /* cs_check_for_connections */
|
||||
|
||||
|
||||
static int
|
||||
cs_check_for_tags()
|
||||
cs_check_for_tags(void)
|
||||
{
|
||||
return (p_tags[0] != NUL && curbuf->b_p_tags != NULL);
|
||||
} /* cs_check_for_tags */
|
||||
@@ -684,7 +671,7 @@ cs_check_for_tags()
|
||||
* count the number of cscope connections
|
||||
*/
|
||||
static int
|
||||
cs_cnt_connections()
|
||||
cs_cnt_connections(void)
|
||||
{
|
||||
short i;
|
||||
short cnt = 0;
|
||||
@@ -698,8 +685,8 @@ cs_cnt_connections()
|
||||
} /* cs_cnt_connections */
|
||||
|
||||
static void
|
||||
cs_reading_emsg(idx)
|
||||
int idx; /* connection index */
|
||||
cs_reading_emsg(
|
||||
int idx) /* connection index */
|
||||
{
|
||||
EMSGN(_("E262: error reading cscope connection %ld"), idx);
|
||||
}
|
||||
@@ -711,8 +698,7 @@ cs_reading_emsg(idx)
|
||||
* count the number of matches for a given cscope connection.
|
||||
*/
|
||||
static int
|
||||
cs_cnt_matches(idx)
|
||||
int idx;
|
||||
cs_cnt_matches(int idx)
|
||||
{
|
||||
char *stok;
|
||||
char *buf;
|
||||
@@ -773,9 +759,7 @@ cs_cnt_matches(idx)
|
||||
* Creates the actual cscope command query from what the user entered.
|
||||
*/
|
||||
static char *
|
||||
cs_create_cmd(csoption, pattern)
|
||||
char *csoption;
|
||||
char *pattern;
|
||||
cs_create_cmd(char *csoption, char *pattern)
|
||||
{
|
||||
char *cmd;
|
||||
short search;
|
||||
@@ -836,8 +820,7 @@ cs_create_cmd(csoption, pattern)
|
||||
* the BSD license notice?
|
||||
*/
|
||||
static int
|
||||
cs_create_connection(i)
|
||||
int i;
|
||||
cs_create_connection(int i)
|
||||
{
|
||||
#ifdef UNIX
|
||||
int to_cs[2], from_cs[2];
|
||||
@@ -1082,8 +1065,7 @@ err_closing:
|
||||
* returns TRUE if we jump to a tag or abort, FALSE if not.
|
||||
*/
|
||||
static int
|
||||
cs_find(eap)
|
||||
exarg_T *eap;
|
||||
cs_find(exarg_T *eap)
|
||||
{
|
||||
char *opt, *pat;
|
||||
int i;
|
||||
@@ -1126,13 +1108,13 @@ cs_find(eap)
|
||||
* common code for cscope find, shared by cs_find() and do_cstag()
|
||||
*/
|
||||
static int
|
||||
cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
|
||||
char *opt;
|
||||
char *pat;
|
||||
int forceit;
|
||||
int verbose;
|
||||
int use_ll UNUSED;
|
||||
char_u *cmdline UNUSED;
|
||||
cs_find_common(
|
||||
char *opt,
|
||||
char *pat,
|
||||
int forceit,
|
||||
int verbose,
|
||||
int use_ll UNUSED,
|
||||
char_u *cmdline UNUSED)
|
||||
{
|
||||
int i;
|
||||
char *cmd;
|
||||
@@ -1344,8 +1326,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
|
||||
* print help
|
||||
*/
|
||||
static int
|
||||
cs_help(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_help(exarg_T *eap UNUSED)
|
||||
{
|
||||
cscmd_T *cmdp = cs_cmds;
|
||||
|
||||
@@ -1382,8 +1363,7 @@ cs_help(eap)
|
||||
|
||||
|
||||
static void
|
||||
clear_csinfo(i)
|
||||
int i;
|
||||
clear_csinfo(int i)
|
||||
{
|
||||
csinfo[i].fname = NULL;
|
||||
csinfo[i].ppath = NULL;
|
||||
@@ -1408,7 +1388,7 @@ clear_csinfo(i)
|
||||
static char *GetWin32Error(void);
|
||||
|
||||
static char *
|
||||
GetWin32Error()
|
||||
GetWin32Error(void)
|
||||
{
|
||||
char *msg = NULL;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
@@ -1430,11 +1410,11 @@ GetWin32Error()
|
||||
* insert a new cscope database filename into the filelist
|
||||
*/
|
||||
static int
|
||||
cs_insert_filelist(fname, ppath, flags, sb)
|
||||
char *fname;
|
||||
char *ppath;
|
||||
char *flags;
|
||||
struct stat *sb UNUSED;
|
||||
cs_insert_filelist(
|
||||
char *fname,
|
||||
char *ppath,
|
||||
char *flags,
|
||||
struct stat *sb UNUSED)
|
||||
{
|
||||
short i, j;
|
||||
#ifndef UNIX
|
||||
@@ -1577,8 +1557,7 @@ cs_insert_filelist(fname, ppath, flags, sb)
|
||||
* find cscope command in command table
|
||||
*/
|
||||
static cscmd_T *
|
||||
cs_lookup_cmd(eap)
|
||||
exarg_T *eap;
|
||||
cs_lookup_cmd(exarg_T *eap)
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
char *stok;
|
||||
@@ -1609,8 +1588,7 @@ cs_lookup_cmd(eap)
|
||||
* nuke em
|
||||
*/
|
||||
static int
|
||||
cs_kill(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_kill(exarg_T *eap UNUSED)
|
||||
{
|
||||
char *stok;
|
||||
short i;
|
||||
@@ -1667,9 +1645,9 @@ cs_kill(eap)
|
||||
* Actually kills a specific cscope connection.
|
||||
*/
|
||||
static void
|
||||
cs_kill_execute(i, cname)
|
||||
int i; /* cscope table index */
|
||||
char *cname; /* cscope database name */
|
||||
cs_kill_execute(
|
||||
int i, /* cscope table index */
|
||||
char *cname) /* cscope database name */
|
||||
{
|
||||
if (p_csverbose)
|
||||
{
|
||||
@@ -1702,11 +1680,11 @@ cs_kill_execute(i, cname)
|
||||
* characters to comply with ctags formatting.
|
||||
*/
|
||||
static char *
|
||||
cs_make_vim_style_matches(fname, slno, search, tagstr)
|
||||
char *fname;
|
||||
char *slno;
|
||||
char *search;
|
||||
char *tagstr;
|
||||
cs_make_vim_style_matches(
|
||||
char *fname,
|
||||
char *slno,
|
||||
char *search,
|
||||
char *tagstr)
|
||||
{
|
||||
/* vim style is ctags:
|
||||
*
|
||||
@@ -1762,11 +1740,11 @@ cs_make_vim_style_matches(fname, slno, search, tagstr)
|
||||
* Print: prints the tags
|
||||
*/
|
||||
static char *
|
||||
cs_manage_matches(matches, contexts, totmatches, cmd)
|
||||
char **matches;
|
||||
char **contexts;
|
||||
int totmatches;
|
||||
mcmd_e cmd;
|
||||
cs_manage_matches(
|
||||
char **matches,
|
||||
char **contexts,
|
||||
int totmatches,
|
||||
mcmd_e cmd)
|
||||
{
|
||||
static char **mp = NULL;
|
||||
static char **cp = NULL;
|
||||
@@ -1829,13 +1807,13 @@ cs_manage_matches(matches, contexts, totmatches, cmd)
|
||||
* parse cscope output
|
||||
*/
|
||||
static char *
|
||||
cs_parse_results(cnumber, buf, bufsize, context, linenumber, search)
|
||||
int cnumber;
|
||||
char *buf;
|
||||
int bufsize;
|
||||
char **context;
|
||||
char **linenumber;
|
||||
char **search;
|
||||
cs_parse_results(
|
||||
int cnumber,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
char **context,
|
||||
char **linenumber,
|
||||
char **search)
|
||||
{
|
||||
int ch;
|
||||
char *p;
|
||||
@@ -1892,9 +1870,7 @@ cs_parse_results(cnumber, buf, bufsize, context, linenumber, search)
|
||||
* write cscope find results to file
|
||||
*/
|
||||
static void
|
||||
cs_file_results(f, nummatches_a)
|
||||
FILE *f;
|
||||
int *nummatches_a;
|
||||
cs_file_results(FILE *f, int *nummatches_a)
|
||||
{
|
||||
int i, j;
|
||||
char *buf;
|
||||
@@ -1951,13 +1927,13 @@ cs_file_results(f, nummatches_a)
|
||||
* When there are no matches sets "*matches_p" to NULL.
|
||||
*/
|
||||
static void
|
||||
cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
|
||||
char *tagstr;
|
||||
int totmatches;
|
||||
int *nummatches_a;
|
||||
char ***matches_p;
|
||||
char ***cntxts_p;
|
||||
int *matched;
|
||||
cs_fill_results(
|
||||
char *tagstr,
|
||||
int totmatches,
|
||||
int *nummatches_a,
|
||||
char ***matches_p,
|
||||
char ***cntxts_p,
|
||||
int *matched)
|
||||
{
|
||||
int i, j;
|
||||
char *buf;
|
||||
@@ -2031,8 +2007,7 @@ parse_out:
|
||||
|
||||
/* get the requested path components */
|
||||
static char *
|
||||
cs_pathcomponents(path)
|
||||
char *path;
|
||||
cs_pathcomponents(char *path)
|
||||
{
|
||||
int i;
|
||||
char *s;
|
||||
@@ -2063,10 +2038,7 @@ cs_pathcomponents(path)
|
||||
* called from cs_manage_matches()
|
||||
*/
|
||||
static void
|
||||
cs_print_tags_priv(matches, cntxts, num_matches)
|
||||
char **matches;
|
||||
char **cntxts;
|
||||
int num_matches;
|
||||
cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
|
||||
{
|
||||
char *buf = NULL;
|
||||
char *t_buf;
|
||||
@@ -2212,8 +2184,7 @@ cs_print_tags_priv(matches, cntxts, num_matches)
|
||||
* read a cscope prompt (basically, skip over the ">> ")
|
||||
*/
|
||||
static int
|
||||
cs_read_prompt(i)
|
||||
int i;
|
||||
cs_read_prompt(int i)
|
||||
{
|
||||
int ch;
|
||||
char *buf = NULL; /* buffer for possible error message from cscope */
|
||||
@@ -2312,9 +2283,7 @@ sig_handler SIGDEFARG(sigarg)
|
||||
* or not to free the filename. Called by cs_kill and cs_reset.
|
||||
*/
|
||||
static void
|
||||
cs_release_csp(i, freefnpp)
|
||||
int i;
|
||||
int freefnpp;
|
||||
cs_release_csp(int i, int freefnpp)
|
||||
{
|
||||
/*
|
||||
* Trying to exit normally (not sure whether it is fit to UNIX cscope
|
||||
@@ -2441,8 +2410,7 @@ cs_release_csp(i, freefnpp)
|
||||
* calls cs_kill on all cscope connections then reinits
|
||||
*/
|
||||
static int
|
||||
cs_reset(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_reset(exarg_T *eap UNUSED)
|
||||
{
|
||||
char **dblist = NULL, **pplist = NULL, **fllist = NULL;
|
||||
int i;
|
||||
@@ -2514,9 +2482,7 @@ cs_reset(eap)
|
||||
* Contrast this with my development system (Digital Unix), which does.
|
||||
*/
|
||||
static char *
|
||||
cs_resolve_file(i, name)
|
||||
int i;
|
||||
char *name;
|
||||
cs_resolve_file(int i, char *name)
|
||||
{
|
||||
char *fullname;
|
||||
int len;
|
||||
@@ -2580,8 +2546,7 @@ cs_resolve_file(i, name)
|
||||
* show all cscope connections
|
||||
*/
|
||||
static int
|
||||
cs_show(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_show(exarg_T *eap UNUSED)
|
||||
{
|
||||
short i;
|
||||
if (cs_cnt_connections() == 0)
|
||||
@@ -2616,7 +2581,7 @@ cs_show(eap)
|
||||
* Only called when VIM exits to quit any cscope sessions.
|
||||
*/
|
||||
void
|
||||
cs_end()
|
||||
cs_end(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
+20
-3
@@ -29,6 +29,19 @@
|
||||
* depend". */
|
||||
#if defined(FEAT_MZSCHEME) || defined(PROTO)
|
||||
|
||||
#ifdef PROTO
|
||||
typedef int Scheme_Object;
|
||||
typedef int Scheme_Closed_Prim;
|
||||
typedef int Scheme_Env;
|
||||
typedef int Scheme_Hash_Table;
|
||||
typedef int Scheme_Type;
|
||||
typedef int Scheme_Thread;
|
||||
typedef int Scheme_Closed_Prim;
|
||||
typedef int mzshort;
|
||||
typedef int Scheme_Prim;
|
||||
typedef int HINSTANCE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* scheme_register_tls_space is only available on 32-bit Windows until
|
||||
* racket-6.3. See
|
||||
@@ -248,7 +261,7 @@ static int window_fixup_proc(void *obj)
|
||||
# define BUFFER_REF(buf) (vim_mz_buffer *)((buf)->b_mzscheme_ref)
|
||||
#endif
|
||||
|
||||
#ifdef DYNAMIC_MZSCHEME
|
||||
#if defined(DYNAMIC_MZSCHEME) || defined(PROTO)
|
||||
static Scheme_Object *dll_scheme_eof;
|
||||
static Scheme_Object *dll_scheme_false;
|
||||
static Scheme_Object *dll_scheme_void;
|
||||
@@ -406,6 +419,8 @@ static void (*dll_scheme_register_embedded_load)(intptr_t len, const char *s);
|
||||
static void (*dll_scheme_set_config_path)(Scheme_Object *p);
|
||||
# endif
|
||||
|
||||
#if defined(DYNAMIC_MZSCHEME) /* not when defined(PROTO) */
|
||||
|
||||
/* arrays are imported directly */
|
||||
# define scheme_eof dll_scheme_eof
|
||||
# define scheme_false dll_scheme_false
|
||||
@@ -539,6 +554,8 @@ scheme_external_get_thread_local_variables(void)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
@@ -866,7 +883,7 @@ mzvim_check_threads(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MZSCHEME_GUI_THREADS
|
||||
#if defined(MZSCHEME_GUI_THREADS) || defined(PROTO)
|
||||
static void setup_timer(void);
|
||||
static void remove_timer(void);
|
||||
|
||||
@@ -3732,7 +3749,7 @@ get_vim_curr_window(void)
|
||||
}
|
||||
|
||||
static void
|
||||
make_modules()
|
||||
make_modules(void)
|
||||
{
|
||||
int i;
|
||||
Scheme_Env *mod = NULL;
|
||||
|
||||
+37
-41
@@ -631,8 +631,7 @@ perl_runtime_link_init(char *libname, int verbose)
|
||||
* There were no DLL loaded, return FALSE.
|
||||
*/
|
||||
int
|
||||
perl_enabled(verbose)
|
||||
int verbose;
|
||||
perl_enabled(int verbose)
|
||||
{
|
||||
return perl_runtime_link_init((char *)p_perldll, verbose) == OK;
|
||||
}
|
||||
@@ -644,7 +643,7 @@ perl_enabled(verbose)
|
||||
* there's nothing to actually parse.
|
||||
*/
|
||||
static void
|
||||
perl_init()
|
||||
perl_init(void)
|
||||
{
|
||||
char *bootargs[] = { "VI", NULL };
|
||||
int argc = 3;
|
||||
@@ -670,7 +669,7 @@ perl_init()
|
||||
* perl_end(): clean up after ourselves
|
||||
*/
|
||||
void
|
||||
perl_end()
|
||||
perl_end(void)
|
||||
{
|
||||
if (perl_interp)
|
||||
{
|
||||
@@ -696,9 +695,9 @@ perl_end()
|
||||
* split at '\n' first though.
|
||||
*/
|
||||
void
|
||||
msg_split(s, attr)
|
||||
char_u *s;
|
||||
int attr; /* highlighting attributes */
|
||||
msg_split(
|
||||
char_u *s,
|
||||
int attr) /* highlighting attributes */
|
||||
{
|
||||
char *next;
|
||||
char *token = (char *)s;
|
||||
@@ -719,10 +718,10 @@ msg_split(s, attr)
|
||||
* work properly.
|
||||
*/
|
||||
char_u *
|
||||
eval_to_string(arg, nextcmd, dolist)
|
||||
char_u *arg UNUSED;
|
||||
char_u **nextcmd UNUSED;
|
||||
int dolist UNUSED;
|
||||
eval_to_string(
|
||||
char_u *arg UNUSED,
|
||||
char_u **nextcmd UNUSED,
|
||||
int dolist UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -740,9 +739,7 @@ eval_to_string(arg, nextcmd, dolist)
|
||||
*/
|
||||
|
||||
static SV *
|
||||
newWINrv(rv, ptr)
|
||||
SV *rv;
|
||||
win_T *ptr;
|
||||
newWINrv(SV *rv, win_T *ptr)
|
||||
{
|
||||
sv_upgrade(rv, SVt_RV);
|
||||
if (ptr->w_perl_private == NULL)
|
||||
@@ -758,9 +755,7 @@ newWINrv(rv, ptr)
|
||||
}
|
||||
|
||||
static SV *
|
||||
newBUFrv(rv, ptr)
|
||||
SV *rv;
|
||||
buf_T *ptr;
|
||||
newBUFrv(SV *rv, buf_T *ptr)
|
||||
{
|
||||
sv_upgrade(rv, SVt_RV);
|
||||
if (ptr->b_perl_private == NULL)
|
||||
@@ -780,8 +775,7 @@ newBUFrv(rv, ptr)
|
||||
* Remove all references to the window to be destroyed
|
||||
*/
|
||||
void
|
||||
perl_win_free(wp)
|
||||
win_T *wp;
|
||||
perl_win_free(win_T *wp)
|
||||
{
|
||||
if (wp->w_perl_private)
|
||||
sv_setiv((SV *)wp->w_perl_private, 0);
|
||||
@@ -789,8 +783,7 @@ perl_win_free(wp)
|
||||
}
|
||||
|
||||
void
|
||||
perl_buf_free(bp)
|
||||
buf_T *bp;
|
||||
perl_buf_free(buf_T *bp)
|
||||
{
|
||||
if (bp->b_perl_private)
|
||||
sv_setiv((SV *)bp->b_perl_private, 0);
|
||||
@@ -834,7 +827,7 @@ struct ufuncs cb_funcs = { cur_val, 0, 1 };
|
||||
* Make the magical main::curwin and main::curbuf variables
|
||||
*/
|
||||
static void
|
||||
VIM_init()
|
||||
VIM_init(void)
|
||||
{
|
||||
static char cw[] = "main::curwin";
|
||||
static char cb[] = "main::curbuf";
|
||||
@@ -866,8 +859,7 @@ static char *e_noperl = N_("Sorry, this command is disabled: the Perl library co
|
||||
* ":perl"
|
||||
*/
|
||||
void
|
||||
ex_perl(eap)
|
||||
exarg_T *eap;
|
||||
ex_perl(exarg_T *eap)
|
||||
{
|
||||
char *err;
|
||||
char *script;
|
||||
@@ -947,8 +939,7 @@ ex_perl(eap)
|
||||
}
|
||||
|
||||
static int
|
||||
replace_line(line, end)
|
||||
linenr_T *line, *end;
|
||||
replace_line(linenr_T *line, linenr_T *end)
|
||||
{
|
||||
char *str;
|
||||
|
||||
@@ -989,8 +980,7 @@ ref_map_free(void)
|
||||
}
|
||||
|
||||
static struct ref_map_S *
|
||||
ref_map_find_SV(sv)
|
||||
SV *const sv;
|
||||
ref_map_find_SV(SV *const sv)
|
||||
{
|
||||
struct ref_map_S *refs = ref_map;
|
||||
int count = 350;
|
||||
@@ -1016,9 +1006,7 @@ ref_map_find_SV(sv)
|
||||
}
|
||||
|
||||
static int
|
||||
perl_to_vim(sv, rettv)
|
||||
SV *sv;
|
||||
typval_T *rettv;
|
||||
perl_to_vim(SV *sv, typval_T *rettv)
|
||||
{
|
||||
if (SvROK(sv))
|
||||
sv = SvRV(sv);
|
||||
@@ -1171,9 +1159,7 @@ perl_to_vim(sv, rettv)
|
||||
* "perleval()"
|
||||
*/
|
||||
void
|
||||
do_perleval(str, rettv)
|
||||
char_u *str;
|
||||
typval_T *rettv;
|
||||
do_perleval(char_u *str, typval_T *rettv)
|
||||
{
|
||||
char *err = NULL;
|
||||
STRLEN err_len = 0;
|
||||
@@ -1241,8 +1227,7 @@ do_perleval(str, rettv)
|
||||
* ":perldo".
|
||||
*/
|
||||
void
|
||||
ex_perldo(eap)
|
||||
exarg_T *eap;
|
||||
ex_perldo(exarg_T *eap)
|
||||
{
|
||||
STRLEN length;
|
||||
SV *sv;
|
||||
@@ -1314,9 +1299,21 @@ err:
|
||||
}
|
||||
|
||||
#ifndef FEAT_WINDOWS
|
||||
int win_valid(win_T *w) { return TRUE; }
|
||||
int win_count() { return 1; }
|
||||
win_T *win_find_nr(int n) { return curwin; }
|
||||
int
|
||||
win_valid(win_T *w)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
int
|
||||
win_count(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
win_T *
|
||||
win_find_nr(int n)
|
||||
{
|
||||
return curwin;
|
||||
}
|
||||
#endif
|
||||
|
||||
XS(boot_VIM);
|
||||
@@ -1513,8 +1510,7 @@ SetHeight(win, height)
|
||||
curwin = savewin;
|
||||
|
||||
void
|
||||
Cursor(win, ...)
|
||||
VIWIN win
|
||||
Cursor(VIWIN win, ...)
|
||||
|
||||
PPCODE:
|
||||
if (items == 1)
|
||||
|
||||
+6
-6
@@ -25,11 +25,11 @@
|
||||
#define NIL(type) ((type)0)
|
||||
|
||||
static int
|
||||
sfvimwrite(f, buf, n, disc)
|
||||
Sfio_t *f; /* stream involved */
|
||||
char *buf; /* buffer to read from */
|
||||
int n; /* number of bytes to write */
|
||||
Sfdisc_t *disc; /* discipline */
|
||||
sfvimwrite(
|
||||
Sfio_t *f, /* stream involved */
|
||||
char *buf, /* buffer to read from */
|
||||
int n, /* number of bytes to write */
|
||||
Sfdisc_t *disc) /* discipline */
|
||||
{
|
||||
char_u *str;
|
||||
|
||||
@@ -47,7 +47,7 @@ sfvimwrite(f, buf, n, disc)
|
||||
* Create Vim discipline
|
||||
*/
|
||||
Sfdisc_t *
|
||||
sfdcnewvim()
|
||||
sfdcnewvim(void)
|
||||
{
|
||||
Sfdisc_t *disc;
|
||||
|
||||
|
||||
+2
-2
@@ -865,7 +865,7 @@ Python_RestoreThread(void)
|
||||
#endif
|
||||
|
||||
void
|
||||
python_end()
|
||||
python_end(void)
|
||||
{
|
||||
static int recurse = 0;
|
||||
|
||||
@@ -903,7 +903,7 @@ python_end()
|
||||
|
||||
#if (defined(DYNAMIC_PYTHON) && defined(FEAT_PYTHON3)) || defined(PROTO)
|
||||
int
|
||||
python_loaded()
|
||||
python_loaded(void)
|
||||
{
|
||||
return (hinstPython != 0);
|
||||
}
|
||||
|
||||
+3
-3
@@ -695,7 +695,7 @@ python3_enabled(int verbose)
|
||||
static void get_py3_exceptions(void);
|
||||
|
||||
static void
|
||||
get_py3_exceptions()
|
||||
get_py3_exceptions(void)
|
||||
{
|
||||
PyObject *exmod = PyImport_ImportModule("builtins");
|
||||
PyObject *exdict = PyModule_GetDict(exmod);
|
||||
@@ -800,7 +800,7 @@ static PyObject *Py3Init_vim(void);
|
||||
*/
|
||||
|
||||
void
|
||||
python3_end()
|
||||
python3_end(void)
|
||||
{
|
||||
static int recurse = 0;
|
||||
|
||||
@@ -830,7 +830,7 @@ python3_end()
|
||||
|
||||
#if (defined(DYNAMIC_PYTHON3) && defined(DYNAMIC_PYTHON) && defined(FEAT_PYTHON) && defined(UNIX)) || defined(PROTO)
|
||||
int
|
||||
python3_loaded()
|
||||
python3_loaded(void)
|
||||
{
|
||||
return (hinstPy3 != 0);
|
||||
}
|
||||
|
||||
+9
-10
@@ -633,7 +633,7 @@ static struct
|
||||
* Free ruby.dll
|
||||
*/
|
||||
static void
|
||||
end_dynamic_ruby()
|
||||
end_dynamic_ruby(void)
|
||||
{
|
||||
if (hinstRuby)
|
||||
{
|
||||
@@ -682,15 +682,14 @@ ruby_runtime_link_init(char *libname, int verbose)
|
||||
* else FALSE.
|
||||
*/
|
||||
int
|
||||
ruby_enabled(verbose)
|
||||
int verbose;
|
||||
ruby_enabled(int verbose)
|
||||
{
|
||||
return ruby_runtime_link_init((char *)p_rubydll, verbose) == OK;
|
||||
}
|
||||
#endif /* defined(DYNAMIC_RUBY) || defined(PROTO) */
|
||||
|
||||
void
|
||||
ruby_end()
|
||||
ruby_end(void)
|
||||
{
|
||||
#ifdef DYNAMIC_RUBY
|
||||
end_dynamic_ruby();
|
||||
@@ -1123,12 +1122,12 @@ static buf_T *get_buf(VALUE obj)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static VALUE buffer_s_current()
|
||||
static VALUE buffer_s_current(void)
|
||||
{
|
||||
return buffer_new(curbuf);
|
||||
}
|
||||
|
||||
static VALUE buffer_s_count()
|
||||
static VALUE buffer_s_count(void)
|
||||
{
|
||||
buf_T *b;
|
||||
int n = 0;
|
||||
@@ -1365,7 +1364,7 @@ static win_T *get_win(VALUE obj)
|
||||
return win;
|
||||
}
|
||||
|
||||
static VALUE window_s_current()
|
||||
static VALUE window_s_current(void)
|
||||
{
|
||||
return window_new(curwin);
|
||||
}
|
||||
@@ -1374,7 +1373,7 @@ static VALUE window_s_current()
|
||||
* Added line manipulation functions
|
||||
* SegPhault - 03/07/05
|
||||
*/
|
||||
static VALUE line_s_current()
|
||||
static VALUE line_s_current(void)
|
||||
{
|
||||
return get_buffer_line(curbuf, curwin->w_cursor.lnum);
|
||||
}
|
||||
@@ -1384,14 +1383,14 @@ static VALUE set_current_line(VALUE self UNUSED, VALUE str)
|
||||
return set_buffer_line(curbuf, curwin->w_cursor.lnum, str);
|
||||
}
|
||||
|
||||
static VALUE current_line_number()
|
||||
static VALUE current_line_number(void)
|
||||
{
|
||||
return INT2FIX((int)curwin->w_cursor.lnum);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static VALUE window_s_count()
|
||||
static VALUE window_s_count(void)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *w;
|
||||
|
||||
+20
-39
@@ -404,7 +404,7 @@ SniffEmacsReadThread(void *dummy)
|
||||
* to process the waiting sniff requests
|
||||
*/
|
||||
void
|
||||
ProcessSniffRequests()
|
||||
ProcessSniffRequests(void)
|
||||
{
|
||||
static char buf[MAX_REQUEST_LEN];
|
||||
int len;
|
||||
@@ -433,8 +433,7 @@ ProcessSniffRequests()
|
||||
}
|
||||
|
||||
static struct sn_cmd *
|
||||
find_sniff_cmd(cmd)
|
||||
char *cmd;
|
||||
find_sniff_cmd(char *cmd)
|
||||
{
|
||||
struct sn_cmd *sniff_cmd = NULL;
|
||||
int i;
|
||||
@@ -463,10 +462,7 @@ find_sniff_cmd(cmd)
|
||||
}
|
||||
|
||||
static int
|
||||
add_sniff_cmd(cmd, def, msg)
|
||||
char *cmd;
|
||||
char *def;
|
||||
char *msg;
|
||||
add_sniff_cmd(char *cmd, char *def, char *msg)
|
||||
{
|
||||
int rc = 0;
|
||||
if (def != NULL && def[0] != NUL && find_sniff_cmd(cmd) == NULL)
|
||||
@@ -526,8 +522,7 @@ add_sniff_cmd(cmd, def, msg)
|
||||
* Handle ":sniff" command
|
||||
*/
|
||||
void
|
||||
ex_sniff(eap)
|
||||
exarg_T *eap;
|
||||
ex_sniff(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *symbol = NULL;
|
||||
@@ -593,7 +588,7 @@ ex_sniff(eap)
|
||||
|
||||
|
||||
static void
|
||||
sniff_connect()
|
||||
sniff_connect(void)
|
||||
{
|
||||
if (sniff_connected)
|
||||
return;
|
||||
@@ -609,8 +604,7 @@ sniff_connect()
|
||||
}
|
||||
|
||||
void
|
||||
sniff_disconnect(immediately)
|
||||
int immediately;
|
||||
sniff_disconnect(int immediately)
|
||||
{
|
||||
if (!sniff_connected)
|
||||
return;
|
||||
@@ -674,7 +668,7 @@ sniff_disconnect(immediately)
|
||||
* Connect to Sniff: returns 1 on error
|
||||
*/
|
||||
static int
|
||||
ConnectToSniffEmacs()
|
||||
ConnectToSniffEmacs(void)
|
||||
{
|
||||
#ifdef WIN32 /* Windows Version of the Code */
|
||||
HANDLE ToSniffEmacs[2], FromSniffEmacs[2];
|
||||
@@ -773,8 +767,7 @@ ConnectToSniffEmacs()
|
||||
* Handle one request from SNiFF+
|
||||
*/
|
||||
static void
|
||||
HandleSniffRequest(buffer)
|
||||
char *buffer;
|
||||
HandleSniffRequest(char *buffer)
|
||||
{
|
||||
char VICommand[MAX_REQUEST_LEN];
|
||||
char command;
|
||||
@@ -942,10 +935,7 @@ HandleSniffRequest(buffer)
|
||||
* <0 on error
|
||||
*/
|
||||
static int
|
||||
get_request(fd, buf, maxlen)
|
||||
int fd;
|
||||
char *buf;
|
||||
int maxlen;
|
||||
get_request(int fd, char *buf, int maxlen)
|
||||
{
|
||||
static char inbuf[1024];
|
||||
static int pos = 0, bytes = 0;
|
||||
@@ -997,9 +987,7 @@ get_request(fd, buf, maxlen)
|
||||
|
||||
|
||||
static void
|
||||
SendRequest(command, symbol)
|
||||
struct sn_cmd *command;
|
||||
char *symbol;
|
||||
SendRequest(struct sn_cmd *command, char *symbol)
|
||||
{
|
||||
int cmd_type = command->cmd_type;
|
||||
static char cmdstr[MAX_REQUEST_LEN];
|
||||
@@ -1074,8 +1062,7 @@ SendRequest(command, symbol)
|
||||
|
||||
|
||||
static void
|
||||
WriteToSniff(str)
|
||||
char *str;
|
||||
WriteToSniff(char *str)
|
||||
{
|
||||
int bytes;
|
||||
#ifdef WIN32
|
||||
@@ -1097,24 +1084,21 @@ WriteToSniff(str)
|
||||
/*-------- vim helping functions --------------------------------*/
|
||||
|
||||
static void
|
||||
vi_msg(str)
|
||||
char *str;
|
||||
vi_msg(char *str)
|
||||
{
|
||||
if (str != NULL && *str != NUL)
|
||||
MSG((char_u *)str);
|
||||
}
|
||||
|
||||
static void
|
||||
vi_error_msg(str)
|
||||
char *str;
|
||||
vi_error_msg(char *str)
|
||||
{
|
||||
if (str != NULL && *str != NUL)
|
||||
EMSG((char_u *)str);
|
||||
}
|
||||
|
||||
static void
|
||||
vi_open_file(fname)
|
||||
char *fname;
|
||||
vi_open_file(char *fname)
|
||||
{
|
||||
++no_wait_return;
|
||||
do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF,
|
||||
@@ -1124,8 +1108,7 @@ vi_open_file(fname)
|
||||
}
|
||||
|
||||
static buf_T *
|
||||
vi_find_buffer(fname)
|
||||
char *fname;
|
||||
vi_find_buffer(char *fname)
|
||||
{ /* derived from buflist_findname() [buffer.c] */
|
||||
buf_T *buf;
|
||||
|
||||
@@ -1137,7 +1120,7 @@ vi_find_buffer(fname)
|
||||
|
||||
|
||||
static char *
|
||||
vi_symbol_under_cursor()
|
||||
vi_symbol_under_cursor(void)
|
||||
{
|
||||
int len;
|
||||
char *symbolp;
|
||||
@@ -1156,14 +1139,13 @@ vi_symbol_under_cursor()
|
||||
|
||||
|
||||
static char *
|
||||
vi_buffer_name()
|
||||
vi_buffer_name(void)
|
||||
{
|
||||
return (char *)curbuf->b_sfname;
|
||||
}
|
||||
|
||||
static void
|
||||
vi_exec_cmd(vicmd)
|
||||
char *vicmd;
|
||||
vi_exec_cmd(char *vicmd)
|
||||
{
|
||||
do_cmdline_cmd((char_u *)vicmd); /* [ex_docmd.c] */
|
||||
}
|
||||
@@ -1173,8 +1155,7 @@ vi_exec_cmd(vicmd)
|
||||
* derived from cursor_pos_info() [buffer.c]
|
||||
*/
|
||||
static void
|
||||
vi_set_cursor_pos(char_pos)
|
||||
long char_pos;
|
||||
vi_set_cursor_pos(long char_pos)
|
||||
{
|
||||
linenr_T lnum;
|
||||
long char_count = 1; /* first position = 1 */
|
||||
@@ -1200,7 +1181,7 @@ vi_set_cursor_pos(char_pos)
|
||||
}
|
||||
|
||||
static long
|
||||
vi_cursor_pos()
|
||||
vi_cursor_pos(void)
|
||||
{
|
||||
linenr_T lnum;
|
||||
long char_count=1; /* sniff starts with pos 1 */
|
||||
|
||||
+112
-135
@@ -237,8 +237,7 @@ static char *find_executable_arg = NULL;
|
||||
#endif
|
||||
|
||||
void
|
||||
vim_tcl_init(arg)
|
||||
char *arg;
|
||||
vim_tcl_init(char *arg)
|
||||
{
|
||||
#ifndef DYNAMIC_TCL
|
||||
Tcl_FindExecutable(arg);
|
||||
@@ -255,8 +254,7 @@ static int stubs_initialized = FALSE;
|
||||
* Return TRUE if the TCL interface can be used.
|
||||
*/
|
||||
int
|
||||
tcl_enabled(verbose)
|
||||
int verbose;
|
||||
tcl_enabled(int verbose)
|
||||
{
|
||||
if (!stubs_initialized && find_executable_arg != NULL
|
||||
&& tcl_runtime_link_init((char *)p_tcldll, verbose) == OK)
|
||||
@@ -280,7 +278,7 @@ tcl_enabled(verbose)
|
||||
#endif
|
||||
|
||||
void
|
||||
tcl_end()
|
||||
tcl_end(void)
|
||||
{
|
||||
#ifdef DYNAMIC_TCL
|
||||
if (hTclLib)
|
||||
@@ -310,11 +308,11 @@ tcl_end()
|
||||
* useless for this routine to return the exit code via Tcl_SetResult().
|
||||
*/
|
||||
static int
|
||||
exitcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
exitcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int value = 0;
|
||||
|
||||
@@ -339,11 +337,11 @@ exitcmd(dummy, interp, objc, objv)
|
||||
* "::vim::beep" - what Vi[m] does best :-)
|
||||
*/
|
||||
static int
|
||||
beepcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
beepcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
if (objc != 1)
|
||||
{
|
||||
@@ -361,11 +359,11 @@ beepcmd(dummy, interp, objc, objv)
|
||||
* "::vim::buffer new" - create a new buffer (not implemented)
|
||||
*/
|
||||
static int
|
||||
buffercmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
buffercmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
char *name;
|
||||
buf_T *buf;
|
||||
@@ -457,11 +455,11 @@ buffercmd(dummy, interp, objc, objv)
|
||||
* "::vim::window list" - create list of window commands.
|
||||
*/
|
||||
static int
|
||||
windowcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
windowcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
char *what, *string;
|
||||
win_T *win;
|
||||
@@ -498,11 +496,11 @@ windowcmd(dummy, interp, objc, objv)
|
||||
* This function implements the buffer commands.
|
||||
*/
|
||||
static int
|
||||
bufselfcmd(ref, interp, objc, objv)
|
||||
ClientData ref;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
bufselfcmd(
|
||||
ClientData ref,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int opt, err, idx, flags;
|
||||
int val1, val2, n, i;
|
||||
@@ -937,11 +935,11 @@ bufselfcmd(ref, interp, objc, objv)
|
||||
* This function implements the window commands.
|
||||
*/
|
||||
static int
|
||||
winselfcmd(ref, interp, objc, objv)
|
||||
ClientData ref;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
winselfcmd(
|
||||
ClientData ref,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err, idx, flags;
|
||||
int val1, val2;
|
||||
@@ -1111,11 +1109,11 @@ winselfcmd(ref, interp, objc, objv)
|
||||
|
||||
|
||||
static int
|
||||
commandcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
commandcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -1125,11 +1123,11 @@ commandcmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
static int
|
||||
optioncmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
optioncmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -1139,11 +1137,11 @@ optioncmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
static int
|
||||
exprcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
exprcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
return tclvimexpr(interp, objc, objv, 1);
|
||||
}
|
||||
@@ -1156,11 +1154,11 @@ exprcmd(dummy, interp, objc, objv)
|
||||
* Get a line number from 'obj' and convert it to vim's range.
|
||||
*/
|
||||
static int
|
||||
tclgetlinenum(interp, obj, valueP, buf)
|
||||
Tcl_Interp *interp;
|
||||
Tcl_Obj *obj;
|
||||
int *valueP;
|
||||
buf_T *buf;
|
||||
tclgetlinenum(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *obj,
|
||||
int *valueP,
|
||||
buf_T *buf)
|
||||
{
|
||||
int err, i;
|
||||
|
||||
@@ -1209,8 +1207,7 @@ tclgetlinenum(interp, obj, valueP, buf)
|
||||
* Find the first window in the window list that displays the buffer.
|
||||
*/
|
||||
static win_T *
|
||||
tclfindwin(buf)
|
||||
buf_T *buf;
|
||||
tclfindwin(buf_T *buf)
|
||||
{
|
||||
win_T *win;
|
||||
|
||||
@@ -1226,11 +1223,11 @@ tclfindwin(buf)
|
||||
* Do-it-all function for "::vim::command", "$buf command" and "$win command".
|
||||
*/
|
||||
static int
|
||||
tcldoexcommand(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tcldoexcommand(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
tcl_info saveinfo;
|
||||
int err, flag, nobjs;
|
||||
@@ -1284,11 +1281,11 @@ tcldoexcommand(interp, objc, objv, objn)
|
||||
* Do-it-all function for "::vim::option", "$buf option" and "$win option".
|
||||
*/
|
||||
static int
|
||||
tclsetoption(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tclsetoption(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
int err, nobjs, idx;
|
||||
char_u *option;
|
||||
@@ -1365,11 +1362,11 @@ tclsetoption(interp, objc, objv, objn)
|
||||
* Do-it-all function for "::vim::expr", "$buf expr" and "$win expr".
|
||||
*/
|
||||
static int
|
||||
tclvimexpr(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tclvimexpr(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
char *expr, *str;
|
||||
@@ -1402,8 +1399,7 @@ tclvimexpr(interp, objc, objv, objn)
|
||||
* Check for internal vim errors.
|
||||
*/
|
||||
static int
|
||||
vimerror(interp)
|
||||
Tcl_Interp *interp;
|
||||
vimerror(Tcl_Interp *interp)
|
||||
{
|
||||
if (got_int)
|
||||
{
|
||||
@@ -1427,8 +1423,7 @@ vimerror(interp)
|
||||
* tclsetdelcmd() - add Tcl callback command to a vim object
|
||||
*/
|
||||
static void
|
||||
delref(cref)
|
||||
ClientData cref;
|
||||
delref(ClientData cref)
|
||||
{
|
||||
struct ref *ref = (struct ref *)cref;
|
||||
|
||||
@@ -1441,13 +1436,13 @@ delref(cref)
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetref(interp, refstartP, prefix, vimobj, proc)
|
||||
Tcl_Interp *interp;
|
||||
void **refstartP; /* ptr to w_tcl_ref/b_tcl-ref member of
|
||||
tclgetref(
|
||||
Tcl_Interp *interp,
|
||||
void **refstartP, /* ptr to w_tcl_ref/b_tcl-ref member of
|
||||
win_T/buf_T struct */
|
||||
char *prefix; /* "win" or "buf" */
|
||||
void *vimobj; /* win_T* or buf_T* */
|
||||
Tcl_ObjCmdProc *proc; /* winselfcmd or bufselfcmd */
|
||||
char *prefix, /* "win" or "buf" */
|
||||
void *vimobj, /* win_T* or buf_T* */
|
||||
Tcl_ObjCmdProc *proc) /* winselfcmd or bufselfcmd */
|
||||
{
|
||||
struct ref *ref, *unused = NULL;
|
||||
static char name[VARNAME_SIZE];
|
||||
@@ -1501,27 +1496,23 @@ tclgetref(interp, refstartP, prefix, vimobj, proc)
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetwindow(interp, win)
|
||||
Tcl_Interp *interp;
|
||||
win_T *win;
|
||||
tclgetwindow(Tcl_Interp *interp, win_T *win)
|
||||
{
|
||||
return tclgetref(interp, &(win->w_tcl_ref), "win", (void *)win, winselfcmd);
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetbuffer(interp, buf)
|
||||
Tcl_Interp *interp;
|
||||
buf_T *buf;
|
||||
tclgetbuffer(Tcl_Interp *interp, buf_T *buf)
|
||||
{
|
||||
return tclgetref(interp, &(buf->b_tcl_ref), "buf", (void *)buf, bufselfcmd);
|
||||
}
|
||||
|
||||
static int
|
||||
tclsetdelcmd(interp, reflist, vimobj, delcmd)
|
||||
Tcl_Interp *interp;
|
||||
struct ref *reflist;
|
||||
void *vimobj;
|
||||
Tcl_Obj *delcmd;
|
||||
tclsetdelcmd(
|
||||
Tcl_Interp *interp,
|
||||
struct ref *reflist,
|
||||
void *vimobj,
|
||||
Tcl_Obj *delcmd)
|
||||
{
|
||||
if (reflist == &refsdeleted)
|
||||
{
|
||||
@@ -1555,9 +1546,7 @@ tclsetdelcmd(interp, reflist, vimobj, delcmd)
|
||||
********************************************/
|
||||
|
||||
static int
|
||||
tcl_channel_close(instance, interp)
|
||||
ClientData instance;
|
||||
Tcl_Interp *interp UNUSED;
|
||||
tcl_channel_close(ClientData instance, Tcl_Interp *interp UNUSED)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@@ -1572,11 +1561,11 @@ tcl_channel_close(instance, interp)
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_input(instance, buf, bufsiz, errptr)
|
||||
ClientData instance UNUSED;
|
||||
char *buf UNUSED;
|
||||
int bufsiz UNUSED;
|
||||
int *errptr;
|
||||
tcl_channel_input(
|
||||
ClientData instance UNUSED,
|
||||
char *buf UNUSED,
|
||||
int bufsiz UNUSED,
|
||||
int *errptr)
|
||||
{
|
||||
|
||||
/* input is currently not supported */
|
||||
@@ -1588,11 +1577,11 @@ tcl_channel_input(instance, buf, bufsiz, errptr)
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_output(instance, buf, bufsiz, errptr)
|
||||
ClientData instance;
|
||||
char *buf;
|
||||
int bufsiz;
|
||||
int *errptr;
|
||||
tcl_channel_output(
|
||||
ClientData instance,
|
||||
const char *buf,
|
||||
int bufsiz,
|
||||
int *errptr)
|
||||
{
|
||||
char_u *str;
|
||||
int result;
|
||||
@@ -1628,18 +1617,16 @@ tcl_channel_output(instance, buf, bufsiz, errptr)
|
||||
}
|
||||
|
||||
static void
|
||||
tcl_channel_watch(instance, mask)
|
||||
ClientData instance UNUSED;
|
||||
int mask UNUSED;
|
||||
tcl_channel_watch(ClientData instance UNUSED, int mask UNUSED)
|
||||
{
|
||||
Tcl_SetErrno(EINVAL);
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_gethandle(instance, direction, handleptr)
|
||||
ClientData instance UNUSED;
|
||||
int direction UNUSED;
|
||||
ClientData *handleptr UNUSED;
|
||||
tcl_channel_gethandle(
|
||||
ClientData instance UNUSED,
|
||||
int direction UNUSED,
|
||||
ClientData *handleptr UNUSED)
|
||||
{
|
||||
Tcl_SetErrno(EINVAL);
|
||||
return EINVAL;
|
||||
@@ -1682,7 +1669,7 @@ static Tcl_ChannelType tcl_channel_type =
|
||||
**********************************/
|
||||
|
||||
static void
|
||||
tclupdatevars()
|
||||
tclupdatevars(void)
|
||||
{
|
||||
char varname[VARNAME_SIZE]; /* must be writeable */
|
||||
char *name;
|
||||
@@ -1710,8 +1697,7 @@ tclupdatevars()
|
||||
|
||||
|
||||
static int
|
||||
tclinit(eap)
|
||||
exarg_T *eap;
|
||||
tclinit(exarg_T *eap)
|
||||
{
|
||||
char varname[VARNAME_SIZE]; /* Tcl_LinkVar requires writeable varname */
|
||||
char *name;
|
||||
@@ -1820,8 +1806,7 @@ tclinit(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
tclerrmsg(text)
|
||||
char *text;
|
||||
tclerrmsg(char *text)
|
||||
{
|
||||
char *next;
|
||||
|
||||
@@ -1836,8 +1821,7 @@ tclerrmsg(text)
|
||||
}
|
||||
|
||||
static void
|
||||
tclmsg(text)
|
||||
char *text;
|
||||
tclmsg(char *text)
|
||||
{
|
||||
char *next;
|
||||
|
||||
@@ -1852,7 +1836,7 @@ tclmsg(text)
|
||||
}
|
||||
|
||||
static void
|
||||
tcldelthisinterp()
|
||||
tcldelthisinterp(void)
|
||||
{
|
||||
if (!Tcl_InterpDeleted(tclinfo.interp))
|
||||
Tcl_DeleteInterp(tclinfo.interp);
|
||||
@@ -1874,8 +1858,7 @@ tcldelthisinterp()
|
||||
}
|
||||
|
||||
static int
|
||||
tclexit(error)
|
||||
int error;
|
||||
tclexit(int error)
|
||||
{
|
||||
int newerr = OK;
|
||||
|
||||
@@ -1923,8 +1906,7 @@ tclexit(error)
|
||||
* ":tcl"
|
||||
*/
|
||||
void
|
||||
ex_tcl(eap)
|
||||
exarg_T *eap;
|
||||
ex_tcl(exarg_T *eap)
|
||||
{
|
||||
char_u *script;
|
||||
int err;
|
||||
@@ -1950,8 +1932,7 @@ ex_tcl(eap)
|
||||
* ":tclfile"
|
||||
*/
|
||||
void
|
||||
ex_tclfile(eap)
|
||||
exarg_T *eap;
|
||||
ex_tclfile(exarg_T *eap)
|
||||
{
|
||||
char *file = (char *)eap->arg;
|
||||
int err;
|
||||
@@ -1969,8 +1950,7 @@ ex_tclfile(eap)
|
||||
* ":tcldo"
|
||||
*/
|
||||
void
|
||||
ex_tcldo(eap)
|
||||
exarg_T *eap;
|
||||
ex_tcldo(exarg_T *eap)
|
||||
{
|
||||
char *script, *line;
|
||||
int err, rs, re, lnum;
|
||||
@@ -2045,8 +2025,7 @@ ex_tcldo(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
tcldelallrefs(ref)
|
||||
struct ref *ref;
|
||||
tcldelallrefs(struct ref *ref)
|
||||
{
|
||||
struct ref *next;
|
||||
int err;
|
||||
@@ -2083,8 +2062,7 @@ tcldelallrefs(ref)
|
||||
}
|
||||
|
||||
void
|
||||
tcl_buffer_free(buf)
|
||||
buf_T *buf;
|
||||
tcl_buffer_free(buf_T *buf)
|
||||
{
|
||||
struct ref *reflist;
|
||||
|
||||
@@ -2104,8 +2082,7 @@ tcl_buffer_free(buf)
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
tcl_window_free(win)
|
||||
win_T *win;
|
||||
tcl_window_free(win_T *win)
|
||||
{
|
||||
struct ref *reflist;
|
||||
|
||||
|
||||
+69
-90
@@ -215,9 +215,9 @@ static char_u *empty_prop = (char_u *)""; /* empty GetRegProp() result */
|
||||
* Returns FAIL or OK.
|
||||
*/
|
||||
int
|
||||
serverRegisterName(dpy, name)
|
||||
Display *dpy; /* display to register with */
|
||||
char_u *name; /* the name that will be used as a base */
|
||||
serverRegisterName(
|
||||
Display *dpy, /* display to register with */
|
||||
char_u *name) /* the name that will be used as a base */
|
||||
{
|
||||
int i;
|
||||
int res;
|
||||
@@ -253,9 +253,7 @@ serverRegisterName(dpy, name)
|
||||
}
|
||||
|
||||
static int
|
||||
DoRegisterName(dpy, name)
|
||||
Display *dpy;
|
||||
char_u *name;
|
||||
DoRegisterName(Display *dpy, char_u *name)
|
||||
{
|
||||
Window w;
|
||||
XErrorHandler old_handler;
|
||||
@@ -333,9 +331,9 @@ DoRegisterName(dpy, name)
|
||||
* Change any registered window ID.
|
||||
*/
|
||||
void
|
||||
serverChangeRegisteredWindow(dpy, newwin)
|
||||
Display *dpy; /* Display to register with */
|
||||
Window newwin; /* Re-register to this ID */
|
||||
serverChangeRegisteredWindow(
|
||||
Display *dpy, /* Display to register with */
|
||||
Window newwin) /* Re-register to this ID */
|
||||
{
|
||||
char_u propInfo[MAX_NAME_LENGTH + 20];
|
||||
|
||||
@@ -369,15 +367,15 @@ serverChangeRegisteredWindow(dpy, newwin)
|
||||
* Returns 0 for OK, negative for an error.
|
||||
*/
|
||||
int
|
||||
serverSendToVim(dpy, name, cmd, result, server, asExpr, localLoop, silent)
|
||||
Display *dpy; /* Where to send. */
|
||||
char_u *name; /* Where to send. */
|
||||
char_u *cmd; /* What to send. */
|
||||
char_u **result; /* Result of eval'ed expression */
|
||||
Window *server; /* Actual ID of receiving app */
|
||||
Bool asExpr; /* Interpret as keystrokes or expr ? */
|
||||
Bool localLoop; /* Throw away everything but result */
|
||||
int silent; /* don't complain about no server */
|
||||
serverSendToVim(
|
||||
Display *dpy, /* Where to send. */
|
||||
char_u *name, /* Where to send. */
|
||||
char_u *cmd, /* What to send. */
|
||||
char_u **result, /* Result of eval'ed expression */
|
||||
Window *server, /* Actual ID of receiving app */
|
||||
Bool asExpr, /* Interpret as keystrokes or expr ? */
|
||||
Bool localLoop, /* Throw away everything but result */
|
||||
int silent) /* don't complain about no server */
|
||||
{
|
||||
Window w;
|
||||
char_u *property;
|
||||
@@ -536,8 +534,7 @@ serverSendToVim(dpy, name, cmd, result, server, asExpr, localLoop, silent)
|
||||
}
|
||||
|
||||
static int
|
||||
WaitForPend(p)
|
||||
void *p;
|
||||
WaitForPend(void *p)
|
||||
{
|
||||
PendingCommand *pending = (PendingCommand *) p;
|
||||
return pending->result != NULL;
|
||||
@@ -547,9 +544,7 @@ WaitForPend(p)
|
||||
* Return TRUE if window "w" exists and has a "Vim" property on it.
|
||||
*/
|
||||
static int
|
||||
WindowValid(dpy, w)
|
||||
Display *dpy;
|
||||
Window w;
|
||||
WindowValid(Display *dpy, Window w)
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
Atom *plist;
|
||||
@@ -578,13 +573,13 @@ WindowValid(dpy, w)
|
||||
* Enter a loop processing X events & polling chars until we see a result
|
||||
*/
|
||||
static void
|
||||
ServerWait(dpy, w, endCond, endData, localLoop, seconds)
|
||||
Display *dpy;
|
||||
Window w;
|
||||
EndCond endCond;
|
||||
void *endData;
|
||||
int localLoop;
|
||||
int seconds;
|
||||
ServerWait(
|
||||
Display *dpy,
|
||||
Window w,
|
||||
EndCond endCond,
|
||||
void *endData,
|
||||
int localLoop,
|
||||
int seconds)
|
||||
{
|
||||
time_t start;
|
||||
time_t now;
|
||||
@@ -650,8 +645,7 @@ ServerWait(dpy, w, endCond, endData, localLoop, seconds)
|
||||
* Returns a newline separated list in allocated memory or NULL.
|
||||
*/
|
||||
char_u *
|
||||
serverGetVimNames(dpy)
|
||||
Display *dpy;
|
||||
serverGetVimNames(Display *dpy)
|
||||
{
|
||||
char_u *regProp;
|
||||
char_u *entry;
|
||||
@@ -705,9 +699,7 @@ serverGetVimNames(dpy)
|
||||
*/
|
||||
|
||||
static struct ServerReply *
|
||||
ServerReplyFind(w, op)
|
||||
Window w;
|
||||
enum ServerReplyOp op;
|
||||
ServerReplyFind(Window w, enum ServerReplyOp op)
|
||||
{
|
||||
struct ServerReply *p;
|
||||
struct ServerReply e;
|
||||
@@ -749,8 +741,7 @@ ServerReplyFind(w, op)
|
||||
* Issue an error if the id is invalid.
|
||||
*/
|
||||
Window
|
||||
serverStrToWin(str)
|
||||
char_u *str;
|
||||
serverStrToWin(char_u *str)
|
||||
{
|
||||
unsigned id = None;
|
||||
|
||||
@@ -766,9 +757,7 @@ serverStrToWin(str)
|
||||
* Return -1 if the window is invalid.
|
||||
*/
|
||||
int
|
||||
serverSendReply(name, str)
|
||||
char_u *name;
|
||||
char_u *str;
|
||||
serverSendReply(char_u *name, char_u *str)
|
||||
{
|
||||
char_u *property;
|
||||
int length;
|
||||
@@ -808,8 +797,7 @@ serverSendReply(name, str)
|
||||
}
|
||||
|
||||
static int
|
||||
WaitForReply(p)
|
||||
void *p;
|
||||
WaitForReply(void *p)
|
||||
{
|
||||
Window *w = (Window *) p;
|
||||
return ServerReplyFind(*w, SROP_Find) != NULL;
|
||||
@@ -821,11 +809,11 @@ WaitForReply(p)
|
||||
* Return -1 if the window becomes invalid while waiting.
|
||||
*/
|
||||
int
|
||||
serverReadReply(dpy, win, str, localLoop)
|
||||
Display *dpy;
|
||||
Window win;
|
||||
char_u **str;
|
||||
int localLoop;
|
||||
serverReadReply(
|
||||
Display *dpy,
|
||||
Window win,
|
||||
char_u **str,
|
||||
int localLoop)
|
||||
{
|
||||
int len;
|
||||
char_u *s;
|
||||
@@ -859,10 +847,7 @@ serverReadReply(dpy, win, str, localLoop)
|
||||
* Return TRUE and a non-malloc'ed string if there is. Else return FALSE.
|
||||
*/
|
||||
int
|
||||
serverPeekReply(dpy, win, str)
|
||||
Display *dpy;
|
||||
Window win;
|
||||
char_u **str;
|
||||
serverPeekReply(Display *dpy, Window win, char_u **str)
|
||||
{
|
||||
struct ServerReply *p;
|
||||
|
||||
@@ -883,8 +868,7 @@ serverPeekReply(dpy, win, str)
|
||||
* results.
|
||||
*/
|
||||
static int
|
||||
SendInit(dpy)
|
||||
Display *dpy;
|
||||
SendInit(Display *dpy)
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@@ -940,11 +924,11 @@ SendInit(dpy)
|
||||
* removed from the registry property.
|
||||
*/
|
||||
static Window
|
||||
LookupName(dpy, name, delete, loose)
|
||||
Display *dpy; /* Display whose registry to check. */
|
||||
char_u *name; /* Name of a server. */
|
||||
int delete; /* If non-zero, delete info about name. */
|
||||
char_u **loose; /* Do another search matching -999 if not found
|
||||
LookupName(
|
||||
Display *dpy, /* Display whose registry to check. */
|
||||
char_u *name, /* Name of a server. */
|
||||
int delete, /* If non-zero, delete info about name. */
|
||||
char_u **loose) /* Do another search matching -999 if not found
|
||||
Return result here if a match is found */
|
||||
{
|
||||
char_u *regProp, *entry;
|
||||
@@ -1034,9 +1018,9 @@ LookupName(dpy, name, delete, loose)
|
||||
* 3. The window will mistakenly be regarded valid because of own commWindow
|
||||
*/
|
||||
static void
|
||||
DeleteAnyLingerer(dpy, win)
|
||||
Display *dpy; /* Display whose registry to check. */
|
||||
Window win; /* Window to remove */
|
||||
DeleteAnyLingerer(
|
||||
Display *dpy, /* Display whose registry to check. */
|
||||
Window win) /* Window to remove */
|
||||
{
|
||||
char_u *regProp, *entry = NULL;
|
||||
char_u *p;
|
||||
@@ -1096,11 +1080,11 @@ DeleteAnyLingerer(dpy, win)
|
||||
* Return OK when successful.
|
||||
*/
|
||||
static int
|
||||
GetRegProp(dpy, regPropp, numItemsp, domsg)
|
||||
Display *dpy;
|
||||
char_u **regPropp;
|
||||
long_u *numItemsp;
|
||||
int domsg; /* When TRUE give error message. */
|
||||
GetRegProp(
|
||||
Display *dpy,
|
||||
char_u **regPropp,
|
||||
long_u *numItemsp,
|
||||
int domsg) /* When TRUE give error message. */
|
||||
{
|
||||
int result, actualFormat;
|
||||
long_u bytesAfter;
|
||||
@@ -1153,10 +1137,10 @@ GetRegProp(dpy, regPropp, numItemsp, domsg)
|
||||
* response.
|
||||
*/
|
||||
void
|
||||
serverEventProc(dpy, eventPtr, immediate)
|
||||
Display *dpy;
|
||||
XEvent *eventPtr; /* Information about event. */
|
||||
int immediate; /* Run event immediately. Should mostly be 0. */
|
||||
serverEventProc(
|
||||
Display *dpy,
|
||||
XEvent *eventPtr, /* Information about event. */
|
||||
int immediate) /* Run event immediately. Should mostly be 0. */
|
||||
{
|
||||
char_u *propInfo;
|
||||
int result, actualFormat;
|
||||
@@ -1198,9 +1182,7 @@ serverEventProc(dpy, eventPtr, immediate)
|
||||
* vim is idle.
|
||||
*/
|
||||
static void
|
||||
save_in_queue(propInfo, len)
|
||||
char_u *propInfo;
|
||||
long_u len;
|
||||
save_in_queue(char_u *propInfo, long_u len)
|
||||
{
|
||||
x_queue_T *node;
|
||||
|
||||
@@ -1227,7 +1209,7 @@ save_in_queue(propInfo, len)
|
||||
* Parses queued clientserver messages.
|
||||
*/
|
||||
void
|
||||
server_parse_messages()
|
||||
server_parse_messages(void)
|
||||
{
|
||||
x_queue_T *node;
|
||||
|
||||
@@ -1248,7 +1230,7 @@ server_parse_messages()
|
||||
* int the queue.
|
||||
*/
|
||||
int
|
||||
server_waiting()
|
||||
server_waiting(void)
|
||||
{
|
||||
return head.next != NULL && head.next != &head;
|
||||
}
|
||||
@@ -1259,10 +1241,10 @@ server_waiting()
|
||||
* "propInfo" will be freed.
|
||||
*/
|
||||
static void
|
||||
server_parse_message(dpy, propInfo, numItems)
|
||||
Display *dpy;
|
||||
char_u *propInfo; /* A string containing 0 or more X commands */
|
||||
long_u numItems; /* The size of propInfo in bytes. */
|
||||
server_parse_message(
|
||||
Display *dpy,
|
||||
char_u *propInfo, /* A string containing 0 or more X commands */
|
||||
long_u numItems) /* The size of propInfo in bytes. */
|
||||
{
|
||||
char_u *p;
|
||||
int code;
|
||||
@@ -1540,12 +1522,12 @@ server_parse_message(dpy, propInfo, numItems)
|
||||
* Return: 0 for OK, -1 for error
|
||||
*/
|
||||
static int
|
||||
AppendPropCarefully(dpy, window, property, value, length)
|
||||
Display *dpy; /* Display on which to operate. */
|
||||
Window window; /* Window whose property is to be modified. */
|
||||
Atom property; /* Name of property. */
|
||||
char_u *value; /* Characters to append to property. */
|
||||
int length; /* How much to append */
|
||||
AppendPropCarefully(
|
||||
Display *dpy, /* Display on which to operate. */
|
||||
Window window, /* Window whose property is to be modified. */
|
||||
Atom property, /* Name of property. */
|
||||
char_u *value, /* Characters to append to property. */
|
||||
int length) /* How much to append */
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@@ -1563,9 +1545,7 @@ AppendPropCarefully(dpy, window, property, value, length)
|
||||
* Another X Error handler, just used to check for errors.
|
||||
*/
|
||||
static int
|
||||
x_error_check(dpy, error_event)
|
||||
Display *dpy UNUSED;
|
||||
XErrorEvent *error_event UNUSED;
|
||||
x_error_check(Display *dpy UNUSED, XErrorEvent *error_event UNUSED)
|
||||
{
|
||||
got_x_error = TRUE;
|
||||
return 0;
|
||||
@@ -1576,8 +1556,7 @@ x_error_check(dpy, error_event)
|
||||
* Actually just checks if the name ends in a digit.
|
||||
*/
|
||||
static int
|
||||
IsSerialName(str)
|
||||
char_u *str;
|
||||
IsSerialName(char_u *str)
|
||||
{
|
||||
int len = STRLEN(str);
|
||||
|
||||
|
||||
+3
-3
@@ -620,8 +620,8 @@ adjust_sign_name(char *filename)
|
||||
if you want to do things differently if the editor is started standalone
|
||||
or in WorkShop mode. For example, in standalone mode you may not want to
|
||||
add a footer/message area or a sign gutter. */
|
||||
int
|
||||
workshop_invoked()
|
||||
int
|
||||
workshop_invoked(void)
|
||||
{
|
||||
static int result = -1;
|
||||
if (result == -1) {
|
||||
@@ -735,7 +735,7 @@ void workshop_connect(XtAppContext context)
|
||||
dummy = write(sd, buf, strlen(buf));
|
||||
}
|
||||
|
||||
void workshop_disconnect()
|
||||
void workshop_disconnect(void)
|
||||
{
|
||||
/* Probably need to send some message here */
|
||||
|
||||
|
||||
+330
-127
@@ -17,7 +17,7 @@
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
static int json_encode_item(garray_T *gap, typval_T *val, int copyID);
|
||||
static void json_decode_item(js_read_T *reader, typval_T *res);
|
||||
static int json_decode_item(js_read_T *reader, typval_T *res);
|
||||
|
||||
/*
|
||||
* Encode "val" into a JSON format string.
|
||||
@@ -33,6 +33,33 @@ json_encode(typval_T *val)
|
||||
return ga.ga_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode ["nr", "val"] into a JSON format string.
|
||||
* Returns NULL when out of memory.
|
||||
*/
|
||||
char_u *
|
||||
json_encode_nr_expr(int nr, typval_T *val)
|
||||
{
|
||||
typval_T listtv;
|
||||
typval_T nrtv;
|
||||
char_u *text;
|
||||
|
||||
nrtv.v_type = VAR_NUMBER;
|
||||
nrtv.vval.v_number = nr;
|
||||
if (rettv_list_alloc(&listtv) == FAIL)
|
||||
return NULL;
|
||||
if (list_append_tv(listtv.vval.v_list, &nrtv) == FAIL
|
||||
|| list_append_tv(listtv.vval.v_list, val) == FAIL)
|
||||
{
|
||||
list_unref(listtv.vval.v_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
text = json_encode(&listtv);
|
||||
list_unref(listtv.vval.v_list);
|
||||
return text;
|
||||
}
|
||||
|
||||
static void
|
||||
write_string(garray_T *gap, char_u *str)
|
||||
{
|
||||
@@ -207,37 +234,60 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* When "reader" has less than NUMBUFLEN bytes available, call the fill
|
||||
* callback to get more.
|
||||
*/
|
||||
static void
|
||||
fill_numbuflen(js_read_T *reader)
|
||||
{
|
||||
if (reader->js_fill != NULL && (int)(reader->js_end - reader->js_buf)
|
||||
- reader->js_used < NUMBUFLEN)
|
||||
{
|
||||
if (reader->js_fill(reader))
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip white space in "reader".
|
||||
* Also tops up readahead when needed.
|
||||
*/
|
||||
static void
|
||||
json_skip_white(js_read_T *reader)
|
||||
{
|
||||
int c;
|
||||
|
||||
while ((c = reader->js_buf[reader->js_used]) == ' '
|
||||
|| c == TAB || c == NL || c == CAR)
|
||||
for (;;)
|
||||
{
|
||||
c = reader->js_buf[reader->js_used];
|
||||
if (reader->js_fill != NULL && c == NUL)
|
||||
{
|
||||
if (reader->js_fill(reader))
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
continue;
|
||||
}
|
||||
if (c != ' ' && c != TAB && c != NL && c != CAR)
|
||||
break;
|
||||
++reader->js_used;
|
||||
}
|
||||
fill_numbuflen(reader);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure there are at least enough characters buffered to read a number.
|
||||
*/
|
||||
static void
|
||||
json_fill_buffer(js_read_T *reader UNUSED)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
json_decode_array(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
char_u *p;
|
||||
typval_T item;
|
||||
listitem_T *li;
|
||||
int ret;
|
||||
|
||||
if (rettv_list_alloc(res) == FAIL)
|
||||
goto failsilent;
|
||||
if (res != NULL && rettv_list_alloc(res) == FAIL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used; /* consume the '[' */
|
||||
|
||||
while (TRUE)
|
||||
@@ -245,38 +295,43 @@ json_decode_array(js_read_T *reader, typval_T *res)
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == NUL)
|
||||
goto fail;
|
||||
return MAYBE;
|
||||
if (*p == ']')
|
||||
{
|
||||
++reader->js_used; /* consume the ']' */
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!reader->js_eof && (int)(reader->js_end - p) < NUMBUFLEN)
|
||||
json_fill_buffer(reader);
|
||||
|
||||
json_decode_item(reader, &item);
|
||||
li = listitem_alloc();
|
||||
if (li == NULL)
|
||||
return;
|
||||
li->li_tv = item;
|
||||
list_append(res->vval.v_list, li);
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &item);
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
if (res != NULL)
|
||||
{
|
||||
li = listitem_alloc();
|
||||
if (li == NULL)
|
||||
{
|
||||
clear_tv(&item);
|
||||
return FAIL;
|
||||
}
|
||||
li->li_tv = item;
|
||||
list_append(res->vval.v_list, li);
|
||||
}
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != ']')
|
||||
goto fail;
|
||||
{
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
fail:
|
||||
EMSG(_(e_invarg));
|
||||
failsilent:
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
json_decode_object(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
char_u *p;
|
||||
@@ -284,10 +339,15 @@ json_decode_object(js_read_T *reader, typval_T *res)
|
||||
typval_T item;
|
||||
dictitem_T *di;
|
||||
char_u buf[NUMBUFLEN];
|
||||
char_u *key;
|
||||
char_u *key = NULL;
|
||||
int ret;
|
||||
|
||||
if (rettv_dict_alloc(res) == FAIL)
|
||||
goto failsilent;
|
||||
if (res != NULL && rettv_dict_alloc(res) == FAIL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used; /* consume the '{' */
|
||||
|
||||
while (TRUE)
|
||||
@@ -295,241 +355,384 @@ json_decode_object(js_read_T *reader, typval_T *res)
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == NUL)
|
||||
goto fail;
|
||||
return MAYBE;
|
||||
if (*p == '}')
|
||||
{
|
||||
++reader->js_used; /* consume the '}' */
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!reader->js_eof && (int)(reader->js_end - p) < NUMBUFLEN)
|
||||
json_fill_buffer(reader);
|
||||
json_decode_item(reader, &tvkey);
|
||||
key = get_tv_string_buf_chk(&tvkey, buf);
|
||||
if (key == NULL || *key == NUL)
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &tvkey);
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
if (res != NULL)
|
||||
{
|
||||
/* "key" is NULL when get_tv_string_buf_chk() gave an errmsg */
|
||||
if (key != NULL)
|
||||
EMSG(_(e_emptykey));
|
||||
clear_tv(&tvkey);
|
||||
goto failsilent;
|
||||
key = get_tv_string_buf_chk(&tvkey, buf);
|
||||
if (key == NULL || *key == NUL)
|
||||
{
|
||||
clear_tv(&tvkey);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p != ':')
|
||||
{
|
||||
clear_tv(&tvkey);
|
||||
goto fail;
|
||||
if (res != NULL)
|
||||
clear_tv(&tvkey);
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
++reader->js_used;
|
||||
json_skip_white(reader);
|
||||
|
||||
if (!reader->js_eof && (int)(reader->js_end - p) < NUMBUFLEN)
|
||||
json_fill_buffer(reader);
|
||||
json_decode_item(reader, &item);
|
||||
|
||||
di = dictitem_alloc(key);
|
||||
clear_tv(&tvkey);
|
||||
if (di == NULL)
|
||||
ret = json_decode_item(reader, res == NULL ? NULL : &item);
|
||||
if (ret != OK)
|
||||
{
|
||||
clear_tv(&item);
|
||||
goto fail;
|
||||
if (res != NULL)
|
||||
clear_tv(&tvkey);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (res != NULL)
|
||||
{
|
||||
di = dictitem_alloc(key);
|
||||
clear_tv(&tvkey);
|
||||
if (di == NULL)
|
||||
{
|
||||
clear_tv(&item);
|
||||
return FAIL;
|
||||
}
|
||||
di->di_tv = item;
|
||||
if (dict_add(res->vval.v_dict, di) == FAIL)
|
||||
{
|
||||
dictitem_free(di);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
di->di_tv = item;
|
||||
if (dict_add(res->vval.v_dict, di) == FAIL)
|
||||
dictitem_free(di);
|
||||
|
||||
json_skip_white(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
if (*p == ',')
|
||||
++reader->js_used;
|
||||
else if (*p != '}')
|
||||
goto fail;
|
||||
{
|
||||
if (*p == NUL)
|
||||
return MAYBE;
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
fail:
|
||||
EMSG(_(e_invarg));
|
||||
failsilent:
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
json_decode_string(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
garray_T ga;
|
||||
int len;
|
||||
char_u *p = reader->js_buf + reader->js_used + 1;
|
||||
char_u *p;
|
||||
int c;
|
||||
long nr;
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
ga_init2(&ga, 1, 200);
|
||||
if (res != NULL)
|
||||
ga_init2(&ga, 1, 200);
|
||||
|
||||
/* TODO: fill buffer when needed. */
|
||||
while (*p != NUL && *p != '"')
|
||||
p = reader->js_buf + reader->js_used + 1; /* skip over " */
|
||||
while (*p != '"')
|
||||
{
|
||||
if (*p == NUL || p[1] == NUL
|
||||
#ifdef FEAT_MBYTE
|
||||
|| utf_ptr2len(p) < utf_byte2len(*p)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (reader->js_fill == NULL)
|
||||
break;
|
||||
len = (int)(reader->js_end - p);
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
if (!reader->js_fill(reader))
|
||||
break; /* didn't get more */
|
||||
p = reader->js_buf + reader->js_used;
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*p == '\\')
|
||||
{
|
||||
c = -1;
|
||||
switch (p[1])
|
||||
{
|
||||
case '\\': c = '\\'; break;
|
||||
case '"': c = '"'; break;
|
||||
case 'b': c = BS; break;
|
||||
case 't': c = TAB; break;
|
||||
case 'n': c = NL; break;
|
||||
case 'f': c = FF; break;
|
||||
case 'r': c = CAR; break;
|
||||
case 'u':
|
||||
if (reader->js_fill != NULL
|
||||
&& (int)(reader->js_end - p) < NUMBUFLEN)
|
||||
{
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
if (reader->js_fill(reader))
|
||||
{
|
||||
p = reader->js_buf + reader->js_used;
|
||||
reader->js_end = reader->js_buf
|
||||
+ STRLEN(reader->js_buf);
|
||||
}
|
||||
}
|
||||
vim_str2nr(p + 2, NULL, &len,
|
||||
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4);
|
||||
p += len + 2;
|
||||
if (res != NULL)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
buf[(*mb_char2bytes)((int)nr, buf)] = NUL;
|
||||
ga_concat(&ga, buf);
|
||||
buf[(*mb_char2bytes)((int)nr, buf)] = NUL;
|
||||
ga_concat(&ga, buf);
|
||||
#else
|
||||
ga_append(&ga, nr);
|
||||
ga_append(&ga, nr);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default: c = p[1]; break;
|
||||
default:
|
||||
/* not a special char, skip over \ */
|
||||
++p;
|
||||
continue;
|
||||
}
|
||||
if (c > 0)
|
||||
{
|
||||
p += 2;
|
||||
ga_append(&ga, c);
|
||||
if (res != NULL)
|
||||
ga_append(&ga, c);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
len = MB_PTR2LEN(p);
|
||||
if (ga_grow(&ga, len) == OK)
|
||||
if (res != NULL)
|
||||
{
|
||||
if (ga_grow(&ga, len) == FAIL)
|
||||
{
|
||||
ga_clear(&ga);
|
||||
return FAIL;
|
||||
}
|
||||
mch_memmove((char *)ga.ga_data + ga.ga_len, p, (size_t)len);
|
||||
ga.ga_len += len;
|
||||
}
|
||||
p += len;
|
||||
}
|
||||
if (!reader->js_eof && (int)(reader->js_end - p) < NUMBUFLEN)
|
||||
{
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
json_fill_buffer(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
}
|
||||
}
|
||||
|
||||
reader->js_used = (int)(p - reader->js_buf);
|
||||
if (*p == '"')
|
||||
{
|
||||
++reader->js_used;
|
||||
res->v_type = VAR_STRING;
|
||||
if (ga.ga_data == NULL)
|
||||
res->vval.v_string = NULL;
|
||||
else
|
||||
res->vval.v_string = vim_strsave(ga.ga_data);
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_STRING;
|
||||
res->vval.v_string = ga.ga_data;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
else
|
||||
if (res != NULL)
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
ga_clear(&ga);
|
||||
}
|
||||
ga_clear(&ga);
|
||||
return MAYBE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode one item and put it in "result".
|
||||
* Decode one item and put it in "res". If "res" is NULL only advance.
|
||||
* Must already have skipped white space.
|
||||
*
|
||||
* Return FAIL for a decoding error.
|
||||
* Return MAYBE for an incomplete message.
|
||||
*/
|
||||
static void
|
||||
static int
|
||||
json_decode_item(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
char_u *p = reader->js_buf + reader->js_used;
|
||||
char_u *p;
|
||||
int len;
|
||||
|
||||
fill_numbuflen(reader);
|
||||
p = reader->js_buf + reader->js_used;
|
||||
switch (*p)
|
||||
{
|
||||
case '[': /* array */
|
||||
json_decode_array(reader, res);
|
||||
return;
|
||||
return json_decode_array(reader, res);
|
||||
|
||||
case '{': /* object */
|
||||
json_decode_object(reader, res);
|
||||
return;
|
||||
return json_decode_object(reader, res);
|
||||
|
||||
case '"': /* string */
|
||||
json_decode_string(reader, res);
|
||||
return;
|
||||
return json_decode_string(reader, res);
|
||||
|
||||
case ',': /* comma: empty item */
|
||||
case NUL: /* empty */
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
return;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
}
|
||||
return OK;
|
||||
|
||||
default:
|
||||
if (VIM_ISDIGIT(*p) || *p == '-')
|
||||
{
|
||||
int len;
|
||||
char_u *sp = p;
|
||||
|
||||
#ifdef FEAT_FLOAT
|
||||
if (*sp == '-')
|
||||
{
|
||||
++sp;
|
||||
if (*sp == NUL)
|
||||
return MAYBE;
|
||||
if (!VIM_ISDIGIT(*sp))
|
||||
return FAIL;
|
||||
}
|
||||
sp = skipdigits(sp);
|
||||
if (*sp == '.' || *sp == 'e' || *sp == 'E')
|
||||
{
|
||||
res->v_type = VAR_FLOAT;
|
||||
len = string2float(p, &res->vval.v_float);
|
||||
if (res == NULL)
|
||||
{
|
||||
float_T f;
|
||||
|
||||
len = string2float(p, &f);
|
||||
}
|
||||
else
|
||||
{
|
||||
res->v_type = VAR_FLOAT;
|
||||
len = string2float(p, &res->vval.v_float);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
long nr;
|
||||
|
||||
res->v_type = VAR_NUMBER;
|
||||
vim_str2nr(reader->js_buf + reader->js_used,
|
||||
NULL, &len, 0, /* what */
|
||||
&nr, NULL, 0);
|
||||
res->vval.v_number = nr;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_NUMBER;
|
||||
res->vval.v_number = nr;
|
||||
}
|
||||
}
|
||||
reader->js_used += len;
|
||||
return;
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "false", 5) == 0)
|
||||
{
|
||||
reader->js_used += 5;
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_FALSE;
|
||||
return;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_FALSE;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "true", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_TRUE;
|
||||
return;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_TRUE;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
if (STRNICMP((char *)p, "null", 4) == 0)
|
||||
{
|
||||
reader->js_used += 4;
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NULL;
|
||||
return;
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NULL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
/* check for truncated name */
|
||||
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
|
||||
if ((len < 5 && STRNICMP((char *)p, "false", len) == 0)
|
||||
|| (len < 4 && (STRNICMP((char *)p, "true", len) == 0
|
||||
|| STRNICMP((char *)p, "null", len) == 0)))
|
||||
return MAYBE;
|
||||
break;
|
||||
}
|
||||
|
||||
EMSG(_(e_invarg));
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
if (res != NUL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" and store the result in "res".
|
||||
* Return FAIL if not the whole message was consumed.
|
||||
*/
|
||||
void
|
||||
json_decode(js_read_T *reader, typval_T *res)
|
||||
int
|
||||
json_decode_all(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* We get the end once, to avoid calling strlen() many times. */
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
json_skip_white(reader);
|
||||
json_decode_item(reader, res);
|
||||
ret = json_decode_item(reader, res);
|
||||
if (ret != OK)
|
||||
return FAIL;
|
||||
json_skip_white(reader);
|
||||
if (reader->js_buf[reader->js_used] != NUL)
|
||||
EMSG(_(e_invarg));
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" and store the result in "res".
|
||||
* Return FAIL if the message has a decoding error or the message is
|
||||
* truncated. Consumes the message anyway.
|
||||
*/
|
||||
int
|
||||
json_decode(js_read_T *reader, typval_T *res)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* We get the end once, to avoid calling strlen() many times. */
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
json_skip_white(reader);
|
||||
ret = json_decode_item(reader, res);
|
||||
json_skip_white(reader);
|
||||
|
||||
return ret == OK ? OK : FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode the JSON from "reader" to find the end of the message.
|
||||
* Return FAIL if the message has a decoding error.
|
||||
* Return MAYBE if the message is truncated, need to read more.
|
||||
* This only works reliable if the message contains an object, array or
|
||||
* string. A number might be trucated without knowing.
|
||||
* Does not advance the reader.
|
||||
*/
|
||||
int
|
||||
json_find_end(js_read_T *reader)
|
||||
{
|
||||
int used_save = reader->js_used;
|
||||
int ret;
|
||||
|
||||
/* We get the end once, to avoid calling strlen() many times. */
|
||||
reader->js_end = reader->js_buf + STRLEN(reader->js_buf);
|
||||
json_skip_white(reader);
|
||||
ret = json_decode_item(reader, NULL);
|
||||
reader->js_used = used_save;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
/* vi:set ts=8 sts=4 sw=4:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* json_test.c: Unittests for json.c
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
/* Must include main.c because it contains much more than just main() */
|
||||
#define NO_VIM_MAIN
|
||||
#include "main.c"
|
||||
|
||||
/* This file has to be included because the tested functions are static */
|
||||
#include "json.c"
|
||||
|
||||
#if defined(FEAT_EVAL)
|
||||
/*
|
||||
* Test json_find_end() with imcomplete items.
|
||||
*/
|
||||
static void
|
||||
test_decode_find_end(void)
|
||||
{
|
||||
js_read_T reader;
|
||||
|
||||
reader.js_fill = NULL;
|
||||
reader.js_used = 0;
|
||||
|
||||
/* string and incomplete string */
|
||||
reader.js_buf = (char_u *)"\"hello\"";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" \"hello\" ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"\"hello";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* number and dash (incomplete number) */
|
||||
reader.js_buf = (char_u *)"123";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"-";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* false, true and null, also incomplete */
|
||||
reader.js_buf = (char_u *)"false";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"f";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"fa";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"fal";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"fals";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
reader.js_buf = (char_u *)"true";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"t";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"tr";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"tru";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
reader.js_buf = (char_u *)"null";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"n";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"nu";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"nul";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* object without white space */
|
||||
reader.js_buf = (char_u *)"{\"a\":123}";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"{\"a\":123";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"{\"a\":";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"{\"a\"";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"{\"a";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"{\"";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"{";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* object with white space */
|
||||
reader.js_buf = (char_u *)" { \"a\" : 123 } ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" { \"a\" : 123 ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" { \"a\" : ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" { \"a\" ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" { \"a ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" { ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* array without white space */
|
||||
reader.js_buf = (char_u *)"[\"a\",123]";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)"[\"a\",123";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"[\"a\",";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"[\"a\"";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"[\"a";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"[\"";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)"[";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
|
||||
/* array with white space */
|
||||
reader.js_buf = (char_u *)" [ \"a\" , 123 ] ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" [ \"a\" , ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" [ \"a\" ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" [ \"a ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
reader.js_buf = (char_u *)" [ ";
|
||||
assert(json_find_end(&reader) == MAYBE);
|
||||
}
|
||||
|
||||
static int
|
||||
fill_from_cookie(js_read_T *reader)
|
||||
{
|
||||
reader->js_buf = reader->js_cookie;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test json_find_end with an incomplete array, calling the fill function.
|
||||
*/
|
||||
static void
|
||||
test_fill_called_on_find_end(void)
|
||||
{
|
||||
js_read_T reader;
|
||||
|
||||
reader.js_fill = fill_from_cookie;
|
||||
reader.js_used = 0;
|
||||
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
|
||||
reader.js_cookie = " [ \"a\" , 123 ] ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" [ \"a\" , ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" [ \"a\" ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" [ \"a";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
reader.js_buf = (char_u *)" [ ";
|
||||
assert(json_find_end(&reader) == OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test json_find_end with an incomplete string, calling the fill function.
|
||||
*/
|
||||
static void
|
||||
test_fill_called_on_string(void)
|
||||
{
|
||||
js_read_T reader;
|
||||
|
||||
reader.js_fill = fill_from_cookie;
|
||||
reader.js_used = 0;
|
||||
reader.js_buf = (char_u *)" \"foo";
|
||||
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
|
||||
reader.js_cookie = " \"foobar\" ";
|
||||
assert(json_decode_string(&reader, NULL) == OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
#if defined(FEAT_EVAL)
|
||||
test_decode_find_end();
|
||||
test_fill_called_on_find_end();
|
||||
test_fill_called_on_string();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
+56
-78
@@ -165,9 +165,7 @@ VimMain
|
||||
# else
|
||||
main
|
||||
# endif
|
||||
(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
(int argc, char **argv)
|
||||
{
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
@@ -1607,10 +1605,10 @@ getout(int exitval)
|
||||
* Get a (optional) count for a Vim argument.
|
||||
*/
|
||||
static int
|
||||
get_number_arg(p, idx, def)
|
||||
char_u *p; /* pointer to argument */
|
||||
int *idx; /* index in argument, is incremented */
|
||||
int def; /* default value */
|
||||
get_number_arg(
|
||||
char_u *p, /* pointer to argument */
|
||||
int *idx, /* index in argument, is incremented */
|
||||
int def) /* default value */
|
||||
{
|
||||
if (vim_isdigit(p[*idx]))
|
||||
{
|
||||
@@ -1626,7 +1624,7 @@ get_number_arg(p, idx, def)
|
||||
* Setup to use the current locale (for ctype() and many other things).
|
||||
*/
|
||||
static void
|
||||
init_locale()
|
||||
init_locale(void)
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
@@ -1682,8 +1680,7 @@ init_locale()
|
||||
* by "im" use improved Ex mode.
|
||||
*/
|
||||
static void
|
||||
parse_command_name(parmp)
|
||||
mparm_T *parmp;
|
||||
parse_command_name(mparm_T *parmp)
|
||||
{
|
||||
char_u *initstr;
|
||||
|
||||
@@ -1773,8 +1770,7 @@ parse_command_name(parmp)
|
||||
* Also find the --server... arguments and --socketid and --windowid
|
||||
*/
|
||||
static void
|
||||
early_arg_scan(parmp)
|
||||
mparm_T *parmp UNUSED;
|
||||
early_arg_scan(mparm_T *parmp UNUSED)
|
||||
{
|
||||
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \
|
||||
|| !defined(FEAT_NETBEANS_INTG)
|
||||
@@ -1865,8 +1861,7 @@ early_arg_scan(parmp)
|
||||
* Scan the command line arguments.
|
||||
*/
|
||||
static void
|
||||
command_line_scan(parmp)
|
||||
mparm_T *parmp;
|
||||
command_line_scan(mparm_T *parmp)
|
||||
{
|
||||
int argc = parmp->argc;
|
||||
char **argv = parmp->argv;
|
||||
@@ -2591,8 +2586,7 @@ scripterror:
|
||||
* When starting in Ex mode and commands come from a file, set Silent mode.
|
||||
*/
|
||||
static void
|
||||
check_tty(parmp)
|
||||
mparm_T *parmp;
|
||||
check_tty(mparm_T *parmp)
|
||||
{
|
||||
int input_isatty; /* is active input a terminal? */
|
||||
|
||||
@@ -2638,7 +2632,7 @@ check_tty(parmp)
|
||||
* Read text from stdin.
|
||||
*/
|
||||
static void
|
||||
read_stdin()
|
||||
read_stdin(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2672,8 +2666,7 @@ read_stdin()
|
||||
* Also does recovery if "recoverymode" set.
|
||||
*/
|
||||
static void
|
||||
create_windows(parmp)
|
||||
mparm_T *parmp UNUSED;
|
||||
create_windows(mparm_T *parmp UNUSED)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
int dorewind;
|
||||
@@ -2826,9 +2819,9 @@ create_windows(parmp)
|
||||
* windows. make_windows() has already opened the windows.
|
||||
*/
|
||||
static void
|
||||
edit_buffers(parmp, cwd)
|
||||
mparm_T *parmp;
|
||||
char_u *cwd; /* current working dir */
|
||||
edit_buffers(
|
||||
mparm_T *parmp,
|
||||
char_u *cwd) /* current working dir */
|
||||
{
|
||||
int arg_idx; /* index in argument list */
|
||||
int i;
|
||||
@@ -2955,8 +2948,7 @@ edit_buffers(parmp, cwd)
|
||||
* Execute the commands from --cmd arguments "cmds[cnt]".
|
||||
*/
|
||||
static void
|
||||
exe_pre_commands(parmp)
|
||||
mparm_T *parmp;
|
||||
exe_pre_commands(mparm_T *parmp)
|
||||
{
|
||||
char_u **cmds = parmp->pre_commands;
|
||||
int cnt = parmp->n_pre_commands;
|
||||
@@ -2983,8 +2975,7 @@ exe_pre_commands(parmp)
|
||||
* Execute "+", "-c" and "-S" arguments.
|
||||
*/
|
||||
static void
|
||||
exe_commands(parmp)
|
||||
mparm_T *parmp;
|
||||
exe_commands(mparm_T *parmp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -3028,8 +3019,7 @@ exe_commands(parmp)
|
||||
* Source startup scripts.
|
||||
*/
|
||||
static void
|
||||
source_startup_scripts(parmp)
|
||||
mparm_T *parmp;
|
||||
source_startup_scripts(mparm_T *parmp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -3187,7 +3177,7 @@ source_startup_scripts(parmp)
|
||||
* Setup to start using the GUI. Exit with an error when not available.
|
||||
*/
|
||||
static void
|
||||
main_start_gui()
|
||||
main_start_gui(void)
|
||||
{
|
||||
#ifdef FEAT_GUI
|
||||
gui.starting = TRUE; /* start GUI a bit later */
|
||||
@@ -3205,9 +3195,9 @@ main_start_gui()
|
||||
* Returns FAIL if the environment variable was not executed, OK otherwise.
|
||||
*/
|
||||
int
|
||||
process_env(env, is_viminit)
|
||||
char_u *env;
|
||||
int is_viminit; /* when TRUE, called for VIMINIT */
|
||||
process_env(
|
||||
char_u *env,
|
||||
int is_viminit) /* when TRUE, called for VIMINIT */
|
||||
{
|
||||
char_u *initstr;
|
||||
char_u *save_sourcing_name;
|
||||
@@ -3246,8 +3236,7 @@ process_env(env, is_viminit)
|
||||
* Use both stat() and lstat() for extra security.
|
||||
*/
|
||||
static int
|
||||
file_owned(fname)
|
||||
char *fname;
|
||||
file_owned(char *fname)
|
||||
{
|
||||
struct stat s;
|
||||
# ifdef UNIX
|
||||
@@ -3268,9 +3257,9 @@ file_owned(fname)
|
||||
* Give an error message main_errors["n"] and exit.
|
||||
*/
|
||||
static void
|
||||
mainerr(n, str)
|
||||
int n; /* one of the ME_ defines */
|
||||
char_u *str; /* extra argument or NULL */
|
||||
mainerr(
|
||||
int n, /* one of the ME_ defines */
|
||||
char_u *str) /* extra argument or NULL */
|
||||
{
|
||||
#if defined(UNIX) || defined(__EMX__) || defined(VMS)
|
||||
reset_signals(); /* kill us with CTRL-C here, if you like */
|
||||
@@ -3291,8 +3280,7 @@ mainerr(n, str)
|
||||
}
|
||||
|
||||
void
|
||||
mainerr_arg_missing(str)
|
||||
char_u *str;
|
||||
mainerr_arg_missing(char_u *str)
|
||||
{
|
||||
mainerr(ME_ARG_MISSING, str);
|
||||
}
|
||||
@@ -3302,8 +3290,7 @@ mainerr_arg_missing(str)
|
||||
* print a message with three spaces prepended and '\n' appended.
|
||||
*/
|
||||
static void
|
||||
main_msg(s)
|
||||
char *s;
|
||||
main_msg(char *s)
|
||||
{
|
||||
mch_msg(" ");
|
||||
mch_msg(s);
|
||||
@@ -3314,7 +3301,7 @@ main_msg(s)
|
||||
* Print messages for "vim -h" or "vim --help" and exit.
|
||||
*/
|
||||
static void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
int i;
|
||||
static char *(use[]) =
|
||||
@@ -3510,7 +3497,7 @@ usage()
|
||||
* When "Recover" selected, recover the file.
|
||||
*/
|
||||
static void
|
||||
check_swap_exists_action()
|
||||
check_swap_exists_action(void)
|
||||
{
|
||||
if (swap_exists_action == SEA_QUIT)
|
||||
getout(1);
|
||||
@@ -3544,8 +3531,7 @@ gettimeofday(struct timeval *tv, char *dummy)
|
||||
* set "*tv_rel" to the time elapsed so far.
|
||||
*/
|
||||
void
|
||||
time_push(tv_rel, tv_start)
|
||||
void *tv_rel, *tv_start;
|
||||
time_push(void *tv_rel, void *tv_start)
|
||||
{
|
||||
*((struct timeval *)tv_rel) = prev_timeval;
|
||||
gettimeofday(&prev_timeval, NULL);
|
||||
@@ -3568,8 +3554,8 @@ time_push(tv_rel, tv_start)
|
||||
* have struct timeval.
|
||||
*/
|
||||
void
|
||||
time_pop(tp)
|
||||
void *tp; /* actually (struct timeval *) */
|
||||
time_pop(
|
||||
void *tp) /* actually (struct timeval *) */
|
||||
{
|
||||
prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec;
|
||||
prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec;
|
||||
@@ -3581,9 +3567,7 @@ time_pop(tp)
|
||||
}
|
||||
|
||||
static void
|
||||
time_diff(then, now)
|
||||
struct timeval *then;
|
||||
struct timeval *now;
|
||||
time_diff(struct timeval *then, struct timeval *now)
|
||||
{
|
||||
long usec;
|
||||
long msec;
|
||||
@@ -3595,9 +3579,9 @@ time_diff(then, now)
|
||||
}
|
||||
|
||||
void
|
||||
time_msg(mesg, tv_start)
|
||||
char *mesg;
|
||||
void *tv_start; /* only for do_source: start time; actually
|
||||
time_msg(
|
||||
char *mesg,
|
||||
void *tv_start) /* only for do_source: start time; actually
|
||||
(struct timeval *) */
|
||||
{
|
||||
static struct timeval start;
|
||||
@@ -3641,8 +3625,7 @@ static char_u *build_drop_cmd(int filec, char **filev, int tabs, int sendReply);
|
||||
* Do the client-server stuff, unless "--servername ''" was used.
|
||||
*/
|
||||
static void
|
||||
exec_on_server(parmp)
|
||||
mparm_T *parmp;
|
||||
exec_on_server(mparm_T *parmp)
|
||||
{
|
||||
if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL)
|
||||
{
|
||||
@@ -3684,8 +3667,7 @@ exec_on_server(parmp)
|
||||
* Prepare for running as a Vim server.
|
||||
*/
|
||||
static void
|
||||
prepare_server(parmp)
|
||||
mparm_T *parmp;
|
||||
prepare_server(mparm_T *parmp)
|
||||
{
|
||||
# if defined(FEAT_X11)
|
||||
/*
|
||||
@@ -3727,11 +3709,11 @@ prepare_server(parmp)
|
||||
}
|
||||
|
||||
static void
|
||||
cmdsrv_main(argc, argv, serverName_arg, serverStr)
|
||||
int *argc;
|
||||
char **argv;
|
||||
char_u *serverName_arg;
|
||||
char_u **serverStr;
|
||||
cmdsrv_main(
|
||||
int *argc,
|
||||
char **argv,
|
||||
char_u *serverName_arg,
|
||||
char_u **serverStr)
|
||||
{
|
||||
char_u *res;
|
||||
int i;
|
||||
@@ -4011,11 +3993,11 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr)
|
||||
* Build a ":drop" command to send to a Vim server.
|
||||
*/
|
||||
static char_u *
|
||||
build_drop_cmd(filec, filev, tabs, sendReply)
|
||||
int filec;
|
||||
char **filev;
|
||||
int tabs; /* Use ":tab drop" instead of ":drop". */
|
||||
int sendReply;
|
||||
build_drop_cmd(
|
||||
int filec,
|
||||
char **filev,
|
||||
int tabs, /* Use ":tab drop" instead of ":drop". */
|
||||
int sendReply)
|
||||
{
|
||||
garray_T ga;
|
||||
int i;
|
||||
@@ -4131,9 +4113,7 @@ build_drop_cmd(filec, filev, tabs, sendReply)
|
||||
* Return the name in allocated memory. This doesn't include a serial number.
|
||||
*/
|
||||
static char_u *
|
||||
serverMakeName(arg, cmd)
|
||||
char_u *arg;
|
||||
char *cmd;
|
||||
serverMakeName(char_u *arg, char *cmd)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -4155,8 +4135,7 @@ serverMakeName(arg, cmd)
|
||||
* Replace termcodes such as <CR> and insert as key presses if there is room.
|
||||
*/
|
||||
void
|
||||
server_to_input_buf(str)
|
||||
char_u *str;
|
||||
server_to_input_buf(char_u *str)
|
||||
{
|
||||
char_u *ptr = NULL;
|
||||
char_u *cpo_save = p_cpo;
|
||||
@@ -4197,8 +4176,7 @@ server_to_input_buf(str)
|
||||
* Evaluate an expression that the client sent to a string.
|
||||
*/
|
||||
char_u *
|
||||
eval_client_expr_to_string(expr)
|
||||
char_u *expr;
|
||||
eval_client_expr_to_string(char_u *expr)
|
||||
{
|
||||
char_u *res;
|
||||
int save_dbl = debug_break_level;
|
||||
@@ -4238,10 +4216,10 @@ eval_client_expr_to_string(expr)
|
||||
* "*tofree" is set to the result when it needs to be freed later.
|
||||
*/
|
||||
char_u *
|
||||
serverConvert(client_enc, data, tofree)
|
||||
char_u *client_enc UNUSED;
|
||||
char_u *data;
|
||||
char_u **tofree;
|
||||
serverConvert(
|
||||
char_u *client_enc UNUSED,
|
||||
char_u *data,
|
||||
char_u **tofree)
|
||||
{
|
||||
char_u *res = data;
|
||||
|
||||
|
||||
+65
-103
@@ -43,8 +43,7 @@ static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2);
|
||||
* Returns OK on success, FAIL if bad name given.
|
||||
*/
|
||||
int
|
||||
setmark(c)
|
||||
int c;
|
||||
setmark(int c)
|
||||
{
|
||||
return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum);
|
||||
}
|
||||
@@ -55,10 +54,7 @@ setmark(c)
|
||||
* Returns OK on success, FAIL if bad name given.
|
||||
*/
|
||||
int
|
||||
setmark_pos(c, pos, fnum)
|
||||
int c;
|
||||
pos_T *pos;
|
||||
int fnum;
|
||||
setmark_pos(int c, pos_T *pos, int fnum)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -138,7 +134,7 @@ setmark_pos(c, pos, fnum)
|
||||
* jump list.
|
||||
*/
|
||||
void
|
||||
setpcmark()
|
||||
setpcmark(void)
|
||||
{
|
||||
#ifdef FEAT_JUMPLIST
|
||||
int i;
|
||||
@@ -198,7 +194,7 @@ setpcmark()
|
||||
* If pcmark was deleted (with "dG") the previous mark is restored.
|
||||
*/
|
||||
void
|
||||
checkpcmark()
|
||||
checkpcmark(void)
|
||||
{
|
||||
if (curwin->w_prev_pcmark.lnum != 0
|
||||
&& (equalpos(curwin->w_pcmark, curwin->w_cursor)
|
||||
@@ -214,8 +210,7 @@ checkpcmark()
|
||||
* move "count" positions in the jump list (count may be negative)
|
||||
*/
|
||||
pos_T *
|
||||
movemark(count)
|
||||
int count;
|
||||
movemark(int count)
|
||||
{
|
||||
pos_T *pos;
|
||||
xfmark_T *jmp;
|
||||
@@ -274,8 +269,7 @@ movemark(count)
|
||||
* Move "count" positions in the changelist (count may be negative).
|
||||
*/
|
||||
pos_T *
|
||||
movechangelist(count)
|
||||
int count;
|
||||
movechangelist(int count)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -314,28 +308,23 @@ movechangelist(count)
|
||||
* - -1 if mark is in other file and jumped there (only if changefile is TRUE)
|
||||
*/
|
||||
pos_T *
|
||||
getmark_buf(buf, c, changefile)
|
||||
buf_T *buf;
|
||||
int c;
|
||||
int changefile;
|
||||
getmark_buf(buf_T *buf, int c, int changefile)
|
||||
{
|
||||
return getmark_buf_fnum(buf, c, changefile, NULL);
|
||||
}
|
||||
|
||||
pos_T *
|
||||
getmark(c, changefile)
|
||||
int c;
|
||||
int changefile;
|
||||
getmark(int c, int changefile)
|
||||
{
|
||||
return getmark_buf_fnum(curbuf, c, changefile, NULL);
|
||||
}
|
||||
|
||||
pos_T *
|
||||
getmark_buf_fnum(buf, c, changefile, fnum)
|
||||
buf_T *buf;
|
||||
int c;
|
||||
int changefile;
|
||||
int *fnum;
|
||||
getmark_buf_fnum(
|
||||
buf_T *buf,
|
||||
int c,
|
||||
int changefile,
|
||||
int *fnum)
|
||||
{
|
||||
pos_T *posp;
|
||||
pos_T *startp, *endp;
|
||||
@@ -472,10 +461,10 @@ getmark_buf_fnum(buf, c, changefile, fnum)
|
||||
* Returns pointer to pos_T of the next mark or NULL if no mark is found.
|
||||
*/
|
||||
pos_T *
|
||||
getnextmark(startpos, dir, begin_line)
|
||||
pos_T *startpos; /* where to start */
|
||||
int dir; /* direction for search */
|
||||
int begin_line;
|
||||
getnextmark(
|
||||
pos_T *startpos, /* where to start */
|
||||
int dir, /* direction for search */
|
||||
int begin_line)
|
||||
{
|
||||
int i;
|
||||
pos_T *result = NULL;
|
||||
@@ -520,8 +509,7 @@ getnextmark(startpos, dir, begin_line)
|
||||
* until the mark is used to avoid a long startup delay.
|
||||
*/
|
||||
static void
|
||||
fname2fnum(fm)
|
||||
xfmark_T *fm;
|
||||
fname2fnum(xfmark_T *fm)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -561,8 +549,7 @@ fname2fnum(fm)
|
||||
* Used for marks that come from the .viminfo file.
|
||||
*/
|
||||
void
|
||||
fmarks_check_names(buf)
|
||||
buf_T *buf;
|
||||
fmarks_check_names(buf_T *buf)
|
||||
{
|
||||
char_u *name;
|
||||
int i;
|
||||
@@ -592,10 +579,7 @@ fmarks_check_names(buf)
|
||||
}
|
||||
|
||||
static void
|
||||
fmarks_check_one(fm, name, buf)
|
||||
xfmark_T *fm;
|
||||
char_u *name;
|
||||
buf_T *buf;
|
||||
fmarks_check_one(xfmark_T *fm, char_u *name, buf_T *buf)
|
||||
{
|
||||
if (fm->fmark.fnum == 0
|
||||
&& fm->fname != NULL
|
||||
@@ -612,8 +596,7 @@ fmarks_check_one(fm, name, buf)
|
||||
* Give and error message and return FAIL if not.
|
||||
*/
|
||||
int
|
||||
check_mark(pos)
|
||||
pos_T *pos;
|
||||
check_mark(pos_T *pos)
|
||||
{
|
||||
if (pos == NULL)
|
||||
{
|
||||
@@ -642,8 +625,7 @@ check_mark(pos)
|
||||
* Used mainly when trashing the entire buffer during ":e" type commands
|
||||
*/
|
||||
void
|
||||
clrallmarks(buf)
|
||||
buf_T *buf;
|
||||
clrallmarks(buf_T *buf)
|
||||
{
|
||||
static int i = -1;
|
||||
|
||||
@@ -676,9 +658,7 @@ clrallmarks(buf)
|
||||
* Returns an allocated string.
|
||||
*/
|
||||
char_u *
|
||||
fm_getname(fmark, lead_len)
|
||||
fmark_T *fmark;
|
||||
int lead_len;
|
||||
fm_getname(fmark_T *fmark, int lead_len)
|
||||
{
|
||||
if (fmark->fnum == curbuf->b_fnum) /* current buffer */
|
||||
return mark_line(&(fmark->mark), lead_len);
|
||||
@@ -690,9 +670,7 @@ fm_getname(fmark, lead_len)
|
||||
* The returned string has been allocated.
|
||||
*/
|
||||
static char_u *
|
||||
mark_line(mp, lead_len)
|
||||
pos_T *mp;
|
||||
int lead_len;
|
||||
mark_line(pos_T *mp, int lead_len)
|
||||
{
|
||||
char_u *s, *p;
|
||||
int len;
|
||||
@@ -718,8 +696,7 @@ mark_line(mp, lead_len)
|
||||
* print the marks
|
||||
*/
|
||||
void
|
||||
do_marks(eap)
|
||||
exarg_T *eap;
|
||||
do_marks(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
int i;
|
||||
@@ -757,12 +734,12 @@ do_marks(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
show_one_mark(c, arg, p, name, current)
|
||||
int c;
|
||||
char_u *arg;
|
||||
pos_T *p;
|
||||
char_u *name;
|
||||
int current; /* in current file */
|
||||
show_one_mark(
|
||||
int c,
|
||||
char_u *arg,
|
||||
pos_T *p,
|
||||
char_u *name,
|
||||
int current) /* in current file */
|
||||
{
|
||||
static int did_title = FALSE;
|
||||
int mustfree = FALSE;
|
||||
@@ -815,8 +792,7 @@ show_one_mark(c, arg, p, name, current)
|
||||
* ":delmarks[!] [marks]"
|
||||
*/
|
||||
void
|
||||
ex_delmarks(eap)
|
||||
exarg_T *eap;
|
||||
ex_delmarks(exarg_T *eap)
|
||||
{
|
||||
char_u *p;
|
||||
int from, to;
|
||||
@@ -899,8 +875,7 @@ ex_delmarks(eap)
|
||||
* print the jumplist
|
||||
*/
|
||||
void
|
||||
ex_jumps(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_jumps(exarg_T *eap UNUSED)
|
||||
{
|
||||
int i;
|
||||
char_u *name;
|
||||
@@ -947,8 +922,7 @@ ex_jumps(eap)
|
||||
* print the changelist
|
||||
*/
|
||||
void
|
||||
ex_changes(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
ex_changes(exarg_T *eap UNUSED)
|
||||
{
|
||||
int i;
|
||||
char_u *name;
|
||||
@@ -1025,11 +999,11 @@ ex_changes(eap)
|
||||
* or: mark_adjust(56, 55, MAXLNUM, 2);
|
||||
*/
|
||||
void
|
||||
mark_adjust(line1, line2, amount, amount_after)
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
mark_adjust(
|
||||
linenr_T line1,
|
||||
linenr_T line2,
|
||||
long amount,
|
||||
long amount_after)
|
||||
{
|
||||
int i;
|
||||
int fnum = curbuf->b_fnum;
|
||||
@@ -1207,11 +1181,11 @@ mark_adjust(line1, line2, amount, amount_after)
|
||||
* position.
|
||||
*/
|
||||
void
|
||||
mark_col_adjust(lnum, mincol, lnum_amount, col_amount)
|
||||
linenr_T lnum;
|
||||
colnr_T mincol;
|
||||
long lnum_amount;
|
||||
long col_amount;
|
||||
mark_col_adjust(
|
||||
linenr_T lnum,
|
||||
colnr_T mincol,
|
||||
long lnum_amount,
|
||||
long col_amount)
|
||||
{
|
||||
int i;
|
||||
int fnum = curbuf->b_fnum;
|
||||
@@ -1291,7 +1265,7 @@ mark_col_adjust(lnum, mincol, lnum_amount, col_amount)
|
||||
* jumplist. They will be removed here for the current window.
|
||||
*/
|
||||
static void
|
||||
cleanup_jumplist()
|
||||
cleanup_jumplist(void)
|
||||
{
|
||||
int i;
|
||||
int from, to;
|
||||
@@ -1323,9 +1297,7 @@ cleanup_jumplist()
|
||||
* Copy the jumplist from window "from" to window "to".
|
||||
*/
|
||||
void
|
||||
copy_jumplist(from, to)
|
||||
win_T *from;
|
||||
win_T *to;
|
||||
copy_jumplist(win_T *from, win_T *to)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1343,8 +1315,7 @@ copy_jumplist(from, to)
|
||||
* Free items in the jumplist of window "wp".
|
||||
*/
|
||||
void
|
||||
free_jumplist(wp)
|
||||
win_T *wp;
|
||||
free_jumplist(win_T *wp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1355,8 +1326,7 @@ free_jumplist(wp)
|
||||
#endif /* FEAT_JUMPLIST */
|
||||
|
||||
void
|
||||
set_last_cursor(win)
|
||||
win_T *win;
|
||||
set_last_cursor(win_T *win)
|
||||
{
|
||||
if (win->w_buffer != NULL)
|
||||
win->w_buffer->b_last_cursor = win->w_cursor;
|
||||
@@ -1364,7 +1334,7 @@ set_last_cursor(win)
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
free_all_marks()
|
||||
free_all_marks(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1376,9 +1346,7 @@ free_all_marks()
|
||||
|
||||
#if defined(FEAT_VIMINFO) || defined(PROTO)
|
||||
int
|
||||
read_viminfo_filemark(virp, force)
|
||||
vir_T *virp;
|
||||
int force;
|
||||
read_viminfo_filemark(vir_T *virp, int force)
|
||||
{
|
||||
char_u *str;
|
||||
xfmark_T *fm;
|
||||
@@ -1438,8 +1406,7 @@ read_viminfo_filemark(virp, force)
|
||||
}
|
||||
|
||||
void
|
||||
write_viminfo_filemarks(fp)
|
||||
FILE *fp;
|
||||
write_viminfo_filemarks(FILE *fp)
|
||||
{
|
||||
int i;
|
||||
char_u *name;
|
||||
@@ -1499,11 +1466,11 @@ write_viminfo_filemarks(fp)
|
||||
}
|
||||
|
||||
static void
|
||||
write_one_filemark(fp, fm, c1, c2)
|
||||
FILE *fp;
|
||||
xfmark_T *fm;
|
||||
int c1;
|
||||
int c2;
|
||||
write_one_filemark(
|
||||
FILE *fp,
|
||||
xfmark_T *fm,
|
||||
int c1,
|
||||
int c2)
|
||||
{
|
||||
char_u *name;
|
||||
|
||||
@@ -1529,8 +1496,7 @@ write_one_filemark(fp, fm, c1, c2)
|
||||
* Return TRUE if "name" is on removable media (depending on 'viminfo').
|
||||
*/
|
||||
int
|
||||
removable(name)
|
||||
char_u *name;
|
||||
removable(char_u *name)
|
||||
{
|
||||
char_u *p;
|
||||
char_u part[51];
|
||||
@@ -1565,8 +1531,7 @@ static void write_one_mark(FILE *fp_out, int c, pos_T *pos);
|
||||
* Return the number of buffers for which marks have been written.
|
||||
*/
|
||||
int
|
||||
write_viminfo_marks(fp_out)
|
||||
FILE *fp_out;
|
||||
write_viminfo_marks(FILE *fp_out)
|
||||
{
|
||||
int count;
|
||||
buf_T *buf;
|
||||
@@ -1632,10 +1597,7 @@ write_viminfo_marks(fp_out)
|
||||
}
|
||||
|
||||
static void
|
||||
write_one_mark(fp_out, c, pos)
|
||||
FILE *fp_out;
|
||||
int c;
|
||||
pos_T *pos;
|
||||
write_one_mark(FILE *fp_out, int c, pos_T *pos)
|
||||
{
|
||||
if (pos->lnum != 0)
|
||||
fprintf(fp_out, "\t%c\t%ld\t%d\n", c, (long)pos->lnum, (int)pos->col);
|
||||
@@ -1648,12 +1610,12 @@ write_one_mark(fp_out, c, pos)
|
||||
* fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
|
||||
*/
|
||||
void
|
||||
copy_viminfo_marks(virp, fp_out, count, eof, flags)
|
||||
vir_T *virp;
|
||||
FILE *fp_out;
|
||||
int count;
|
||||
int eof;
|
||||
int flags;
|
||||
copy_viminfo_marks(
|
||||
vir_T *virp,
|
||||
FILE *fp_out,
|
||||
int count,
|
||||
int eof,
|
||||
int flags)
|
||||
{
|
||||
char_u *line = virp->vir_line;
|
||||
buf_T *buf;
|
||||
|
||||
+154
-271
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user