mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
vim-patch:8.1.2094: the fileio.c file is too big
Problem: The fileio.c file is too big.
Solution: Move buf_write() to bufwrite.c. (Yegappan Lakshmanan,
closes vim/vim#4990)
c079f0fed1
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
parent
ccc939ec10
commit
7bf1a917b7
@ -20,6 +20,7 @@
|
||||
{ include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] },
|
||||
{ include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] },
|
||||
{ include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] },
|
||||
{ include: [ '"bufwrite.h.generated.h"', private, '"nvim/bufwrite.h"', public ] },
|
||||
{ include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] },
|
||||
{ include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] },
|
||||
{ include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] },
|
||||
|
1927
src/nvim/bufwrite.c
Normal file
1927
src/nvim/bufwrite.c
Normal file
File diff suppressed because it is too large
Load Diff
11
src/nvim/bufwrite.h
Normal file
11
src/nvim/bufwrite.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef NVIM_BUFWRITE_H
|
||||
#define NVIM_BUFWRITE_H
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "bufwrite.h.generated.h"
|
||||
#endif
|
||||
|
||||
#endif // NVIM_BUFWRITE_H
|
@ -22,6 +22,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/bufwrite.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/buffer_updates.h"
|
||||
#include "nvim/bufwrite.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/channel.h"
|
||||
#include "nvim/charset.h"
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/bufwrite.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/channel.h"
|
||||
#include "nvim/eval.h"
|
||||
|
1924
src/nvim/fileio.c
1924
src/nvim/fileio.c
File diff suppressed because it is too large
Load Diff
@ -20,8 +20,29 @@
|
||||
|
||||
typedef varnumber_T (*CheckItem)(void *expr, const char *name);
|
||||
|
||||
enum {
|
||||
FIO_LATIN1 = 0x01, // convert Latin1
|
||||
FIO_UTF8 = 0x02, // convert UTF-8
|
||||
FIO_UCS2 = 0x04, // convert UCS-2
|
||||
FIO_UCS4 = 0x08, // convert UCS-4
|
||||
FIO_UTF16 = 0x10, // convert UTF-16
|
||||
FIO_ENDIAN_L = 0x80, // little endian
|
||||
FIO_NOCONVERT = 0x2000, // skip encoding conversion
|
||||
FIO_UCSBOM = 0x4000, // check for BOM at start of file
|
||||
FIO_ALL = -1, // allow all formats
|
||||
};
|
||||
|
||||
// When converting, a read() or write() may leave some bytes to be converted
|
||||
// for the next call. The value is guessed...
|
||||
#define CONV_RESTLEN 30
|
||||
|
||||
#define WRITEBUFSIZE 8192 // size of normal write buffer
|
||||
|
||||
// We have to guess how much a sequence of bytes may expand when converting
|
||||
// with iconv() to be able to allocate a buffer.
|
||||
#define ICONV_MULT 8
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
// Events for autocommands
|
||||
# include "fileio.h.generated.h"
|
||||
#endif
|
||||
#endif // NVIM_FILEIO_H
|
||||
|
Loading…
Reference in New Issue
Block a user